[PATCH] vfs: potential deadlock in insert_inode_locked()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



We added a new error path to insert_inode_locked() but we need to drop
the inode_hash_lock spin_lock before we return.

Fixes: 397127e49ff5 ("new primitive: discard_new_inode()")
Signed-off-by: Dan Carpenter <dan.carpenter@xxxxxxxxxx>

diff --git a/fs/inode.c b/fs/inode.c
index 593d0cfce27c..ed7c18495cd9 100644
--- a/fs/inode.c
+++ b/fs/inode.c
@@ -1462,6 +1462,7 @@ int insert_inode_locked(struct inode *inode)
 		}
 		if (unlikely(old->i_state & I_CREATING)) {
 			spin_unlock(&old->i_lock);
+			spin_unlock(&inode_hash_lock);
 			return -EBUSY;
 		}
 		__iget(old);



[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [Samba]     [Device Mapper]     [CEPH Development]

  Powered by Linux