Re: [PATCH] Wake up mandatory locks waiter on chmod (v2)

2007-09-18 Thread Hugh Dickins
On Tue, 18 Sep 2007, J. Bruce Fields wrote: > On Tue, Sep 18, 2007 at 12:54:56PM -0400, Trond Myklebust wrote: > > > > It gets even better when you throw mmap() into the mix :-) > > Hm. Documentation/mandatory.txt claims that it mandatory locks and > mmap() with MAP_SHARED exclude each other, bu

Re: [PATCH] Wake up mandatory locks waiter on chmod (v2)

2007-09-18 Thread J. Bruce Fields
On Tue, Sep 18, 2007 at 12:54:56PM -0400, Trond Myklebust wrote: > On Tue, 2007-09-18 at 12:52 -0400, J. Bruce Fields wrote: > > So currently there's nothing to prevent this: > > > > - write passes locks_mandatory_area() checks > > - get mandatory lock > > - rea

Re: [PATCH] Wake up mandatory locks waiter on chmod (v2)

2007-09-18 Thread Trond Myklebust
On Tue, 2007-09-18 at 12:52 -0400, J. Bruce Fields wrote: > On Tue, Sep 18, 2007 at 12:14:55PM -0400, Trond Myklebust wrote: > > Note also that strictly speaking, we're not even compliant with the > > System V behaviour on read() and write(). See: > > > > http://www.unix.org.ua/orelly/networking

Re: [PATCH] Wake up mandatory locks waiter on chmod (v2)

2007-09-18 Thread J. Bruce Fields
On Tue, Sep 18, 2007 at 12:14:55PM -0400, Trond Myklebust wrote: > Note also that strictly speaking, we're not even compliant with the > System V behaviour on read() and write(). See: > > http://www.unix.org.ua/orelly/networking_2ndEd/nfs/ch11_01.htm > and > > http://docs.sun.com/app/docs/doc

Re: [PATCH] Wake up mandatory locks waiter on chmod (v2)

2007-09-18 Thread Trond Myklebust
On Tue, 2007-09-18 at 11:19 -0400, J. Bruce Fields wrote: > Maybe this should be documented, e.g. in fcntl(2). I'm not sure exactly > what we'd say--we probably don't want to commit to the current behavior. > Maybe something like "behavior is undefined when setting or clearing > mandatory locking

Re: [PATCH] Wake up mandatory locks waiter on chmod (v2)

2007-09-18 Thread J. Bruce Fields
On Tue, Sep 18, 2007 at 10:33:26AM +0400, Pavel Emelyanov wrote: > Trond Myklebust wrote: > > IOW: the process that is waiting in locks_mandatory_area() will be > > released as soon as the advisory lock is dropped. If that theory is > > broken in practice, then that is the bug that we need to fix.

Re: [PATCH] Wake up mandatory locks waiter on chmod (v2)

2007-09-17 Thread Pavel Emelyanov
Trond Myklebust wrote: > On Mon, 2007-09-17 at 18:16 +0400, Pavel Emelyanov wrote: >> Trond Myklebust wrote: >>> On Mon, 2007-09-17 at 12:13 +0400, Pavel Emelyanov wrote: When the process is blocked on mandatory lock and someone changes the inode's permissions, so that the lock is no lon

Re: [PATCH] Wake up mandatory locks waiter on chmod (v2)

2007-09-17 Thread Trond Myklebust
On Mon, 2007-09-17 at 18:16 +0400, Pavel Emelyanov wrote: > Trond Myklebust wrote: > > On Mon, 2007-09-17 at 12:13 +0400, Pavel Emelyanov wrote: > >> When the process is blocked on mandatory lock and someone changes > >> the inode's permissions, so that the lock is no longer mandatory, > >> nobody

Re: [PATCH] Wake up mandatory locks waiter on chmod (v2)

2007-09-17 Thread Pavel Emelyanov
Trond Myklebust wrote: > On Mon, 2007-09-17 at 12:13 +0400, Pavel Emelyanov wrote: >> When the process is blocked on mandatory lock and someone changes >> the inode's permissions, so that the lock is no longer mandatory, >> nobody wakes up the blocked process, but probably should. > > Please expl

Re: [PATCH] Wake up mandatory locks waiter on chmod (v2)

2007-09-17 Thread Trond Myklebust
On Mon, 2007-09-17 at 12:13 +0400, Pavel Emelyanov wrote: > When the process is blocked on mandatory lock and someone changes > the inode's permissions, so that the lock is no longer mandatory, > nobody wakes up the blocked process, but probably should. Please explain in more detail why we need t

[PATCH] Wake up mandatory locks waiter on chmod (v2)

2007-09-17 Thread Pavel Emelyanov
When the process is blocked on mandatory lock and someone changes the inode's permissions, so that the lock is no longer mandatory, nobody wakes up the blocked process, but probably should. Switched to use mandatory_lock() static inline function. Signed-off-by: Pavel Emelyanov <[EMAIL PROTECTED]