All of lore.kernel.org
 help / color / mirror / Atom feed
* [patch] nilfs2: nilfs_iget_for_gc() returns ERR_PTR
@ 2010-11-23  6:26 ` Dan Carpenter
  0 siblings, 0 replies; 6+ messages in thread
From: Dan Carpenter @ 2010-11-23  6:26 UTC (permalink / raw)
  To: kernel-janitors

nilfs_iget_for_gc() returns an ERR_PTR() on failure and doesn't return
NULL.

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

diff --git a/fs/nilfs2/ioctl.c b/fs/nilfs2/ioctl.c
index 3e90f86..5bf426f 100644
--- a/fs/nilfs2/ioctl.c
+++ b/fs/nilfs2/ioctl.c
@@ -349,8 +349,8 @@ static int nilfs_ioctl_move_blocks(struct super_block *sb,
 		ino = vdesc->vd_ino;
 		cno = vdesc->vd_cno;
 		inode = nilfs_iget_for_gc(sb, ino, cno);
-		if (unlikely(inode = NULL)) {
-			ret = -ENOMEM;
+		if (unlikely(IS_ERR(inode))) {
+			ret = PTR_ERR(inode);
 			goto failed;
 		}
 		do {

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

* [patch] nilfs2: nilfs_iget_for_gc() returns ERR_PTR
@ 2010-11-23  6:26 ` Dan Carpenter
  0 siblings, 0 replies; 6+ messages in thread
From: Dan Carpenter @ 2010-11-23  6:26 UTC (permalink / raw)
  To: KONISHI Ryusuke
  Cc: linux-nilfs-u79uwXL29TY76Z2rM5mHXA,
	kernel-janitors-u79uwXL29TY76Z2rM5mHXA

nilfs_iget_for_gc() returns an ERR_PTR() on failure and doesn't return
NULL.

Signed-off-by: Dan Carpenter <error27-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>

