tech-kern archive

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

Re: struct file reference at VFS level



On Fri, Apr 22, 2016 at 09:10:23AM +0000, Emmanuel Dreyfus wrote:
 > I talked to the glusterFS developer that hit the problem about the 
 > requirement. This is to iplement mandatory locks, a feature not available 
 > in UFS.

UFS isn't relevant.

 > Quooted below is the scenario chere the problem arise:
 > 
 > > (...) proposed mandatory lock feature checks for locks during
 > > every data modifying fops. And hence we make use of fd flags too. Let
 > > me explain the scenario from my test case:
 > >
 > > Process 1 opens file 'foo' with O_RDWR and acquires a shared byte range
 > > lock. Process 2 opens the same file 'foo' with O_RDWR|O_NONBLOCK so as
 > > to fail the next write in case a conflicting lock is found. Both
 > > processes are acting on the same mount point and hence we have the
 > > issue of reusing the previous open which does not contain O_NONBLOCK
 > > flag. As a result instead of failing the write fop it will continue to
 > > wait until the conflicting byte range lock is released.

If something in fuse is causing these cases to share the same open and
thus the same struct file, fuse is broken. Fix fuse first.

If that isn't what's happening, the next possible problem is that
puffs/refuse/whatnot is the losing IO_NDELAY flag of VOP_WRITE. If so,
fuse is broken. Fix fuse first.

If the problem is merely that you're being passed IO_NDELAY and not
noticing/using it, try fixing that before gunking up the kernel...

-- 
David A. Holland
dholland%netbsd.org@localhost


Home | Main Index | Thread Index | Old Index