linux-f2fs-devel.lists.sourceforge.net archive mirror
 help / color / mirror / Atom feed
* Re: f2fs: callers take care of the page from bio error
@ 2015-08-12 10:40 Dan Carpenter
  2015-08-12 17:18 ` Jaegeuk Kim
  0 siblings, 1 reply; 3+ messages in thread
From: Dan Carpenter @ 2015-08-12 10:40 UTC (permalink / raw)
  To: jaegeuk; +Cc: linux-f2fs-devel

Hello Jaegeuk Kim,

The patch 86531d6b84bc: "f2fs: callers take care of the page from bio
error" from Jul 15, 2015, leads to the following static checker
warning:

	fs/f2fs/node.c:1042 ra_node_page()
	warn: 'err' can be either negative or positive

fs/f2fs/node.c
  1025  void ra_node_page(struct f2fs_sb_info *sbi, nid_t nid)
  1026  {
  1027          struct page *apage;
  1028          int err;
  1029  
  1030          apage = find_get_page(NODE_MAPPING(sbi), nid);
  1031          if (apage && PageUptodate(apage)) {
  1032                  f2fs_put_page(apage, 0);
  1033                  return;
  1034          }
  1035          f2fs_put_page(apage, 0);
  1036  
  1037          apage = grab_cache_page(NODE_MAPPING(sbi), nid);
  1038          if (!apage)
  1039                  return;
  1040  
  1041          err = read_node_page(apage, READA);
  1042          f2fs_put_page(apage, err ? 1 : 0);

In the old code we took errors into consideration but now we treat them
as LOCKED_PAGE.  Is that intentional?  A lot of the other callers in
that patch still check for errors...

  1043  }

regards,
dan carpenter

------------------------------------------------------------------------------

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

* Re: f2fs: callers take care of the page from bio error
  2015-08-12 10:40 f2fs: callers take care of the page from bio error Dan Carpenter
@ 2015-08-12 17:18 ` Jaegeuk Kim
  2015-08-12 18:23   ` Dan Carpenter
  0 siblings, 1 reply; 3+ messages in thread
From: Jaegeuk Kim @ 2015-08-12 17:18 UTC (permalink / raw)
  To: Dan Carpenter; +Cc: linux-f2fs-devel

Hi Dan,

On Wed, Aug 12, 2015 at 01:40:10PM +0300, Dan Carpenter wrote:
> Hello Jaegeuk Kim,
> 
> The patch 86531d6b84bc: "f2fs: callers take care of the page from bio
> error" from Jul 15, 2015, leads to the following static checker
> warning:
> 
> 	fs/f2fs/node.c:1042 ra_node_page()
> 	warn: 'err' can be either negative or positive
> 
> fs/f2fs/node.c
>   1025  void ra_node_page(struct f2fs_sb_info *sbi, nid_t nid)
>   1026  {
>   1027          struct page *apage;
>   1028          int err;
>   1029  
>   1030          apage = find_get_page(NODE_MAPPING(sbi), nid);
>   1031          if (apage && PageUptodate(apage)) {
>   1032                  f2fs_put_page(apage, 0);
>   1033                  return;
>   1034          }
>   1035          f2fs_put_page(apage, 0);
>   1036  
>   1037          apage = grab_cache_page(NODE_MAPPING(sbi), nid);
>   1038          if (!apage)
>   1039                  return;
>   1040  
>   1041          err = read_node_page(apage, READA);
>   1042          f2fs_put_page(apage, err ? 1 : 0);
> 
> In the old code we took errors into consideration but now we treat them
> as LOCKED_PAGE.  Is that intentional?  A lot of the other callers in
> that patch still check for errors...

This is just for read-ahead node page function.
So, yes, if it returns LOCKED_PAGE or any error, the page must be unlocked
via f2fs_put_page(1).
Otherwise, end_io will unlock the page.

Hmm, any workaround to avoid that warning?

Thanks,

> 
>   1043  }
> 
> regards,
> dan carpenter

------------------------------------------------------------------------------

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

* Re: f2fs: callers take care of the page from bio error
  2015-08-12 17:18 ` Jaegeuk Kim
@ 2015-08-12 18:23   ` Dan Carpenter
  0 siblings, 0 replies; 3+ messages in thread
From: Dan Carpenter @ 2015-08-12 18:23 UTC (permalink / raw)
  To: Jaegeuk Kim; +Cc: linux-f2fs-devel

On Wed, Aug 12, 2015 at 10:18:37AM -0700, Jaegeuk Kim wrote:
> >   1041          err = read_node_page(apage, READA);
> >   1042          f2fs_put_page(apage, err ? 1 : 0);
> > 
> > In the old code we took errors into consideration but now we treat them
> > as LOCKED_PAGE.  Is that intentional?  A lot of the other callers in
> > that patch still check for errors...
> 
> This is just for read-ahead node page function.
> So, yes, if it returns LOCKED_PAGE or any error, the page must be unlocked
> via f2fs_put_page(1).
> Otherwise, end_io will unlock the page.
> 
> Hmm, any workaround to avoid that warning?
> 

No, it's fine.  Just ignore it.

regards,
dan carpenter


------------------------------------------------------------------------------

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

end of thread, other threads:[~2015-08-12 18:23 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-08-12 10:40 f2fs: callers take care of the page from bio error Dan Carpenter
2015-08-12 17:18 ` Jaegeuk Kim
2015-08-12 18:23   ` Dan Carpenter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).