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, 11 Nov 2014 02:31:35 +0000 (21:31 -0500)
commit1fc4be4fec6b09b0cb7979b5cc7d9be5eaf935e5
treebca4cae35a614674c3224f58cfa29eea92648c7e
parent264b6aacd82ea3d1d28b2ab4c05e8feb3f07ef2f
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