Re: [patch] ceph: ceph_get_inode() returns an ERR_PTR

Previous thread: [patch] affs: testing the wrong variable by Dan Carpenter on Wednesday, August 25, 2010 - 12:05 am. (1 message)

Next thread: [patch] sysfs: checking for NULL instead of ERR_PTR by Dan Carpenter on Wednesday, August 25, 2010 - 12:12 am. (1 message)
From: Dan Carpenter
Date: Wednesday, August 25, 2010 - 12:11 am

ceph_get_inode() returns an ERR_PTR and it doesn't return a NULL.

Signed-off-by: Dan Carpenter <error27@gmail.com>

diff --git a/fs/ceph/inode.c b/fs/ceph/inode.c
index 5d893d3..1e623ec 100644
--- a/fs/ceph/inode.c
+++ b/fs/ceph/inode.c
@@ -1229,11 +1229,11 @@ retry_lookup:
 			in = dn->d_inode;
 		} else {
 			in = ceph_get_inode(parent->d_sb, vino);
-			if (in == NULL) {
+			if (IS_ERR(in)) {
 				dout("new_inode badness\n");
 				d_delete(dn);
 				dput(dn);
-				err = -ENOMEM;
+				err = PTR_ERR(in);
 				goto out;
 			}
 			dn = splice_dentry(dn, in, NULL);
--

From: Sage Weil
Date: Wednesday, August 25, 2010 - 12:01 pm

Thanks, queueing this up!

sage


--

Previous thread: [patch] affs: testing the wrong variable by Dan Carpenter on Wednesday, August 25, 2010 - 12:05 am. (1 message)

Next thread: [patch] sysfs: checking for NULL instead of ERR_PTR by Dan Carpenter on Wednesday, August 25, 2010 - 12:12 am. (1 message)