All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mike Snitzer <snitzer@kernel.org>
To: dm-devel@redhat.com
Cc: ebiggers@kernel.org, Heinz Mauelshagen <heinzm@redhat.com>,
	Mike Snitzer <snitzer@kernel.org>
Subject: [dm-devel] [PATCH 22/39] dm: avoid using symbolic permissions
Date: Mon, 13 Feb 2023 15:13:44 -0500	[thread overview]
Message-ID: <20230213201401.45973-23-snitzer@kernel.org> (raw)
In-Reply-To: <20230213201401.45973-1-snitzer@kernel.org>

From: Heinz Mauelshagen <heinzm@redhat.com>

Signed-off-by: Heinz Mauelshagen <heinzm@redhat.com>
Signed-off-by: Mike Snitzer <snitzer@kernel.org>
---
 drivers/md/dm-bufio.c         | 16 ++++++++--------
 drivers/md/dm-kcopyd.c        |  2 +-
 drivers/md/dm-mpath.c         |  3 +--
 drivers/md/dm-rq.c            |  8 ++++----
 drivers/md/dm-stats.c         |  2 +-
 drivers/md/dm-sysfs.c         |  4 ++--
 drivers/md/dm-thin.c          |  2 +-
 drivers/md/dm-verity-target.c |  2 +-
 drivers/md/dm.c               |  6 +++---
 9 files changed, 22 insertions(+), 23 deletions(-)

diff --git a/drivers/md/dm-bufio.c b/drivers/md/dm-bufio.c
index af310bed6ba9..a5d7f8555aa0 100644
--- a/drivers/md/dm-bufio.c
+++ b/drivers/md/dm-bufio.c
@@ -2165,28 +2165,28 @@ static void __exit dm_bufio_exit(void)
 module_init(dm_bufio_init)
 module_exit(dm_bufio_exit)
 
-module_param_named(max_cache_size_bytes, dm_bufio_cache_size, ulong, S_IRUGO | S_IWUSR);
+module_param_named(max_cache_size_bytes, dm_bufio_cache_size, ulong, 0644);
 MODULE_PARM_DESC(max_cache_size_bytes, "Size of metadata cache");
 
-module_param_named(max_age_seconds, dm_bufio_max_age, uint, S_IRUGO | S_IWUSR);
+module_param_named(max_age_seconds, dm_bufio_max_age, uint, 0644);
 MODULE_PARM_DESC(max_age_seconds, "Max age of a buffer in seconds");
 
-module_param_named(retain_bytes, dm_bufio_retain_bytes, ulong, S_IRUGO | S_IWUSR);
+module_param_named(retain_bytes, dm_bufio_retain_bytes, ulong, 0644);
 MODULE_PARM_DESC(retain_bytes, "Try to keep at least this many bytes cached in memory");
 
-module_param_named(peak_allocated_bytes, dm_bufio_peak_allocated, ulong, S_IRUGO | S_IWUSR);
+module_param_named(peak_allocated_bytes, dm_bufio_peak_allocated, ulong, 0644);
 MODULE_PARM_DESC(peak_allocated_bytes, "Tracks the maximum allocated memory");
 
-module_param_named(allocated_kmem_cache_bytes, dm_bufio_allocated_kmem_cache, ulong, S_IRUGO);
+module_param_named(allocated_kmem_cache_bytes, dm_bufio_allocated_kmem_cache, ulong, 0444);
 MODULE_PARM_DESC(allocated_kmem_cache_bytes, "Memory allocated with kmem_cache_alloc");
 
-module_param_named(allocated_get_free_pages_bytes, dm_bufio_allocated_get_free_pages, ulong, S_IRUGO);
+module_param_named(allocated_get_free_pages_bytes, dm_bufio_allocated_get_free_pages, ulong, 0444);
 MODULE_PARM_DESC(allocated_get_free_pages_bytes, "Memory allocated with get_free_pages");
 
-module_param_named(allocated_vmalloc_bytes, dm_bufio_allocated_vmalloc, ulong, S_IRUGO);
+module_param_named(allocated_vmalloc_bytes, dm_bufio_allocated_vmalloc, ulong, 0444);
 MODULE_PARM_DESC(allocated_vmalloc_bytes, "Memory allocated with vmalloc");
 
-module_param_named(current_allocated_bytes, dm_bufio_current_allocated, ulong, S_IRUGO);
+module_param_named(current_allocated_bytes, dm_bufio_current_allocated, ulong, 0444);
 MODULE_PARM_DESC(current_allocated_bytes, "Memory currently used by the cache");
 
 MODULE_AUTHOR("Mikulas Patocka <dm-devel@redhat.com>");
