RE: open_dev_excl in reshape_container() fails

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

 




> -----Original Message-----
> From: linux-raid-owner@xxxxxxxxxxxxxxx [mailto:linux-raid-
> owner@xxxxxxxxxxxxxxx] On Behalf Of Dan Williams
> Sent: Thursday, January 13, 2011 6:28 PM
> To: Kwolek, Adam
> Cc: neilb@xxxxxxx; linux-raid@xxxxxxxxxxxxxxx; Neubauer, Wojciech;
> Ciechanowski, Ed
> Subject: Re: open_dev_excl in reshape_container() fails
> 
> 2011/1/13 Kwolek, Adam <adam.kwolek@xxxxxxxxx>:
> > Hi,
> >
> > I've got a problem using open_dev_excl() in reshape_container(), it
> fails. This functions goes down
> > and calls open() with flags O_DIRECT| O_RDWR| O_EXCL.
> > It fails in reshape_container(), ealier in Grow_reshape() exactly the
> same test call to open_dev_excl() succeed.
> > Between test open and open in reshape_container() there is no other
> open() performed (or other i/o operation that can cause problem).
> > It not depends on mdmon action because it is the same for raid5 and
> raid0.
> > Function open_dev() works, and I'm using it as workaround.
> >
> > In man pages for open() is told that O_EXCL flag should be used with
> O_CREAT flag only.
> > I've read in manual for open() also: "If O_EXCL is set and O_CREAT is
> not set, the result is undefined"
> 
> Right, it is undefined with respect to Posix, but for Linux O_EXCL on
> a block device without O_CREAT is defined to bd_claim the block
> device.
> 
> http://www.kernel.org/doc/man-pages/online/pages/man2/open.2.html
> 
> The second call to open_dev_excl is a bug, by definition you can't
> exclusive open twice.  Can you reuse the fd established in
> Grow_reshape?
> 
> --
> Dan

There is no second open. My test call to open_dev_excl() is closed at once ;),
and it is used to detect where I can successfully open device and if there is any duplicated open.
There is no other open that can block open_dev_excl() in reshape_container() (when monitor is absent also),
or I was unable to find it.
Handle cannot be reused, because in Grow_reshape() container is opened and in reshape_container() all arrays
Are opened one by one.

BR
Adam

> --
> 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