Re: [PATCH v5 12/16] md/raid5: support config stripe_size by sysfs entry
From: Yufen Yu <hidden>
Date: 2020-07-04 12:25:03
On 2020/7/3 6:38, Song Liu wrote:
On Thu, Jul 2, 2020 at 5:05 AM Yufen Yu [off-list ref] wrote:quoted
After this patch, we can adjust stripe_size by writing value into sysfs entry, likely, set stripe_size as 16KB: echo 16384 > /sys/block/md1/md/stripe_size Show current stripe_size value: cat /sys/block/md1/md/stripe_size stripe_size should not be bigger than PAGE_SIZE, and it requires to be multiple of 4096.I think we can just merge 02/16 into this one.quoted
Signed-off-by: Yufen Yu <redacted> --- drivers/md/raid5.c | 69 +++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 68 insertions(+), 1 deletion(-)diff --git a/drivers/md/raid5.c b/drivers/md/raid5.c index f0fd01d9122e..a3376a4e4e5c 100644 --- a/drivers/md/raid5.c +++ b/drivers/md/raid5.c@@ -6715,7 +6715,74 @@ raid5_show_stripe_size(struct mddev *mddev, char *page) static ssize_t raid5_store_stripe_size(struct mddev *mddev, const char *page, size_t len) { - return -EINVAL; + struct r5conf *conf = mddev->private;We need mddev_lock(mddev) before accessing mddev->private.
Thanks to point this bug. I will fix it. Thanks, Yufen