[PATCH 07/17] Unionfs: follow_link locking fixes

From: Erez Zadok
Date: Sat Feb 16 2008 - 21:59:29 EST


Signed-off-by: Erez Zadok <ezk@xxxxxxxxxxxxx>
---
fs/unionfs/inode.c | 6 +++++-
1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/fs/unionfs/inode.c b/fs/unionfs/inode.c
index 8d939dc..6377533 100644
--- a/fs/unionfs/inode.c
+++ b/fs/unionfs/inode.c
@@ -820,7 +820,11 @@ static void *unionfs_follow_link(struct dentry *dentry, struct nameidata *nd)
err = 0;

out:
- unionfs_check_dentry(dentry);
+ if (!err) {
+ unionfs_lock_dentry(dentry, UNIONFS_DMUTEX_CHILD);
+ unionfs_check_dentry(dentry);
+ unionfs_unlock_dentry(dentry);
+ }
unionfs_check_nd(nd);
return ERR_PTR(err);
}
--
1.5.2.2

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/