linux-f2fs-devel.lists.sourceforge.net archive mirror
 help / color / mirror / Atom feed
From: Chao Yu <chao2.yu@samsung.com>
To: 'Jaegeuk Kim' <jaegeuk@kernel.org>
Cc: linux-f2fs-devel@lists.sourceforge.net, linux-kernel@vger.kernel.org
Subject: RE: [PATCH 2/2] f2fs: fix to release inode correctly
Date: Tue, 25 Aug 2015 09:39:55 +0800	[thread overview]
Message-ID: <000001d0ded7$1aa9e0a0$4ffda1e0$@samsung.com> (raw)
In-Reply-To: <20150824165423.GC2837@jaegeuk-mac02.mot-mobility.com>

Hi Jaegeuk,

> -----Original Message-----
> From: Jaegeuk Kim [mailto:jaegeuk@kernel.org]
> Sent: Tuesday, August 25, 2015 12:54 AM
> To: Chao Yu
> Cc: linux-f2fs-devel@lists.sourceforge.net; linux-kernel@vger.kernel.org
> Subject: Re: [PATCH 2/2] f2fs: fix to release inode correctly
> 

[snip]

> > +	 * if we skip truncate_node in remove_inode_page bacause we failed
> > +	 * before, it's better to find another way to release resource of
> > +	 * this inode (e.g. valid block count, node block or nid). Here we
> > +	 * choose to add this inode to orphan list, so that we can call iput
> > +	 * for releasing in orphan recovery flow.
> > +	 *
> > +	 * Note: we should add inode to orphan list before f2fs_unlock_op()
> > +	 * so we can prevent losing this orphan when encoutering checkpoint
> > +	 * and following suddenly power-off.
> > +	 */
> > +	if (err && err != -ENOENT) {
> > +		err = acquire_orphan_inode(sbi);
> > +		if (!err)
> > +			add_orphan_inode(sbi, inode->i_ino);
> 
> 		Need this too?
> 
> 		if (err)
> 			set_sbi_flag(sbi, SBI_NEED_FSCK);

We have another chance to release inode resource in following path:
 - handle_failed_inode
  - iput
   - f2fs_evict_inode
    - f2fs_truncate
    - remove_inode_page

So I choose to set SBI_NEED_FSCK in the end of f2fs_evict_inode.

Thanks,

  parent reply	other threads:[~2015-08-25  1:39 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-24  9:40 [PATCH 2/2] f2fs: fix to release inode correctly Chao Yu
2015-08-24 16:54 ` Jaegeuk Kim
2015-08-24 22:52   ` [f2fs-dev] " Jaegeuk Kim
2015-08-25  6:38     ` Chao Yu
2015-08-25 22:40       ` [f2fs-dev] " Jaegeuk Kim
2015-08-26 12:46         ` Chao Yu
2015-08-25  1:39   ` Chao Yu [this message]
2015-08-25 22:17     ` Jaegeuk Kim

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='000001d0ded7$1aa9e0a0$4ffda1e0$@samsung.com' \
    --to=chao2.yu@samsung.com \
    --cc=jaegeuk@kernel.org \
    --cc=linux-f2fs-devel@lists.sourceforge.net \
    --cc=linux-kernel@vger.kernel.org \
    /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;
as well as URLs for NNTP newsgroup(s).