diff --git a/drivers/md/dm-kcopyd.c b/drivers/md/dm-kcopyd.c
index 0027349aa6be..81bc33a3581d 100644
--- a/drivers/md/dm-kcopyd.c
+++ b/drivers/md/dm-kcopyd.c
@@ -37,7 +37,7 @@
 
 static unsigned int kcopyd_subjob_size_kb = DEFAULT_SUB_JOB_SIZE_KB;
 
-module_param(kcopyd_subjob_size_kb, uint, S_IRUGO | S_IWUSR);
+module_param(kcopyd_subjob_size_kb, uint, 0644);
 MODULE_PARM_DESC(kcopyd_subjob_size_kb, "Sub-job size for dm-kcopyd clients");
 
 static unsigned int dm_get_kcopyd_subjob_size(void)
diff --git a/drivers/md/dm-mpath.c b/drivers/md/dm-mpath.c
index c15cc7f54bd2..2524ac702145 100644
--- a/drivers/md/dm-mpath.c
+++ b/drivers/md/dm-mpath.c
@@ -2258,8 +2258,7 @@ static void __exit dm_multipath_exit(void)
 module_init(dm_multipath_init);
 module_exit(dm_multipath_exit);
 
-module_param_named(queue_if_no_path_timeout_secs,
-		   queue_if_no_path_timeout_secs, ulong, S_IRUGO | S_IWUSR);
+module_param_named(queue_if_no_path_timeout_secs, queue_if_no_path_timeout_secs, ulong, 0644);
 MODULE_PARM_DESC(queue_if_no_path_timeout_secs, "No available paths queue IO timeout in seconds");
 
 MODULE_DESCRIPTION(DM_NAME " multipath target");
diff --git a/drivers/md/dm-rq.c b/drivers/md/dm-rq.c
index d5f368965d3b..fec63b2a907d 100644
--- a/drivers/md/dm-rq.c
+++ b/drivers/md/dm-rq.c
@@ -584,16 +584,16 @@ void dm_mq_cleanup_mapped_device(struct mapped_device *md)
 	}
 }
 
-module_param(reserved_rq_based_ios, uint, S_IRUGO | S_IWUSR);
+module_param(reserved_rq_based_ios, uint, 0644);
 MODULE_PARM_DESC(reserved_rq_based_ios, "Reserved IOs in request-based mempools");
 
 /* Unused, but preserved for userspace compatibility */
 static bool use_blk_mq = true;
-module_param(use_blk_mq, bool, S_IRUGO | S_IWUSR);
+module_param(use_blk_mq, bool, 0644);
 MODULE_PARM_DESC(use_blk_mq, "Use block multiqueue for request-based DM devices");
 
-module_param(dm_mq_nr_hw_queues, uint, S_IRUGO | S_IWUSR);
+module_param(dm_mq_nr_hw_queues, uint, 0644);
 MODULE_PARM_DESC(dm_mq_nr_hw_queues, "Number of hardware queues for request-based dm-mq devices");
 
-module_param(dm_mq_queue_depth, uint, S_IRUGO | S_IWUSR);
+module_param(dm_mq_queue_depth, uint, 0644);
 MODULE_PARM_DESC(dm_mq_queue_depth, "Queue depth for request-based dm-mq devices");
diff --git a/drivers/md/dm-stats.c b/drivers/md/dm-stats.c
index 12d17b1a83a9..5e49e02ee174 100644
--- a/drivers/md/dm-stats.c
+++ b/drivers/md/dm-stats.c
@@ -1247,5 +1247,5 @@ void dm_statistics_exit(void)
 		DMCRIT("shared_memory_amount leaked: %lu", shared_memory_amount);
 }
 
-module_param_named(stats_current_allocated_bytes, shared_memory_amount, ulong, S_IRUGO);
+module_param_named(stats_current_allocated_bytes, shared_memory_amount, ulong, 0444);
 MODULE_PARM_DESC(stats_current_allocated_bytes, "Memory currently used by statistics");
