Skip to content

Commit 6a80803

Browse files
mauelshaMike Snitzer
authored andcommitted
dm: avoid using symbolic permissions
Signed-off-by: Heinz Mauelshagen <[email protected]> Signed-off-by: Mike Snitzer <[email protected]>
1 parent 1c13188 commit 6a80803

File tree

9 files changed

+22
-23
lines changed

9 files changed

+22
-23
lines changed

drivers/md/dm-bufio.c

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2165,28 +2165,28 @@ static void __exit dm_bufio_exit(void)
21652165
module_init(dm_bufio_init)
21662166
module_exit(dm_bufio_exit)
21672167

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);
21692169
MODULE_PARM_DESC(max_cache_size_bytes, "Size of metadata cache");
21702170

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);
21722172
MODULE_PARM_DESC(max_age_seconds, "Max age of a buffer in seconds");
21732173

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);
21752175
MODULE_PARM_DESC(retain_bytes, "Try to keep at least this many bytes cached in memory");
21762176

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);
21782178
MODULE_PARM_DESC(peak_allocated_bytes, "Tracks the maximum allocated memory");
21792179

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);
21812181
MODULE_PARM_DESC(allocated_kmem_cache_bytes, "Memory allocated with kmem_cache_alloc");
21822182

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);
21842184
MODULE_PARM_DESC(allocated_get_free_pages_bytes, "Memory allocated with get_free_pages");
21852185

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);
21872187
MODULE_PARM_DESC(allocated_vmalloc_bytes, "Memory allocated with vmalloc");
21882188

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);
21902190
MODULE_PARM_DESC(current_allocated_bytes, "Memory currently used by the cache");
21912191

21922192
MODULE_AUTHOR("Mikulas Patocka <[email protected]>");

drivers/md/dm-kcopyd.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737

3838
static unsigned int kcopyd_subjob_size_kb = DEFAULT_SUB_JOB_SIZE_KB;
3939

40-
module_param(kcopyd_subjob_size_kb, uint, S_IRUGO | S_IWUSR);
40+
module_param(kcopyd_subjob_size_kb, uint, 0644);
4141
MODULE_PARM_DESC(kcopyd_subjob_size_kb, "Sub-job size for dm-kcopyd clients");
4242

4343
static unsigned int dm_get_kcopyd_subjob_size(void)

drivers/md/dm-mpath.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2258,8 +2258,7 @@ static void __exit dm_multipath_exit(void)
22582258
module_init(dm_multipath_init);
22592259
module_exit(dm_multipath_exit);
22602260

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);
22632262
MODULE_PARM_DESC(queue_if_no_path_timeout_secs, "No available paths queue IO timeout in seconds");
22642263

22652264
MODULE_DESCRIPTION(DM_NAME " multipath target");

drivers/md/dm-rq.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -584,16 +584,16 @@ void dm_mq_cleanup_mapped_device(struct mapped_device *md)
584584
}
585585
}
586586

587-
module_param(reserved_rq_based_ios, uint, S_IRUGO | S_IWUSR);
587+
module_param(reserved_rq_based_ios, uint, 0644);
588588
MODULE_PARM_DESC(reserved_rq_based_ios, "Reserved IOs in request-based mempools");
589589

590590
/* Unused, but preserved for userspace compatibility */
591591
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);
593593
MODULE_PARM_DESC(use_blk_mq, "Use block multiqueue for request-based DM devices");
594594

595-
module_param(dm_mq_nr_hw_queues, uint, S_IRUGO | S_IWUSR);
595+
module_param(dm_mq_nr_hw_queues, uint, 0644);
596596
MODULE_PARM_DESC(dm_mq_nr_hw_queues, "Number of hardware queues for request-based dm-mq devices");
597597

598-
module_param(dm_mq_queue_depth, uint, S_IRUGO | S_IWUSR);
598+
module_param(dm_mq_queue_depth, uint, 0644);
599599
MODULE_PARM_DESC(dm_mq_queue_depth, "Queue depth for request-based dm-mq devices");

drivers/md/dm-stats.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1247,5 +1247,5 @@ void dm_statistics_exit(void)
12471247
DMCRIT("shared_memory_amount leaked: %lu", shared_memory_amount);
12481248
}
12491249

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);
12511251
MODULE_PARM_DESC(stats_current_allocated_bytes, "Memory currently used by statistics");

drivers/md/dm-sysfs.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ struct dm_sysfs_attr {
1818

1919
#define DM_ATTR_RO(_name) \
2020
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)
2222

2323
static ssize_t dm_attr_show(struct kobject *kobj, struct attribute *attr,
2424
char *page)
@@ -43,7 +43,7 @@ static ssize_t dm_attr_show(struct kobject *kobj, struct attribute *attr,
4343

4444
#define DM_ATTR_RW(_name) \
4545
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)
4747

4848
static ssize_t dm_attr_store(struct kobject *kobj, struct attribute *attr,
4949
const char *page, size_t count)

drivers/md/dm-thin.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4532,7 +4532,7 @@ static void dm_thin_exit(void)
45324532
module_init(dm_thin_init);
45334533
module_exit(dm_thin_exit);
45344534

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);
45364536
MODULE_PARM_DESC(no_space_timeout, "Out of data space queue IO timeout in seconds");
45374537

45384538
MODULE_DESCRIPTION(DM_NAME " thin provisioning target");

drivers/md/dm-verity-target.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343

4444
static unsigned int dm_verity_prefetch_cluster = DM_VERITY_DEFAULT_PREFETCH_SIZE;
4545

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);
4747

4848
static DEFINE_STATIC_KEY_FALSE(use_tasklet_enabled);
4949

drivers/md/dm.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3384,13 +3384,13 @@ module_exit(dm_exit);
33843384
module_param(major, uint, 0);
33853385
MODULE_PARM_DESC(major, "The major number of the device mapper");
33863386

3387-
module_param(reserved_bio_based_ios, uint, S_IRUGO | S_IWUSR);
3387+
module_param(reserved_bio_based_ios, uint, 0644);
33883388
MODULE_PARM_DESC(reserved_bio_based_ios, "Reserved IOs in bio-based mempools");
33893389

3390-
module_param(dm_numa_node, int, S_IRUGO | S_IWUSR);
3390+
module_param(dm_numa_node, int, 0644);
33913391
MODULE_PARM_DESC(dm_numa_node, "NUMA node for DM device memory allocations");
33923392

3393-
module_param(swap_bios, int, S_IRUGO | S_IWUSR);
3393+
module_param(swap_bios, int, 0644);
33943394
MODULE_PARM_DESC(swap_bios, "Maximum allowed inflight swap IOs");
33953395

33963396
MODULE_DESCRIPTION(DM_NAME " driver");

0 commit comments

Comments
 (0)