diff options
author | Chao Yu <chao2.yu@samsung.com> | 2013-11-29 16:37:00 +0800 |
---|---|---|
committer | Ziyan <jaraidaniel@gmail.com> | 2015-05-02 14:35:44 +0200 |
commit | 381b9ee8f77b4407ee08a0d796e8cab457c91846 (patch) | |
tree | e0d6390e49e0b027e4372f9470e9f42f73a27cc4 /fs | |
parent | a14d4112bc22d77cfead76d51f149dc4768a62e0 (diff) | |
download | kernel_samsung_tuna-381b9ee8f77b4407ee08a0d796e8cab457c91846.zip kernel_samsung_tuna-381b9ee8f77b4407ee08a0d796e8cab457c91846.tar.gz kernel_samsung_tuna-381b9ee8f77b4407ee08a0d796e8cab457c91846.tar.bz2 |
f2fs: avoid to calculate incorrect max orphan number
Because we will write node summaries when do_checkpoint with umount flag,
our number of max orphan blocks should minus NR_CURSEG_NODE_TYPE additional.
Signed-off-by: Chao Yu <chao2.yu@samsung.com>
Signed-off-by: Shu Tan <shu.tan@samsung.com>
Signed-off-by: Jaegeuk Kim <jaegeuk.kim@samsung.com>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/f2fs/checkpoint.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/fs/f2fs/checkpoint.c b/fs/f2fs/checkpoint.c index 21e7215..c7e0572 100644 --- a/fs/f2fs/checkpoint.c +++ b/fs/f2fs/checkpoint.c @@ -190,12 +190,13 @@ int acquire_orphan_inode(struct f2fs_sb_info *sbi) int err = 0; /* - * considering 512 blocks in a segment 5 blocks are needed for cp + * considering 512 blocks in a segment 8 blocks are needed for cp * and log segment summaries. Remaining blocks are used to keep * orphan entries with the limitation one reserved segment - * for cp pack we can have max 1020*507 orphan entries + * for cp pack we can have max 1020*504 orphan entries */ - max_orphans = (sbi->blocks_per_seg - 5) * F2FS_ORPHANS_PER_BLOCK; + max_orphans = (sbi->blocks_per_seg - 2 - NR_CURSEG_TYPE) + * F2FS_ORPHANS_PER_BLOCK; mutex_lock(&sbi->orphan_inode_mutex); if (sbi->n_orphans >= max_orphans) err = -ENOSPC; |