Skip to content

Commit

Permalink
ceph: d_obtain_alias() returns ERR_PTR()
Browse files Browse the repository at this point in the history
d_obtain_alias() doesn't return NULL, it returns an ERR_PTR().

Signed-off-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: Sage Weil <sage@newdream.net>
  • Loading branch information
Dan Carpenter authored and Sage Weil committed May 17, 2010
1 parent c473ad9 commit 0d509c9
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions fs/ceph/export.c
Original file line number Diff line number Diff line change
Expand Up @@ -93,11 +93,11 @@ static struct dentry *__fh_to_dentry(struct super_block *sb,
return ERR_PTR(-ESTALE);

dentry = d_obtain_alias(inode);
if (!dentry) {
if (IS_ERR(dentry)) {
pr_err("fh_to_dentry %llx -- inode %p but ENOMEM\n",
fh->ino, inode);
iput(inode);
return ERR_PTR(-ENOMEM);
return dentry;
}
err = ceph_init_dentry(dentry);

Expand Down Expand Up @@ -149,11 +149,11 @@ static struct dentry *__cfh_to_dentry(struct super_block *sb,
}

dentry = d_obtain_alias(inode);
if (!dentry) {
if (IS_ERR(dentry)) {
pr_err("cfh_to_dentry %llx -- inode %p but ENOMEM\n",
cfh->ino, inode);
iput(inode);
return ERR_PTR(-ENOMEM);
return dentry;
}
err = ceph_init_dentry(dentry);
if (err < 0) {
Expand Down Expand Up @@ -202,11 +202,11 @@ static struct dentry *ceph_fh_to_parent(struct super_block *sb,
return ERR_PTR(-ESTALE);

dentry = d_obtain_alias(inode);
if (!dentry) {
if (IS_ERR(dentry)) {
pr_err("fh_to_parent %llx -- inode %p but ENOMEM\n",
cfh->ino, inode);
iput(inode);
return ERR_PTR(-ENOMEM);
return dentry;
}
err = ceph_init_dentry(dentry);
if (err < 0) {
Expand Down

0 comments on commit 0d509c9

Please sign in to comment.