From: Erez Zadok Date: Wed, 23 Apr 2008 23:33:26 +0000 (-0400) Subject: Unionfs: lock parent dentry branch config in write X-Git-Tag: unionfs-2.3.3~1 X-Git-Url: https://git.fsl.cs.sunysb.edu/?a=commitdiff_plain;h=7b997691ed14da6795af7fb5b529b196eccba404;p=unionfs-2.6.9.y.git Unionfs: lock parent dentry branch config in write Ensure that branch configuration is available to file_revalidate should a copyup be required. Signed-off-by: Erez Zadok --- diff --git a/fs/unionfs/file.c b/fs/unionfs/file.c index e0869ea7e6e..3feb1d7e019 100644 --- a/fs/unionfs/file.c +++ b/fs/unionfs/file.c @@ -55,7 +55,9 @@ static ssize_t unionfs_write(struct file *file, const char __user *buf, unionfs_read_lock(dentry->d_sb, UNIONFS_SMUTEX_PARENT); unionfs_lock_dentry(dentry, UNIONFS_DMUTEX_CHILD); - err = unionfs_file_revalidate(file, true); + if (dentry != dentry->d_parent) + unionfs_lock_dentry(dentry->d_parent, UNIONFS_DMUTEX_PARENT); + err = unionfs_file_revalidate_locked(file, true); if (unlikely(err)) goto out; @@ -72,6 +74,8 @@ static ssize_t unionfs_write(struct file *file, const char __user *buf, } out: + if (dentry != dentry->d_parent) + unionfs_unlock_dentry(dentry->d_parent); unionfs_unlock_dentry(dentry); unionfs_read_unlock(dentry->d_sb); return err;