summaryrefslogtreecommitdiff
path: root/fs
diff options
context:
space:
mode:
authorJaegeuk Kim <jaegeuk.kim@samsung.com>2013-05-27 10:32:01 +0900
committerChanho Park <chanho61.park@samsung.com>2014-08-08 14:35:51 +0900
commitce7aa3e26b607d10c771fde4b22b330c40f20057 (patch)
tree5e5574294be966190d1321812175335062f29b12 /fs
parentb531ddaab2dcae7f96871c2cdc40fb74cdff005e (diff)
downloadlinux-3.10-ce7aa3e26b607d10c771fde4b22b330c40f20057.tar.gz
linux-3.10-ce7aa3e26b607d10c771fde4b22b330c40f20057.tar.bz2
linux-3.10-ce7aa3e26b607d10c771fde4b22b330c40f20057.zip
f2fs: iput only if whole data blocks are flushed
If there remains some unwritten blocks from the recovery, we should not call iput on that directory inode. Otherwise, we can loose some dentry blocks after the recovery. Signed-off-by: Jaegeuk Kim <jaegeuk.kim@samsung.com>
Diffstat (limited to 'fs')
-rw-r--r--fs/f2fs/checkpoint.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/fs/f2fs/checkpoint.c b/fs/f2fs/checkpoint.c
index 01ddc911ac9..0d3701dce46 100644
--- a/fs/f2fs/checkpoint.c
+++ b/fs/f2fs/checkpoint.c
@@ -501,8 +501,10 @@ void remove_dirty_dir_inode(struct inode *inode)
return;
spin_lock(&sbi->dir_inode_lock);
- if (atomic_read(&F2FS_I(inode)->dirty_dents))
- goto out;
+ if (atomic_read(&F2FS_I(inode)->dirty_dents)) {
+ spin_unlock(&sbi->dir_inode_lock);
+ return;
+ }
list_for_each(this, head) {
struct dir_inode_entry *entry;
@@ -516,7 +518,6 @@ void remove_dirty_dir_inode(struct inode *inode)
break;
}
}
-out:
spin_unlock(&sbi->dir_inode_lock);
/* Only from the recovery routine */