diff options
author | Jaegeuk Kim <jaegeuk@kernel.org> | 2016-05-03 07:09:56 +0200 |
---|---|---|
committer | Jaegeuk Kim <jaegeuk@kernel.org> | 2016-05-07 19:32:25 +0200 |
commit | 74ef924167ad9d2897ffc0ef83c7ebf322fcc535 (patch) | |
tree | 4271f8dfd76d286837bbbd131a83d93ccb6654da /fs/f2fs/checkpoint.c | |
parent | f2fs: revisit error handling flows (diff) | |
download | linux-74ef924167ad9d2897ffc0ef83c7ebf322fcc535.tar.xz linux-74ef924167ad9d2897ffc0ef83c7ebf322fcc535.zip |
f2fs: fix leak of orphan inode objects
When unmounting filesystem, we should release all the ino entries.
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Diffstat (limited to 'fs/f2fs/checkpoint.c')
-rw-r--r-- | fs/f2fs/checkpoint.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/fs/f2fs/checkpoint.c b/fs/f2fs/checkpoint.c index 79da86d6cf5c..432a6baa61d1 100644 --- a/fs/f2fs/checkpoint.c +++ b/fs/f2fs/checkpoint.c @@ -449,12 +449,12 @@ bool exist_written_data(struct f2fs_sb_info *sbi, nid_t ino, int mode) return e ? true : false; } -void release_ino_entry(struct f2fs_sb_info *sbi) +void release_ino_entry(struct f2fs_sb_info *sbi, bool all) { struct ino_entry *e, *tmp; int i; - for (i = APPEND_INO; i <= UPDATE_INO; i++) { + for (i = all ? ORPHAN_INO: APPEND_INO; i <= UPDATE_INO; i++) { struct inode_management *im = &sbi->im[i]; spin_lock(&im->ino_lock); @@ -1106,7 +1106,7 @@ static int do_checkpoint(struct f2fs_sb_info *sbi, struct cp_control *cpc) invalidate_mapping_pages(META_MAPPING(sbi), discard_blk, discard_blk); - release_ino_entry(sbi); + release_ino_entry(sbi, false); if (unlikely(f2fs_cp_error(sbi))) return -EIO; |