summaryrefslogtreecommitdiffstats
path: root/mdadm.h
diff options
context:
space:
mode:
authorMateusz Kusiak <mateusz.kusiak@intel.com>2024-01-18 11:28:40 +0100
committerMariusz Tkaczyk <mariusz.tkaczyk@linux.intel.com>2024-01-24 16:14:43 +0100
commit90fd70016b99e26e116b12246631b7d4aa3d3d08 (patch)
tree648a740ed3f7b338796a55f5f041f515b82875cb /mdadm.h
parenttests: Gate tests for linear flavor with variable LINEAR (diff)
downloadmdadm-90fd70016b99e26e116b12246631b7d4aa3d3d08.tar.xz
mdadm-90fd70016b99e26e116b12246631b7d4aa3d3d08.zip
Define sysfs max buffer size
sysfs_get_str() usages have inconsistant buffer size. This results in wild buffer declarations and redundant memory usage. Define maximum buffer size for sysfs strings. Replace wild sysfs string buffer sizes for globaly defined value. Signed-off-by: Mateusz Kusiak <mateusz.kusiak@intel.com> Signed-off-by: Mariusz Tkaczyk <mariusz.tkaczyk@linux.intel.com>
Diffstat (limited to 'mdadm.h')
-rw-r--r--mdadm.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/mdadm.h b/mdadm.h
index 8dcd8b86..46692730 100644
--- a/mdadm.h
+++ b/mdadm.h
@@ -767,6 +767,8 @@ enum sysfs_read_flags {
GET_DEVS_ALL = (1 << 27),
};
+#define SYSFS_MAX_BUF_SIZE 64
+
/* If fd >= 0, get the array it is open on,
* else use devnm.
*/