diff --git a/drivers/md/dm-sysfs.c b/drivers/md/dm-sysfs.c
index c090cb184093..914c0e767a3c 100644
--- a/drivers/md/dm-sysfs.c
+++ b/drivers/md/dm-sysfs.c
@@ -18,7 +18,7 @@ struct dm_sysfs_attr {
 
 #define DM_ATTR_RO(_name) \
 struct dm_sysfs_attr dm_attr_##_name = \
-	__ATTR(_name, S_IRUGO, dm_attr_##_name##_show, NULL)
+	__ATTR(_name, 0444, dm_attr_##_name##_show, NULL)
 
 static ssize_t dm_attr_show(struct kobject *kobj, struct attribute *attr,
 			    char *page)
@@ -43,7 +43,7 @@ static ssize_t dm_attr_show(struct kobject *kobj, struct attribute *attr,
 
 #define DM_ATTR_RW(_name) \
 struct dm_sysfs_attr dm_attr_##_name = \
-	__ATTR(_name, S_IRUGO | S_IWUSR, dm_attr_##_name##_show, dm_attr_##_name##_store)
+	__ATTR(_name, 0644, dm_attr_##_name##_show, dm_attr_##_name##_store)
 
 static ssize_t dm_attr_store(struct kobject *kobj, struct attribute *attr,
 			     const char *page, size_t count)
diff --git a/drivers/md/dm-thin.c b/drivers/md/dm-thin.c
index e2ff22e79367..c8d3b20401f4 100644
--- a/drivers/md/dm-thin.c
+++ b/drivers/md/dm-thin.c
@@ -4532,7 +4532,7 @@ static void dm_thin_exit(void)
 module_init(dm_thin_init);
 module_exit(dm_thin_exit);
 
-module_param_named(no_space_timeout, no_space_timeout_secs, uint, S_IRUGO | S_IWUSR);
+module_param_named(no_space_timeout, no_space_timeout_secs, uint, 0644);
 MODULE_PARM_DESC(no_space_timeout, "Out of data space queue IO timeout in seconds");
 
 MODULE_DESCRIPTION(DM_NAME " thin provisioning target");
diff --git a/drivers/md/dm-verity-target.c b/drivers/md/dm-verity-target.c
index 1db64a24623d..0f9814099d1b 100644
--- a/drivers/md/dm-verity-target.c
+++ b/drivers/md/dm-verity-target.c
@@ -43,7 +43,7 @@
 
 static unsigned int dm_verity_prefetch_cluster = DM_VERITY_DEFAULT_PREFETCH_SIZE;
 
-module_param_named(prefetch_cluster, dm_verity_prefetch_cluster, uint, S_IRUGO | S_IWUSR);
+module_param_named(prefetch_cluster, dm_verity_prefetch_cluster, uint, 0644);
 
 static DEFINE_STATIC_KEY_FALSE(use_tasklet_enabled);
 
diff --git a/drivers/md/dm.c b/drivers/md/dm.c
index 16f29a60a64f..a54700b6c9eb 100644
--- a/drivers/md/dm.c
+++ b/drivers/md/dm.c
@@ -3394,13 +3394,13 @@ module_exit(dm_exit);
 module_param(major, uint, 0);
 MODULE_PARM_DESC(major, "The major number of the device mapper");
 
-module_param(reserved_bio_based_ios, uint, S_IRUGO | S_IWUSR);
+module_param(reserved_bio_based_ios, uint, 0644);
 MODULE_PARM_DESC(reserved_bio_based_ios, "Reserved IOs in bio-based mempools");
 
-module_param(dm_numa_node, int, S_IRUGO | S_IWUSR);
+module_param(dm_numa_node, int, 0644);
 MODULE_PARM_DESC(dm_numa_node, "NUMA node for DM device memory allocations");
 
-module_param(swap_bios, int, S_IRUGO | S_IWUSR);
+module_param(swap_bios, int, 0644);
 MODULE_PARM_DESC(swap_bios, "Maximum allowed inflight swap IOs");
 
 MODULE_DESCRIPTION(DM_NAME " driver");
-- 
2.37.0 (Apple Git-136)

--
dm-devel mailing list
dm-devel@redhat.com
https://listman.redhat.com/mailman/listinfo/dm-devel


  parent reply	other threads:[~2023-02-13 20:15 UTC|newest]

Thread overview: 40+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-13 20:13 [dm-devel] [PATCH 00/39] dm: fix checkpatch errors and warnings Mike Snitzer
2023-02-13 20:13 ` [dm-devel] [PATCH 01/39] dm: add missing SPDX-License-Indentifiers Mike Snitzer
2023-02-13 20:13 ` [dm-devel] [PATCH 02/39] dm: prefer kmap_local_page() instead of deprecated kmap_atomic() Mike Snitzer
2023-02-13 20:13 ` [dm-devel] [PATCH 03/39] dm: use fsleep() instead of msleep() for deterministic sleep duration Mike Snitzer
2023-02-13 20:13 ` [dm-devel] [PATCH 04/39] dm: change "unsigned" to "unsigned int" Mike Snitzer
2023-02-13 20:13 ` [dm-devel] [PATCH 05/39] dm: avoid assignment in if conditions Mike Snitzer
2023-02-13 20:13 ` [dm-devel] [PATCH 06/39] dm: enclose complex macros into parentheses where possible Mike Snitzer
2023-02-13 20:13 ` [dm-devel] [PATCH 07/39] dm: avoid initializing static variables Mike Snitzer
2023-02-13 20:13 ` [dm-devel] [PATCH 08/39] dm: address space issues relative to switch/while/for/ Mike Snitzer
2023-02-13 20:13 ` [dm-devel] [PATCH 09/39] dm: address indent/space issues Mike Snitzer
2023-02-13 20:13 ` [dm-devel] [PATCH 10/39] dm: correct block comments format Mike Snitzer
2023-02-13 20:13 ` [dm-devel] [PATCH 11/39] dm: fix undue/missing spaces Mike Snitzer
2023-02-13 20:13 ` [dm-devel] [PATCH 12/39] dm: fix trailing statements Mike Snitzer
2023-02-13 20:13 ` [dm-devel] [PATCH 13/39] dm crypt: correct 'foo*' to 'foo *' Mike Snitzer
2023-02-13 20:13 ` [dm-devel] [PATCH 14/39] dm block-manager: avoid not required parentheses Mike Snitzer
2023-02-13 20:13 ` [dm-devel] [PATCH 15/39] dm: avoid spaces before function arguments or in favour of tabs Mike Snitzer
2023-02-13 20:13 ` [dm-devel] [PATCH 16/39] dm: add argument identifier names Mike Snitzer
2023-02-13 20:13 ` [dm-devel] [PATCH 17/39] dm: add missing empty lines Mike Snitzer
2023-02-13 20:13 ` [dm-devel] [PATCH 18/39] dm: remove unnecessary braces from single statement blocks Mike Snitzer
2023-02-13 20:13 ` [dm-devel] [PATCH 19/39] dm: avoid split of quoted strings where possible Mike Snitzer
2023-02-13 20:13 ` [dm-devel] [PATCH 20/39] dm: adjust EXPORT_SYMBOL() to follow functions immediately Mike Snitzer
2023-02-13 20:13 ` [dm-devel] [PATCH 21/39] dm: prefer '"%s...", __func__' Mike Snitzer
2023-02-13 20:13 ` Mike Snitzer [this message]
2023-02-13 20:13 ` [dm-devel] [PATCH 23/39] dm: favour __aligned(N) versus "__attribute__ (aligned(N))" Mike Snitzer
2023-02-13 20:13 ` [dm-devel] [PATCH 24/39] dm: favour __packed versus "__attribute__ ((packed))" Mike Snitzer
2023-02-13 20:13 ` [dm-devel] [PATCH 25/39] dm: avoid useless 'else' after 'break' or return' Mike Snitzer
2023-02-13 20:13 ` [dm-devel] [PATCH 26/39] dm: add missing blank line after declarations/fix those Mike Snitzer
2023-02-13 20:13 ` [dm-devel] [PATCH 27/39] dm: avoid inline filenames Mike Snitzer
2023-02-13 20:13 ` [dm-devel] [PATCH 28/39] dm: don't indent labels Mike Snitzer
2023-02-13 20:13 ` [dm-devel] [PATCH 29/39] dm ioctl: have constant on the right side of the test Mike Snitzer
2023-02-13 20:13 ` [dm-devel] [PATCH 30/39] dm log: avoid trailing semicolon in macro Mike Snitzer
2023-02-13 20:13 ` [dm-devel] [PATCH 31/39] dm log: avoid multiple line dereference Mike Snitzer
2023-02-13 20:13 ` [dm-devel] [PATCH 32/39] dm: avoid 'do {} while(0)' loop in single statement macros Mike Snitzer
2023-02-13 20:13 ` [dm-devel] [PATCH 33/39] dm: fix use of sizeof() macro Mike Snitzer
2023-02-13 20:13 ` [dm-devel] [PATCH 34/39] dm integrity: change macros min/max() -> min_t/max_t where appropriate Mike Snitzer
2023-02-13 20:13 ` [dm-devel] [PATCH 35/39] dm: avoid void function return statements Mike Snitzer
2023-02-13 20:13 ` [dm-devel] [PATCH 36/39] dm ioctl: prefer strscpy() instead of strlcpy() Mike Snitzer
2023-02-13 20:13 ` [dm-devel] [PATCH 37/39] dm: fix suspect indent whitespace Mike Snitzer
2023-02-13 20:14 ` [dm-devel] [PATCH 38/39] dm: declare variables static when sensible Mike Snitzer
2023-02-13 20:14 ` [dm-devel] [PATCH 39/39] dm clone: prefer kvmalloc_array() Mike Snitzer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230213201401.45973-23-snitzer@kernel.org \
    --to=snitzer@kernel.org \
    --cc=dm-devel@redhat.com \
    --cc=ebiggers@kernel.org \
    --cc=heinzm@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.