Re: [mdadm PATCH 2/5] Retry HOT_REMOVE_DISK a few times.

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

 



Hi Neil,
>
> +int hot_remove_disk(int mdfd, unsigned long dev)
> +{
> +       int cnt = 5;
> +       int ret;
> +
> +       /* HOT_REMOVE_DISK can fail with EBUSY if there are
> +        * outstanding IO requests to the device.
> +        * In this case, it can be helpful to wait a little while,
> +        * up to half a second, for that IO to flush.
> +        */
> +       while ((ret = ioctl(mdfd, HOT_REMOVE_DISK, dev)) == -1 &&
> +              errno == EBUSY &&
> +              cnt-- > 0)
> +               usleep(10000);
> +
> +       return ret;
> +}
The comments is different with the code, 50000 us = 50 ms not half a seconds.

Other than that.

It looks good to me!

Reviewed-by: Jack Wang <jinpu.wang@xxxxxxxxxxxxxxxx>

Thanks,
Jack

> +
>  int set_array_info(int mdfd, struct supertype *st, struct mdinfo *info)
>  {
>         /* Initialise kernel's knowledge of array.
>
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-raid" in
> the body of a message to majordomo@xxxxxxxxxxxxxxx
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
--
To unsubscribe from this list: send the line "unsubscribe linux-raid" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[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