Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758514Ab3E1BVk (ORCPT ); Mon, 27 May 2013 21:21:40 -0400 Received: from mailout4.samsung.com ([203.254.224.34]:63331 "EHLO mailout4.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755143Ab3E1BVE (ORCPT ); Mon, 27 May 2013 21:21:04 -0400 X-AuditID: cbfee690-b7f6f6d00000740c-f0-51a4067c4105 From: Jaegeuk Kim Cc: Jaegeuk Kim , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net Subject: [PATCH 3/3] f2fs: fix incorrect iputs during the dentry recovery Date: Tue, 28 May 2013 10:19:45 +0900 Message-id: <1369703985-26284-3-git-send-email-jaegeuk.kim@samsung.com> X-Mailer: git-send-email 1.8.1.3.566.gaa39828 In-reply-to: <1369703985-26284-1-git-send-email-jaegeuk.kim@samsung.com> References: <1369703985-26284-1-git-send-email-jaegeuk.kim@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrNLMWRmVeSWpSXmKPExsVy+t8zfd0atiWBBh//cFtc3/WXyeLSIneL PXtPslhc3jWHzYHFY/eCz0wefVtWMXp83iQXwBzFZZOSmpNZllqkb5fAlTHh3WWmghucFRdn 3WdtYPzJ3sXIySEhYCIxcec1RghbTOLCvfVsXYxcHEICyxgllq5uhiv6sfA9M0RiOqNE44x5 LBBOG5PEpwk3gDIcHGwC2hKb9xuANIgIMEssmHqeEaSGWWACo8T/Re9ZQBLCAp4S/1sOMYHY LAKqEq39b5lAenkF3CX6Z3hCLNOVWP3/OTtImFPAQ+JAiyxIWAio4tuNp6wgIyUEvrNJPHm4 mw1ijIDEt8mHWEDqJQRkJTYdYIYYIylxcMUNlgmMwgsYGVYxiqYWJBcUJ6UXmegVJ+YWl+al 6yXn525ihATshB2M9w5YH2JMBho3kVlKNDkfGPB5JfGGxmZGFqYmpsZG5pZmpAkrifOqt1gH Cgmk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pzkg01GIuKk4EAIERGfHLAgAA DLP-Filter: Pass X-MTR: 20000000000000000@CPGS X-CFilter-Loop: Reflected To: unlisted-recipients:; (no To-header on input) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1446 Lines: 44 - iget/iput flow in the dentry recovery process 1. *dir* = f2fs_iget 2. set FI_DELAY_IPUT to *dir* 3. add *dir* to the dirty_dir_list - __f2fs_add_link - recover_dentry) 4. iput *dir* by remove_dirty_dir_inode - sync_dirty_dir_inodes - write_chekcpoint If *dir*'s i_count is not 1 (i.e., root dir), remove_dirty_dir_inode is called later and then iput is triggered again due to the FI_DELAY_IPUT flag. So, let's unset the flag properly once iput is triggered. Signed-off-by: Jaegeuk Kim --- fs/f2fs/checkpoint.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/fs/f2fs/checkpoint.c b/fs/f2fs/checkpoint.c index 0d3701d..6f56e57 100644 --- a/fs/f2fs/checkpoint.c +++ b/fs/f2fs/checkpoint.c @@ -521,8 +521,10 @@ void remove_dirty_dir_inode(struct inode *inode) spin_unlock(&sbi->dir_inode_lock); /* Only from the recovery routine */ - if (is_inode_flag_set(F2FS_I(inode), FI_DELAY_IPUT)) + if (is_inode_flag_set(F2FS_I(inode), FI_DELAY_IPUT)) { + clear_inode_flag(F2FS_I(inode), FI_DELAY_IPUT); iput(inode); + } } struct inode *check_dirty_dir_inode(struct f2fs_sb_info *sbi, nid_t ino) -- 1.8.1.3.566.gaa39828 -- 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/