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

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Pavel Emelyanov <xemul@...>
Cc: Linux Kernel Mailing List <linux-kernel@...>, <devel@...>
Date: Sunday, September 16, 2007 - 3:41 pm

On Thu, Sep 13, 2007 at 06:30:43PM +0400, Pavel Emelyanov wrote:

I suppose so.  Does anyone actually use mandatory locking?

Would it be worth adding a

	if (MANDATORY_LOCK(inode))
		return;

to the beginning of locks_wakeup_mandatory() to avoid walking the list
of locks in that case?  Perhaps setattr is rare enough that this just
isn't worth caring about.

Is there a small chance that a lock may be applied after this check:


but early enough that someone can still block on the lock while the file
is still marked for mandatory locking?  (And is the inode->i_flock check
there really necessary?)

Well, there are probably worse races in the mandatory locking code.
(For example, my impression is that a mandatory lock can be applied just
after the locks_mandatory_area() checks but before the io actually
completes.)

--b.

-
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH] Wake up mandatory locks waiter on chmod, Pavel Emelyanov, (Thu Sep 13, 10:30 am)
Re: [PATCH] Wake up mandatory locks waiter on chmod, J. Bruce Fields, (Sun Sep 16, 3:41 pm)
Re: [PATCH] Wake up mandatory locks waiter on chmod, Pavel Emelyanov, (Mon Sep 17, 2:37 am)
Re: [PATCH] Wake up mandatory locks waiter on chmod, J. Bruce Fields, (Mon Sep 17, 10:59 am)
Re: [PATCH] Wake up mandatory locks waiter on chmod, Pavel Emelyanov, (Tue Sep 18, 2:36 am)
Re: [PATCH] Wake up mandatory locks waiter on chmod, J. Bruce Fields, (Wed Sep 19, 2:07 pm)
Re: [PATCH] Wake up mandatory locks waiter on chmod, Trond Myklebust, (Wed Sep 19, 2:16 pm)