summaryrefslogtreecommitdiff
path: root/fs
diff options
context:
space:
mode:
authorJaegeuk Kim <jaegeuk.kim@samsung.com>2013-05-28 09:59:27 +0900
committerChanho Park <chanho61.park@samsung.com>2014-11-18 11:43:49 +0900
commiteea845b570fb79fa1056977e6b9bc1d88016c998 (patch)
tree5f450ace534b668cef3555f5db08ce43eadfe1b4 /fs
parentcd30815328214eada9b1d2db98d4f083db1c484d (diff)
downloadlinux-3.10-eea845b570fb79fa1056977e6b9bc1d88016c998.tar.gz
linux-3.10-eea845b570fb79fa1056977e6b9bc1d88016c998.tar.bz2
linux-3.10-eea845b570fb79fa1056977e6b9bc1d88016c998.zip
f2fs: fix incorrect iputs during the dentry recovery
- 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 <jaegeuk.kim@samsung.com>
Diffstat (limited to 'fs')
-rw-r--r--fs/f2fs/checkpoint.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/fs/f2fs/checkpoint.c b/fs/f2fs/checkpoint.c
index 0d3701dce46..6f56e5781dc 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)