Unionfs ODF: Fix a lockdep recursive lock warning in exports master
authorRachita Kothiyal <rachita@louie.fsl.cs.sunysb.edu>
Tue, 20 May 2008 04:40:29 +0000 (00:40 -0400)
committerRachita Kothiyal <rachita@louie.fsl.cs.sunysb.edu>
Tue, 20 May 2008 04:40:29 +0000 (00:40 -0400)
With exports, another layer of locking gets introduced. In rename,
the following is the case:
lock_rename      (nfs_rename)
lock_rename (odf_rename)

Since the locks belong to different file systems, it's not a real issue.
Hence turning lockdep off momentarily is safe here (maybe not the
cleanest solution).

Signed-off-by: Rachita Kothiyal <rachita@fsl.cs.sunysb.edu>
fs/unionfs/odf.c

index 5989670512ef40f3e6c1904430c0002b161ec4b3..c6b9ae8062bf18d1be14fafc93e5389f3939813b 100644 (file)
@@ -505,6 +505,8 @@ int odf_rename(struct dentry *old_dentry, struct dentry *new_dentry)
        /* this should never happen */
        BUG_ON(new_odfdentry->d_inode);
 
+       /* see Documentation/filesystems/unionfs/issues.txt */
+       lockdep_off();
        lock_rename(old_dir, new_dir);
        current->fsuid = 0;
        current->fsgid = 0;
@@ -512,6 +514,7 @@ int odf_rename(struct dentry *old_dentry, struct dentry *new_dentry)
                         old_odfdentry, new_dir->d_inode,
                         new_odfdentry);
        unlock_rename(old_dir, new_dir);
+       lockdep_on();
        current->fsuid = olduid;
        current->fsgid = oldgid;
        dput(new_odfdentry);