Re: How does md gurantee not miss to free an active stripe_head when md stops?

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

 



On Wed, Jul 20 2016, Vaughan wrote:

> Hi Neil,
>
> I'm using v3.10 md code for develop. Recently I encounter a problem where an
> read IO usually returned from physical disk after md has been stopped.
> I reviewed the code and find when md stops, it unregister raid5d
> unconditionally and call shrink_stripes() to free only the *inactive*
> stripes.
> I know before stop, it uses O_EXCL open the md, but that won't stop others
> open it and send IO to it.
> So I think it's possible that some active stripes will be still running.

do_md_stop() calls sync_blockdev() which was supposed to wait for all
outstanding IO.  It probably doesn't wait for reads though, only writes.


>
> And I also found
> commit 5aa61f427e4979be733e4847b9199ff9cc48a47e
> Author: NeilBrown <neilb@xxxxxxx>
> Date:   Mon Dec 15 12:56:57 2014 +1100
>     md: split detach operation out from ->stop.
>
> add calling a quiesce before unregister raid5d in __md_stop, which not
> exists there before.
> Does this fix the hole when md stop?

Why don't you try it and see?

NeilBrown

Attachment: signature.asc
Description: PGP signature


[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