rename(): avoid a deadlock in the case of parents having no common ancestor
[linux-2.6-block.git] / fs / ecryptfs / inode.c
index a25dd3d20008bfa40d2fc81b797f4dfa3f9118db..8efd20dc902bf39875507e22bd94de5c25c4ed83 100644 (file)
@@ -599,6 +599,8 @@ ecryptfs_rename(struct mnt_idmap *idmap, struct inode *old_dir,
        target_inode = d_inode(new_dentry);
 
        trap = lock_rename(lower_old_dir_dentry, lower_new_dir_dentry);
+       if (IS_ERR(trap))
+               return PTR_ERR(trap);
        dget(lower_new_dentry);
        rc = -EINVAL;
        if (lower_old_dentry->d_parent != lower_old_dir_dentry)