Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

dm: avoid using symbolic permissions

Signed-off-by: Heinz Mauelshagen <heinzm@redhat.com>
Signed-off-by: Mike Snitzer <snitzer@kernel.org>

authored by

Heinz Mauelshagen and committed by
Mike Snitzer
6a808034 1c131886

+22 -23
+8 -8
drivers/md/dm-bufio.c
··· 2165 2165 module_init(dm_bufio_init) 2166 2166 module_exit(dm_bufio_exit) 2167 2167 2168 - module_param_named(max_cache_size_bytes, dm_bufio_cache_size, ulong, S_IRUGO | S_IWUSR); 2168 + module_param_named(max_cache_size_bytes, dm_bufio_cache_size, ulong, 0644); 2169 2169 MODULE_PARM_DESC(max_cache_size_bytes, "Size of metadata cache"); 2170 2170 2171 - module_param_named(max_age_seconds, dm_bufio_max_age, uint, S_IRUGO | S_IWUSR); 2171 + module_param_named(max_age_seconds, dm_bufio_max_age, uint, 0644); 2172 2172 MODULE_PARM_DESC(max_age_seconds, "Max age of a buffer in seconds"); 2173 2173 2174 - module_param_named(retain_bytes, dm_bufio_retain_bytes, ulong, S_IRUGO | S_IWUSR); 2174 + module_param_named(retain_bytes, dm_bufio_retain_bytes, ulong, 0644); 2175 2175 MODULE_PARM_DESC(retain_bytes, "Try to keep at least this many bytes cached in memory"); 2176 2176 2177 - module_param_named(peak_allocated_bytes, dm_bufio_peak_allocated, ulong, S_IRUGO | S_IWUSR); 2177 + module_param_named(peak_allocated_bytes, dm_bufio_peak_allocated, ulong, 0644); 2178 2178 MODULE_PARM_DESC(peak_allocated_bytes, "Tracks the maximum allocated memory"); 2179 2179 2180 - module_param_named(allocated_kmem_cache_bytes, dm_bufio_allocated_kmem_cache, ulong, S_IRUGO); 2180 + module_param_named(allocated_kmem_cache_bytes, dm_bufio_allocated_kmem_cache, ulong, 0444); 2181 2181 MODULE_PARM_DESC(allocated_kmem_cache_bytes, "Memory allocated with kmem_cache_alloc"); 2182 2182 2183 - module_param_named(allocated_get_free_pages_bytes, dm_bufio_allocated_get_free_pages, ulong, S_IRUGO); 2183 + module_param_named(allocated_get_free_pages_bytes, dm_bufio_allocated_get_free_pages, ulong, 0444); 2184 2184 MODULE_PARM_DESC(allocated_get_free_pages_bytes, "Memory allocated with get_free_pages"); 2185 2185 2186 - module_param_named(allocated_vmalloc_bytes, dm_bufio_allocated_vmalloc, ulong, S_IRUGO); 2186 + module_param_named(allocated_vmalloc_bytes, dm_bufio_allocated_vmalloc, ulong, 0444); 2187 2187 MODULE_PARM_DESC(allocated_vmalloc_bytes, "Memory allocated with vmalloc"); 2188 2188 2189 - module_param_named(current_allocated_bytes, dm_bufio_current_allocated, ulong, S_IRUGO); 2189 + module_param_named(current_allocated_bytes, dm_bufio_current_allocated, ulong, 0444); 2190 2190 MODULE_PARM_DESC(current_allocated_bytes, "Memory currently used by the cache"); 2191 2191 2192 2192 MODULE_AUTHOR("Mikulas Patocka <dm-devel@redhat.com>");
+1 -1
drivers/md/dm-kcopyd.c
··· 37 37 38 38 static unsigned int kcopyd_subjob_size_kb = DEFAULT_SUB_JOB_SIZE_KB; 39 39 40 - module_param(kcopyd_subjob_size_kb, uint, S_IRUGO | S_IWUSR); 40 + module_param(kcopyd_subjob_size_kb, uint, 0644); 41 41 MODULE_PARM_DESC(kcopyd_subjob_size_kb, "Sub-job size for dm-kcopyd clients"); 42 42 43 43 static unsigned int dm_get_kcopyd_subjob_size(void)
+1 -2
drivers/md/dm-mpath.c
··· 2258 2258 module_init(dm_multipath_init); 2259 2259 module_exit(dm_multipath_exit); 2260 2260 2261 - module_param_named(queue_if_no_path_timeout_secs, 2262 - queue_if_no_path_timeout_secs, ulong, S_IRUGO | S_IWUSR); 2261 + module_param_named(queue_if_no_path_timeout_secs, queue_if_no_path_timeout_secs, ulong, 0644); 2263 2262 MODULE_PARM_DESC(queue_if_no_path_timeout_secs, "No available paths queue IO timeout in seconds"); 2264 2263 2265 2264 MODULE_DESCRIPTION(DM_NAME " multipath target");
+4 -4
drivers/md/dm-rq.c
··· 584 584 } 585 585 } 586 586 587 - module_param(reserved_rq_based_ios, uint, S_IRUGO | S_IWUSR); 587 + module_param(reserved_rq_based_ios, uint, 0644); 588 588 MODULE_PARM_DESC(reserved_rq_based_ios, "Reserved IOs in request-based mempools"); 589 589 590 590 /* Unused, but preserved for userspace compatibility */ 591 591 static bool use_blk_mq = true; 592 - module_param(use_blk_mq, bool, S_IRUGO | S_IWUSR); 592 + module_param(use_blk_mq, bool, 0644); 593 593 MODULE_PARM_DESC(use_blk_mq, "Use block multiqueue for request-based DM devices"); 594 594 595 - module_param(dm_mq_nr_hw_queues, uint, S_IRUGO | S_IWUSR); 595 + module_param(dm_mq_nr_hw_queues, uint, 0644); 596 596 MODULE_PARM_DESC(dm_mq_nr_hw_queues, "Number of hardware queues for request-based dm-mq devices"); 597 597 598 - module_param(dm_mq_queue_depth, uint, S_IRUGO | S_IWUSR); 598 + module_param(dm_mq_queue_depth, uint, 0644); 599 599 MODULE_PARM_DESC(dm_mq_queue_depth, "Queue depth for request-based dm-mq devices");
+1 -1
drivers/md/dm-stats.c
··· 1247 1247 DMCRIT("shared_memory_amount leaked: %lu", shared_memory_amount); 1248 1248 } 1249 1249 1250 - module_param_named(stats_current_allocated_bytes, shared_memory_amount, ulong, S_IRUGO); 1250 + module_param_named(stats_current_allocated_bytes, shared_memory_amount, ulong, 0444); 1251 1251 MODULE_PARM_DESC(stats_current_allocated_bytes, "Memory currently used by statistics");
+2 -2
drivers/md/dm-sysfs.c
··· 18 18 19 19 #define DM_ATTR_RO(_name) \ 20 20 struct dm_sysfs_attr dm_attr_##_name = \ 21 - __ATTR(_name, S_IRUGO, dm_attr_##_name##_show, NULL) 21 + __ATTR(_name, 0444, dm_attr_##_name##_show, NULL) 22 22 23 23 static ssize_t dm_attr_show(struct kobject *kobj, struct attribute *attr, 24 24 char *page) ··· 43 43 44 44 #define DM_ATTR_RW(_name) \ 45 45 struct dm_sysfs_attr dm_attr_##_name = \ 46 - __ATTR(_name, S_IRUGO | S_IWUSR, dm_attr_##_name##_show, dm_attr_##_name##_store) 46 + __ATTR(_name, 0644, dm_attr_##_name##_show, dm_attr_##_name##_store) 47 47 48 48 static ssize_t dm_attr_store(struct kobject *kobj, struct attribute *attr, 49 49 const char *page, size_t count)
+1 -1
drivers/md/dm-thin.c
··· 4532 4532 module_init(dm_thin_init); 4533 4533 module_exit(dm_thin_exit); 4534 4534 4535 - module_param_named(no_space_timeout, no_space_timeout_secs, uint, S_IRUGO | S_IWUSR); 4535 + module_param_named(no_space_timeout, no_space_timeout_secs, uint, 0644); 4536 4536 MODULE_PARM_DESC(no_space_timeout, "Out of data space queue IO timeout in seconds"); 4537 4537 4538 4538 MODULE_DESCRIPTION(DM_NAME " thin provisioning target");
+1 -1
drivers/md/dm-verity-target.c
··· 43 43 44 44 static unsigned int dm_verity_prefetch_cluster = DM_VERITY_DEFAULT_PREFETCH_SIZE; 45 45 46 - module_param_named(prefetch_cluster, dm_verity_prefetch_cluster, uint, S_IRUGO | S_IWUSR); 46 + module_param_named(prefetch_cluster, dm_verity_prefetch_cluster, uint, 0644); 47 47 48 48 static DEFINE_STATIC_KEY_FALSE(use_tasklet_enabled); 49 49
+3 -3
drivers/md/dm.c
··· 3384 3384 module_param(major, uint, 0); 3385 3385 MODULE_PARM_DESC(major, "The major number of the device mapper"); 3386 3386 3387 - module_param(reserved_bio_based_ios, uint, S_IRUGO | S_IWUSR); 3387 + module_param(reserved_bio_based_ios, uint, 0644); 3388 3388 MODULE_PARM_DESC(reserved_bio_based_ios, "Reserved IOs in bio-based mempools"); 3389 3389 3390 - module_param(dm_numa_node, int, S_IRUGO | S_IWUSR); 3390 + module_param(dm_numa_node, int, 0644); 3391 3391 MODULE_PARM_DESC(dm_numa_node, "NUMA node for DM device memory allocations"); 3392 3392 3393 - module_param(swap_bios, int, S_IRUGO | S_IWUSR); 3393 + module_param(swap_bios, int, 0644); 3394 3394 MODULE_PARM_DESC(swap_bios, "Maximum allowed inflight swap IOs"); 3395 3395 3396 3396 MODULE_DESCRIPTION(DM_NAME " driver");