diff options
author | Jaegeuk Kim <jaegeuk.kim@samsung.com> | 2013-07-30 11:36:53 +0900 |
---|---|---|
committer | Chanho Park <chanho61.park@samsung.com> | 2014-11-18 11:43:56 +0900 |
commit | b21040353db6d0971768fde5cb4b4a4da92df840 (patch) | |
tree | aed848b6f9ff257ad08a47182a920fc71cd69860 /fs/f2fs/f2fs.h | |
parent | d148aa71235487eaf77dfec7cdcba2b99d5eb9eb (diff) | |
download | linux-3.10-b21040353db6d0971768fde5cb4b4a4da92df840.tar.gz linux-3.10-b21040353db6d0971768fde5cb4b4a4da92df840.tar.bz2 linux-3.10-b21040353db6d0971768fde5cb4b4a4da92df840.zip |
f2fs: fix handling orphan inodes
This patch fixes mishandling of the sbi->n_orphans variable.
If users request lots of f2fs_unlink(), check_orphan_space() could be contended.
In such the case, sbi->n_orphans can be read incorrectly so that f2fs_unlink()
would fall into the wrong state which results in the failure of
add_orphan_inode().
So, let's increment sbi->n_orphans virtually prior to the actual orphan inode
stuffs. After that, let's release sbi->n_orphans by calling release_orphan_inode
or remove_orphan_inode.
Signed-off-by: Jaegeuk Kim <jaegeuk.kim@samsung.com>
Diffstat (limited to 'fs/f2fs/f2fs.h')
-rw-r--r-- | fs/f2fs/f2fs.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/fs/f2fs/f2fs.h b/fs/f2fs/f2fs.h index a6858c75259..78777cdb89d 100644 --- a/fs/f2fs/f2fs.h +++ b/fs/f2fs/f2fs.h @@ -1044,7 +1044,8 @@ void destroy_segment_manager(struct f2fs_sb_info *); struct page *grab_meta_page(struct f2fs_sb_info *, pgoff_t); struct page *get_meta_page(struct f2fs_sb_info *, pgoff_t); long sync_meta_pages(struct f2fs_sb_info *, enum page_type, long); -int check_orphan_space(struct f2fs_sb_info *); +int acquire_orphan_inode(struct f2fs_sb_info *); +void release_orphan_inode(struct f2fs_sb_info *); void add_orphan_inode(struct f2fs_sb_info *, nid_t); void remove_orphan_inode(struct f2fs_sb_info *, nid_t); int recover_orphan_inodes(struct f2fs_sb_info *); |