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

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: J. Bruce Fields
Date: Sunday, September 16, 2007 - 12: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, 7:30 am)
Re: [PATCH] Wake up mandatory locks waiter on chmod, J. Bruce Fields, (Sun Sep 16, 12:41 pm)
Re: [PATCH] Wake up mandatory locks waiter on chmod, Pavel Emelyanov, (Sun Sep 16, 11:37 pm)
Re: [PATCH] Wake up mandatory locks waiter on chmod, J. Bruce Fields, (Mon Sep 17, 7:59 am)
Re: [PATCH] Wake up mandatory locks waiter on chmod, Pavel Emelyanov, (Mon Sep 17, 11:36 pm)
Re: [PATCH] Wake up mandatory locks waiter on chmod, J. Bruce Fields, (Wed Sep 19, 11:07 am)
Re: [PATCH] Wake up mandatory locks waiter on chmod, Trond Myklebust, (Wed Sep 19, 11:16 am)