OpenVZ Forum


Home » Mailing lists » Devel » [PATCH] Wake up mandatory locks waiter on chmod (v2)
Re: [PATCH] Wake up mandatory locks waiter on chmod (v2) [message #20543 is a reply to message #20480] Tue, 18 September 2007 18:38 Go to previous messageGo to previous message
Hugh Dickins is currently offline  Hugh Dickins
Messages: 16
Registered: September 2007
Junior Member
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, but I can't see where that's
> enfoced.  That file doesn't make any mention of the above race.

I believe the locks_verify_locked() call from mm/mmap.c prevents
mmap'ing shared-write a file with mandatory locks in force;
and the mapping_writably_mapped() calls from fs/locks.c prevent
mandatory locking on a file while it's mmap'ed shared-write.

Though I think there's no lock to prevent those checks racing,
so it's not quite watertight.

Hugh
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Kernel text size with the pid namespaces fixes
Next Topic: [PATCH] Add cgroup write_uint() helper method
Goto Forum:
  


Current Time: Sun Oct 20 02:02:58 GMT 2024

Total time taken to generate the page: 0.04813 seconds