public inbox for kernel-janitors@vger.kernel.org
 help / color / mirror / Atom feed
* [patch] ceph: d_obtain_alias() returns ERR_PTR()
@ 2010-04-21 10:31 Dan Carpenter
  2010-04-21 23:41 ` Sage Weil
  0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2010-04-21 10:31 UTC (permalink / raw)
  To: Sage Weil; +Cc: ceph-devel, kernel-janitors

d_obtain_alias() doesn't return NULL, it returns an ERR_PTR().

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

diff --git a/fs/ceph/export.c b/fs/ceph/export.c
index 9d67572..192ec40 100644
--- a/fs/ceph/export.c
+++ b/fs/ceph/export.c
@@ -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);
 
@@ -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) {
@@ -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) {

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [patch] ceph: d_obtain_alias() returns ERR_PTR()
  2010-04-21 10:31 [patch] ceph: d_obtain_alias() returns ERR_PTR() Dan Carpenter
@ 2010-04-21 23:41 ` Sage Weil
  0 siblings, 0 replies; 2+ messages in thread
From: Sage Weil @ 2010-04-21 23:41 UTC (permalink / raw)
  To: Dan Carpenter; +Cc: ceph-devel, kernel-janitors

On Wed, 21 Apr 2010, Dan Carpenter wrote:
> d_obtain_alias() doesn't return NULL, it returns an ERR_PTR().

Thanks, put this in the queue.

sage



> 
> Signed-off-by: Dan Carpenter <error27@gmail.com>
> 
> diff --git a/fs/ceph/export.c b/fs/ceph/export.c
> index 9d67572..192ec40 100644
> --- a/fs/ceph/export.c
> +++ b/fs/ceph/export.c
> @@ -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);
>  
> @@ -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) {
> @@ -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) {
> --
> To unsubscribe from this list: send the line "unsubscribe ceph-devel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 
> 

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2010-04-21 23:41 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-04-21 10:31 [patch] ceph: d_obtain_alias() returns ERR_PTR() Dan Carpenter
2010-04-21 23:41 ` Sage Weil

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox