lkml.org 
[lkml]   [2015]   [Aug]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRE: [PATCH 2/2] f2fs: fix to release inode correctly
Date
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,



\
 
 \ /
  Last update: 2015-08-25 04:01    [W:0.101 / U:0.308 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site