All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: walter harms <wharms@bfs.de>
Cc: kernel-janitors@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net
Subject: Re: [patch] f2fs: dereferencing an ERR_PTR
Date: Sun, 26 May 2013 20:41:16 +0000	[thread overview]
Message-ID: <20130526204116.GE23932@mwanda> (raw)
In-Reply-To: <51A224AB.8010209@bfs.de>

On Sun, May 26, 2013 at 05:05:15PM +0200, walter harms wrote:
> 
> 
> Am 23.05.2013 12:02, schrieb Dan Carpenter:
> > There is an error path where "dir" is an ERR_PTR.
> > 
> > Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> > 
> > diff --git a/fs/f2fs/recovery.c b/fs/f2fs/recovery.c
> > index 5148d90..921aede 100644
> > --- a/fs/f2fs/recovery.c
> > +++ b/fs/f2fs/recovery.c
> > @@ -71,7 +71,8 @@ static int recover_dentry(struct page *ipage, struct inode *inode)
> >  out:
> >  	f2fs_msg(inode->i_sb, KERN_NOTICE, "recover_inode and its dentry: "
> >  			"ino = %x, name = %s, dir = %lx, err = %d",
> > -			ino_of_node(ipage), raw_inode->i_name, dir->i_ino, err);
> > +			ino_of_node(ipage), raw_inode->i_name,
> > +			IS_ERR(dir) ? 0 : dir->i_ino, err);
> >  	return err;
> >  }
> >  
> I am not an expert on  this matter so a simple question:
> dir->i_ino=0 is not valid ?

That is a valid question.  The trick is that we also print the err
code so error conditions should be pretty obvious.

regards,
dan carpenter


WARNING: multiple messages have this Message-ID (diff)
From: Dan Carpenter <dan.carpenter@oracle.com>
To: walter harms <wharms@bfs.de>
Cc: kernel-janitors@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net
Subject: Re: [f2fs-dev] [patch] f2fs: dereferencing an ERR_PTR
Date: Sun, 26 May 2013 23:41:16 +0300	[thread overview]
Message-ID: <20130526204116.GE23932@mwanda> (raw)
In-Reply-To: <51A224AB.8010209@bfs.de>

On Sun, May 26, 2013 at 05:05:15PM +0200, walter harms wrote:
> 
> 
> Am 23.05.2013 12:02, schrieb Dan Carpenter:
> > There is an error path where "dir" is an ERR_PTR.
> > 
> > Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> > 
> > diff --git a/fs/f2fs/recovery.c b/fs/f2fs/recovery.c
> > index 5148d90..921aede 100644
> > --- a/fs/f2fs/recovery.c
> > +++ b/fs/f2fs/recovery.c
> > @@ -71,7 +71,8 @@ static int recover_dentry(struct page *ipage, struct inode *inode)
> >  out:
> >  	f2fs_msg(inode->i_sb, KERN_NOTICE, "recover_inode and its dentry: "
> >  			"ino = %x, name = %s, dir = %lx, err = %d",
> > -			ino_of_node(ipage), raw_inode->i_name, dir->i_ino, err);
> > +			ino_of_node(ipage), raw_inode->i_name,
> > +			IS_ERR(dir) ? 0 : dir->i_ino, err);
> >  	return err;
> >  }
> >  
> I am not an expert on  this matter so a simple question:
> dir->i_ino==0 is not valid ?

That is a valid question.  The trick is that we also print the err
code so error conditions should be pretty obvious.

regards,
dan carpenter


------------------------------------------------------------------------------
Try New Relic Now & We'll Send You this Cool Shirt
New Relic is the only SaaS-based application performance monitoring service 
that delivers powerful full stack analytics. Optimize and monitor your
browser, app, & servers with just a few lines of code. Try New Relic
and get this awesome Nerd Life shirt! http://p.sf.net/sfu/newrelic_d2d_may

  reply	other threads:[~2013-05-26 20:41 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-23 10:02 [patch] f2fs: dereferencing an ERR_PTR Dan Carpenter
2013-05-23 10:02 ` [f2fs-dev] " Dan Carpenter
2013-05-23 10:12 ` Dan Carpenter
2013-05-23 10:12   ` [f2fs-dev] " Dan Carpenter
2013-05-24  3:46   ` Jaegeuk Kim
2013-05-24  3:46     ` [f2fs-dev] " Jaegeuk Kim
2013-05-24 11:23     ` Dan Carpenter
2013-05-24 11:23       ` [f2fs-dev] " Dan Carpenter
2013-05-24 11:32       ` Jaegeuk Kim
2013-05-24 11:32         ` [f2fs-dev] " Jaegeuk Kim
2013-05-26 15:05 ` walter harms
2013-05-26 15:05   ` [f2fs-dev] " walter harms
2013-05-26 20:41   ` Dan Carpenter [this message]
2013-05-26 20:41     ` Dan Carpenter
2013-05-27  7:13     ` walter harms
2013-05-27  7:13       ` [f2fs-dev] " walter harms

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20130526204116.GE23932@mwanda \
    --to=dan.carpenter@oracle.com \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-f2fs-devel@lists.sourceforge.net \
    --cc=wharms@bfs.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.