[PATCH v1] fs: Fix error checking for d_hash_and_lookup()

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

 



In case of failure, debugfs_create_dir() returns NULL or an error
pointer. Most incorrect error checks were fixed, but the one in
d_add_ci() was forgotten.

Fixes: d9171b934526 ("parallel lookups machinery, part 4 (and last)")
Signed-off-by: Wang Ming <machel@xxxxxxxx>
---
 fs/dcache.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/dcache.c b/fs/dcache.c
index 52e6d5fdab6b..2f03e275d2e0 100644
--- a/fs/dcache.c
+++ b/fs/dcache.c
@@ -2220,7 +2220,7 @@ struct dentry *d_add_ci(struct dentry *dentry, struct inode *inode,
 	 * if not go ahead and create it now.
 	 */
 	found = d_hash_and_lookup(dentry->d_parent, name);
-	if (found) {
+	if (!IS_ERR_OR_NULL(found)) {
 		iput(inode);
 		return found;
 	}
-- 
2.25.1




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

  Powered by Linux