diff --git a/fs/nilfs2/ioctl.c b/fs/nilfs2/ioctl.c
index 3e90f86..5bf426f 100644
--- a/fs/nilfs2/ioctl.c
+++ b/fs/nilfs2/ioctl.c
@@ -349,8 +349,8 @@ static int nilfs_ioctl_move_blocks(struct super_block *sb,
 		ino = vdesc->vd_ino;
 		cno = vdesc->vd_cno;
 		inode = nilfs_iget_for_gc(sb, ino, cno);
-		if (unlikely(inode == NULL)) {
-			ret = -ENOMEM;
+		if (unlikely(IS_ERR(inode))) {
+			ret = PTR_ERR(inode);
 			goto failed;
 		}
 		do {
--
To unsubscribe from this list: send the line "unsubscribe linux-nilfs" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* Re: [patch] nilfs2: nilfs_iget_for_gc() returns ERR_PTR
  2010-11-23  6:26 ` Dan Carpenter
@ 2010-11-23  7:22   ` Ryusuke Konishi
  -1 siblings, 0 replies; 6+ messages in thread
From: Ryusuke Konishi @ 2010-11-23  7:22 UTC (permalink / raw)
  To: kernel-janitors

On Tue, 23 Nov 2010 09:26:02 +0300, Dan Carpenter wrote:
> nilfs_iget_for_gc() returns an ERR_PTR() on failure and doesn't return
> NULL.
> 
> Signed-off-by: Dan Carpenter <error27@gmail.com>
> 
> diff --git a/fs/nilfs2/ioctl.c b/fs/nilfs2/ioctl.c
> index 3e90f86..5bf426f 100644
> --- a/fs/nilfs2/ioctl.c
> +++ b/fs/nilfs2/ioctl.c
> @@ -349,8 +349,8 @@ static int nilfs_ioctl_move_blocks(struct super_block *sb,
>  		ino = vdesc->vd_ino;
>  		cno = vdesc->vd_cno;
>  		inode = nilfs_iget_for_gc(sb, ino, cno);
> -		if (unlikely(inode = NULL)) {
> -			ret = -ENOMEM;
> +		if (unlikely(IS_ERR(inode))) {
> +			ret = PTR_ERR(inode);
>  			goto failed;
>  		}
>  		do {

Good catch!

This looks an -rc1 regression brought about by replacement of the gc
iget function.

I will send this fix upstream.  Thank you.

Ryusuke Konishi

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

* Re: [patch] nilfs2: nilfs_iget_for_gc() returns ERR_PTR
@ 2010-11-23  7:22   ` Ryusuke Konishi
  0 siblings, 0 replies; 6+ messages in thread
From: Ryusuke Konishi @ 2010-11-23  7:22 UTC (permalink / raw)
  To: error27-Re5JQEeQqe8AvxtiuMwx3w
  Cc: konishi.ryusuke-Zyj7fXuS5i5L9jVzuh4AOg,
	linux-nilfs-u79uwXL29TY76Z2rM5mHXA,
	kernel-janitors-u79uwXL29TY76Z2rM5mHXA

On Tue, 23 Nov 2010 09:26:02 +0300, Dan Carpenter wrote:
> nilfs_iget_for_gc() returns an ERR_PTR() on failure and doesn't return
> NULL.
> 
> Signed-off-by: Dan Carpenter <error27-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
> 
> diff --git a/fs/nilfs2/ioctl.c b/fs/nilfs2/ioctl.c
> index 3e90f86..5bf426f 100644
> --- a/fs/nilfs2/ioctl.c
> +++ b/fs/nilfs2/ioctl.c
> @@ -349,8 +349,8 @@ static int nilfs_ioctl_move_blocks(struct super_block *sb,
>  		ino = vdesc->vd_ino;
>  		cno = vdesc->vd_cno;
>  		inode = nilfs_iget_for_gc(sb, ino, cno);
> -		if (unlikely(inode == NULL)) {
> -			ret = -ENOMEM;
> +		if (unlikely(IS_ERR(inode))) {
> +			ret = PTR_ERR(inode);
>  			goto failed;
>  		}
>  		do {

Good catch!

This looks an -rc1 regression brought about by replacement of the gc
iget function.

I will send this fix upstream.  Thank you.

Ryusuke Konishi
--
To unsubscribe from this list: send the line "unsubscribe linux-nilfs" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* Re: [patch] nilfs2: nilfs_iget_for_gc() returns ERR_PTR
@ 2010-11-23  7:47   ` Ryusuke Konishi
  0 siblings, 0 replies; 6+ messages in thread
From: Ryusuke Konishi @ 2010-11-23  7:47 UTC (permalink / raw)
  To: kernel-janitors

On Tue, 23 Nov 2010 16:22:21 +0900 (JST), Ryusuke Konishi wrote:
> On Tue, 23 Nov 2010 09:26:02 +0300, Dan Carpenter wrote:
> > nilfs_iget_for_gc() returns an ERR_PTR() on failure and doesn't return
> > NULL.
> > 
> > Signed-off-by: Dan Carpenter <error27@gmail.com>
> > 
> > diff --git a/fs/nilfs2/ioctl.c b/fs/nilfs2/ioctl.c
> > index 3e90f86..5bf426f 100644
> > --- a/fs/nilfs2/ioctl.c
> > +++ b/fs/nilfs2/ioctl.c
> > @@ -349,8 +349,8 @@ static int nilfs_ioctl_move_blocks(struct super_block *sb,
> >  		ino = vdesc->vd_ino;
> >  		cno = vdesc->vd_cno;
> >  		inode = nilfs_iget_for_gc(sb, ino, cno);
> > -		if (unlikely(inode = NULL)) {
> > -			ret = -ENOMEM;
> > +		if (unlikely(IS_ERR(inode))) {
> > +			ret = PTR_ERR(inode);
> >  			goto failed;
> >  		}
> >  		do {
> 
> Good catch!
> 
> This looks an -rc1 regression brought about by replacement of the gc
> iget function.
> 
> I will send this fix upstream.  Thank you.
> 
> Ryusuke Konishi

I'll add a minor amendment to your patch because IS_ERR() implies
unlikely().

Thanks,
Ryusuke Konishi

---
From: Dan Carpenter <error27@gmail.com>

nilfs2: nilfs_iget_for_gc() returns ERR_PTR

nilfs_iget_for_gc() returns an ERR_PTR() on failure and doesn't return
NULL.

Signed-off-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
---
 fs/nilfs2/ioctl.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/fs/nilfs2/ioctl.c b/fs/nilfs2/ioctl.c
index 3e90f86..e00d945 100644
--- a/fs/nilfs2/ioctl.c
+++ b/fs/nilfs2/ioctl.c
@@ -349,8 +349,8 @@ static int nilfs_ioctl_move_blocks(struct super_block *sb,
 		ino = vdesc->vd_ino;
 		cno = vdesc->vd_cno;
 		inode = nilfs_iget_for_gc(sb, ino, cno);
-		if (unlikely(inode = NULL)) {
-			ret = -ENOMEM;
+		if (IS_ERR(inode)) {
+			ret = PTR_ERR(inode);
 			goto failed;
 		}
 		do {
-- 
1.7.3.2


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

* Re: [patch] nilfs2: nilfs_iget_for_gc() returns ERR_PTR
@ 2010-11-23  7:47   ` Ryusuke Konishi
  0 siblings, 0 replies; 6+ messages in thread
From: Ryusuke Konishi @ 2010-11-23  7:47 UTC (permalink / raw)
  To: error27-Re5JQEeQqe8AvxtiuMwx3w
  Cc: linux-nilfs-u79uwXL29TY76Z2rM5mHXA,
	kernel-janitors-u79uwXL29TY76Z2rM5mHXA, Ryusuke Konishi

On Tue, 23 Nov 2010 16:22:21 +0900 (JST), Ryusuke Konishi wrote:
> On Tue, 23 Nov 2010 09:26:02 +0300, Dan Carpenter wrote:
> > nilfs_iget_for_gc() returns an ERR_PTR() on failure and doesn't return
> > NULL.
> > 
> > Signed-off-by: Dan Carpenter <error27-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
> > 
> > diff --git a/fs/nilfs2/ioctl.c b/fs/nilfs2/ioctl.c
> > index 3e90f86..5bf426f 100644
> > --- a/fs/nilfs2/ioctl.c
> > +++ b/fs/nilfs2/ioctl.c
> > @@ -349,8 +349,8 @@ static int nilfs_ioctl_move_blocks(struct super_block *sb,
> >  		ino = vdesc->vd_ino;
> >  		cno = vdesc->vd_cno;
> >  		inode = nilfs_iget_for_gc(sb, ino, cno);
> > -		if (unlikely(inode == NULL)) {
> > -			ret = -ENOMEM;
> > +		if (unlikely(IS_ERR(inode))) {
> > +			ret = PTR_ERR(inode);
> >  			goto failed;
> >  		}
> >  		do {
> 
> Good catch!
> 
> This looks an -rc1 regression brought about by replacement of the gc
> iget function.
> 
> I will send this fix upstream.  Thank you.
> 
> Ryusuke Konishi

I'll add a minor amendment to your patch because IS_ERR() implies
unlikely().

Thanks,
Ryusuke Konishi

---
From: Dan Carpenter <error27-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>

nilfs2: nilfs_iget_for_gc() returns ERR_PTR

nilfs_iget_for_gc() returns an ERR_PTR() on failure and doesn't return
NULL.

Signed-off-by: Dan Carpenter <error27-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Signed-off-by: Ryusuke Konishi <konishi.ryusuke-Zyj7fXuS5i5L9jVzuh4AOg@public.gmane.org>
---
 fs/nilfs2/ioctl.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/fs/nilfs2/ioctl.c b/fs/nilfs2/ioctl.c
index 3e90f86..e00d945 100644
--- a/fs/nilfs2/ioctl.c
+++ b/fs/nilfs2/ioctl.c
@@ -349,8 +349,8 @@ static int nilfs_ioctl_move_blocks(struct super_block *sb,
 		ino = vdesc->vd_ino;
 		cno = vdesc->vd_cno;
 		inode = nilfs_iget_for_gc(sb, ino, cno);
-		if (unlikely(inode == NULL)) {
-			ret = -ENOMEM;
+		if (IS_ERR(inode)) {
+			ret = PTR_ERR(inode);
 			goto failed;
 		}
 		do {
-- 
1.7.3.2

--
To unsubscribe from this list: send the line "unsubscribe linux-nilfs" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

end of thread, other threads:[~2010-11-23  7:47 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-11-23  6:26 [patch] nilfs2: nilfs_iget_for_gc() returns ERR_PTR Dan Carpenter
2010-11-23  6:26 ` Dan Carpenter
2010-11-23  7:22 ` Ryusuke Konishi
2010-11-23  7:22   ` Ryusuke Konishi
2010-11-23  7:47 ` Ryusuke Konishi
2010-11-23  7:47   ` Ryusuke Konishi

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.