Unionfs: Grab the unionfs sb private data lock around branch info users
authorErez Zadok <ezk@cs.sunysb.edu>
Thu, 22 Mar 2007 23:32:40 +0000 (19:32 -0400)
committerErez Zadok <ezk@cs.sunysb.edu>
Tue, 13 Jan 2009 02:29:41 +0000 (21:29 -0500)
commit994e8a1024f17a65829400c3f7bf5fe4605aa74f
treed2d13a9acf70ea7080fb2f05510315334551eec7
parentfc1e631f721deee12641b79393d6b2daae4d951e
Unionfs: Grab the unionfs sb private data lock around branch info users

Locking/concurrency/race fixes.  Use the unionfs superblock rwsem, and grab
the read lock around every op that uses branch-related information, such as
branch counters.  Grab the write rwsem lock in operations which attempt to
change branch information, such as when adding/deleting branches.  This
will, for example, cause branch-management remount commands (which are
infrequent) to block a bit until all in-progress file operations on open
files are done.

Signed-off-by: Erez Zadok <ezk@cs.sunysb.edu>
[jsipek: whitespace fixes & more locks/unlocks]
Signed-off-by: Josef 'Jeff' Sipek <jsipek@cs.sunysb.edu>
fs/unionfs/commonfops.c
fs/unionfs/copyup.c
fs/unionfs/dirfops.c
fs/unionfs/dirhelper.c
fs/unionfs/file.c
fs/unionfs/inode.c
fs/unionfs/main.c
fs/unionfs/super.c
fs/unionfs/union.h