Re: [PATCH v2 3/9] md: add serialize_policy sysfs node for raid1

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Nov 21, 2019 at 2:37 AM <jgq516@xxxxxxxxx> wrote:
>
> From: Guoqing Jiang <guoqing.jiang@xxxxxxxxxxxxxxx>
>
> With the new sysfs node, we can use it to control if raid1 array
> wants io serialization or not. So mddev_create_serial_pool and
> mddev_destroy_serial_pool are called in serialize_policy_store
> to enable or disable the serialization.
>
> Signed-off-by: Guoqing Jiang <guoqing.jiang@xxxxxxxxxxxxxxx>

I added:

diff --git i/drivers/md/md.c w/drivers/md/md.c
index efeaeba3583d..5a2bb6bcc43d 100644
--- i/drivers/md/md.c
+++ w/drivers/md/md.c
@@ -5330,6 +5330,9 @@ serialize_policy_store(struct mddev *mddev,
const char *buf, size_t len)
        if (value == mddev->serialize_policy)
                return len;

+       if (value < 0 || value > 1)
+               return -EINVAL;
+
        err = mddev_lock(mddev);
        if (err)
                return err;



[Index of Archives]     [Linux RAID Wiki]     [ATA RAID]     [Linux SCSI Target Infrastructure]     [Linux Block]     [Linux IDE]     [Linux SCSI]     [Linux Hams]     [Device Mapper]     [Device Mapper Cryptographics]     [Kernel]     [Linux Admin]     [Linux Net]     [GFS]     [RPM]     [git]     [Yosemite Forum]


  Powered by Linux