The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Jaegeuk Kim <jaegeuk@kernel.org>
To: Chao Yu <yuchaochina@hotmail.com>
Cc: linux-kernel@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net
Subject: Re: [f2fs-dev] [PATCH] f2fs: fix to release inode page in get_new_data_page
Date: Mon, 13 Jul 2015 16:25:57 -0700	[thread overview]
Message-ID: <20150713232437.GA64479@jaegeuk-mac02.mot.com> (raw)
In-Reply-To: <COL402-EAS409F2B0F7AE6CCD5F95F8D1AB9E0@phx.gbl>

Hi Chao,

On Sat, Jul 11, 2015 at 10:02:51AM +0800, Chao Yu wrote:
> Hi Jaegeuk,
> 
> > -----Original Message-----
> > From: Jaegeuk Kim [mailto:jaegeuk@kernel.org]
> > Sent: Saturday, July 11, 2015 8:17 AM
> > To: Chao Yu; Chao Yu
> > Cc: linux-kernel@vger.kernel.org; linux-f2fs-devel@lists.sourceforge.net;
> > linux-kernel@vger.kernel.org; linux-f2fs-devel@lists.sourceforge.net
> > Subject: Re: [f2fs-dev] [PATCH] f2fs: fix to release inode page in get_new_data_page
> > 
> > Hi Chao,
> > 
> > On Thu, Jul 09, 2015 at 06:20:08PM +0800, Chao Yu wrote:
> > > get_new_data_page should release inode page when we encounter any
> > > error in its procedure, but there is one error path didn't cover
> > > this, fix it.
> > 
> > Nice catch.
> > But, I think we should fix its caller:
> > 
> > in init_inode_metadata(),
> > 	err = make_empty_dir();
> > 	if (err)
> > 		goto put_error;
> > 		---------------
> 
> Previously, I fixed in the same way, but I got an oops when I test the
> patch with xfstest suit, it shows we will meet an error in this call
> path IIRC:
> 
> ->f2fs_mkdir
>   ->__f2fs_add_link
>     ->init_inode_metadata
>       ->make_empty_dir
>         ->get_new_data_page
>           ->f2fs_reserve_block
>             ->reserve_new_block
>               ->inc_valid_block_count
>                 return -ENOSPC;
>               ->f2fs_put_dnode
>                 ->f2fs_put_page(ipage, 1)
> 
>       put_error:
>         ->f2fs_put_page(ipage, 1);
>           f2fs_bug_on(F2FS_P_SB(page), !PageLocked(page));
> 
> And I don't think we should change error handling method of f2fs_put_dnode
> for just fixing this issue.
> 
> How do you think?

Indeed. I cannot think about other clean way for now.
Instead, how about adding this description in the patch and some comments in
the codes?

Thanks,

  reply	other threads:[~2015-07-13 23:26 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-09 10:20 [PATCH] f2fs: fix to release inode page in get_new_data_page Chao Yu
2015-07-11  0:17 ` Jaegeuk Kim
2015-07-11  2:02   ` [f2fs-dev] " Chao Yu
2015-07-13 23:25     ` Jaegeuk Kim [this message]
2015-07-14 10:13       ` Chao Yu

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=20150713232437.GA64479@jaegeuk-mac02.mot.com \
    --to=jaegeuk@kernel.org \
    --cc=linux-f2fs-devel@lists.sourceforge.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=yuchaochina@hotmail.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox