[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);
--
To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Kernel Development]     [Kernel Announce]     [Kernel Newbies]     [Linux Networking Development]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Device Mapper]

  Powered by Linux