Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755820AbbHYWRm (ORCPT ); Tue, 25 Aug 2015 18:17:42 -0400 Received: from mail.kernel.org ([198.145.29.136]:60028 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751624AbbHYWRk (ORCPT ); Tue, 25 Aug 2015 18:17:40 -0400 Date: Tue, 25 Aug 2015 15:17:36 -0700 From: Jaegeuk Kim 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 Message-ID: <20150825221736.GA12070@jaegeuk-mac02.mot.com> References: <001b01d0de51$0b369c70$21a3d550$@samsung.com> <20150824165423.GC2837@jaegeuk-mac02.mot-mobility.com> <000001d0ded7$1aa9e0a0$4ffda1e0$@samsung.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <000001d0ded7$1aa9e0a0$4ffda1e0$@samsung.com> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1707 Lines: 51 On Tue, Aug 25, 2015 at 09:39:55AM +0800, Chao Yu wrote: > 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. Oh, got it. :) > > Thanks, -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/