diff options
author | Chao Yu <yuchao0@huawei.com> | 2019-08-05 13:27:25 +0300 |
---|---|---|
committer | Jaegeuk Kim <jaegeuk@kernel.org> | 2019-08-23 17:57:14 +0300 |
commit | 27cae0bcc0510ba009f01806b4af13940ad96f7d (patch) | |
tree | 27bfe4fd7925f47b11715db8fe6af68ed906db47 /fs/f2fs/super.c | |
parent | 0b86f78920919cf36239f4e187ebad7f5d78b5f8 (diff) | |
download | linux-27cae0bcc0510ba009f01806b4af13940ad96f7d.tar.xz |
f2fs: fix wrong available node count calculation
In mkfs, we have counted quota file's node number in cp.valid_node_count,
so we have to avoid wrong substraction of quota node number in
.available_nid/.avail_node_count calculation.
f2fs_write_check_point_pack()
{
..
set_cp(valid_node_count, 1 + c.quota_inum + c.lpf_inum);
Fixes: 292c196a3695 ("f2fs: reserve nid resource for quota sysfile")
Fixes: 7b63f72f73af ("f2fs: fix to do sanity check on valid node/block count")
Signed-off-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Diffstat (limited to 'fs/f2fs/super.c')
-rw-r--r-- | fs/f2fs/super.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/fs/f2fs/super.c b/fs/f2fs/super.c index 3435c8bccf3e..46d10a94721d 100644 --- a/fs/f2fs/super.c +++ b/fs/f2fs/super.c @@ -1269,8 +1269,7 @@ static int f2fs_statfs(struct dentry *dentry, struct kstatfs *buf) else buf->f_bavail = 0; - avail_node_count = sbi->total_node_count - sbi->nquota_files - - F2FS_RESERVED_NODE_NUM; + avail_node_count = sbi->total_node_count - F2FS_RESERVED_NODE_NUM; if (avail_node_count > user_block_count) { buf->f_files = user_block_count; @@ -2700,8 +2699,7 @@ int f2fs_sanity_check_ckpt(struct f2fs_sb_info *sbi) } valid_node_count = le32_to_cpu(ckpt->valid_node_count); - avail_node_count = sbi->total_node_count - sbi->nquota_files - - F2FS_RESERVED_NODE_NUM; + avail_node_count = sbi->total_node_count - F2FS_RESERVED_NODE_NUM; if (valid_node_count > avail_node_count) { f2fs_err(sbi, "Wrong valid_node_count: %u, avail_node_count: %u", valid_node_count, avail_node_count); |