]> err.no Git - linux-2.6/commitdiff
ocfs2: Improve rename locking
authorJan Kara <jack@suse.cz>
Thu, 21 Feb 2008 17:00:00 +0000 (18:00 +0100)
committerMark Fasheh <mfasheh@suse.com>
Fri, 18 Apr 2008 15:56:11 +0000 (08:56 -0700)
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>
fs/ocfs2/namei.c

index ab5a2272d0eb4047fe41e74c602c4e939fc18519..d5d808fe0140f7fb1e590c0255dd045542219bd1 100644 (file)
@@ -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);