From: Jan Kara <jack@suse.cz>
Date: Thu, 21 Feb 2008 17:00:00 +0000 (+0100)
Subject: ocfs2: Improve rename locking
X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=5dabd69515765156605b09261abf969236a77803;p=GitHub%2Fexynos8895%2Fandroid_kernel_samsung_universal8895.git

ocfs2: Improve rename locking

ocfs2_rename() was being too aggressive with the rename lock - we only need
it for certain forms of directory rename.

Signed-off-by: Jan Kara <jack@suse.cz>
Signed-off-by: Mark Fasheh <mfasheh@suse.com>
---

diff --git a/fs/ocfs2/namei.c b/fs/ocfs2/namei.c
index ab5a2272d0eb..d5d808fe0140 100644
--- a/fs/ocfs2/namei.c
+++ b/fs/ocfs2/namei.c
@@ -997,7 +997,7 @@ static int ocfs2_rename(struct inode *old_dir,
 	 *
 	 * And that's why, just like the VFS, we need a file system
 	 * rename lock. */
-	if (old_dentry != new_dentry) {
+	if (old_dir != new_dir && S_ISDIR(old_inode->i_mode)) {
 		status = ocfs2_rename_lock(osb);
 		if (status < 0) {
 			mlog_errno(status);