diff options
author | Chao Yu <yuchao0@huawei.com> | 2017-11-16 09:59:14 +0100 |
---|---|---|
committer | Jaegeuk Kim <jaegeuk@kernel.org> | 2018-01-03 04:27:26 +0100 |
commit | 292c196a3695e57980dc79dea3863462fa4831c4 (patch) | |
tree | c5ea753a4ba015482edf81e77854292756d7fde0 /fs/f2fs/super.c | |
parent | Merge tag 'for-linus-20171218' of git://git.infradead.org/linux-mtd (diff) | |
download | linux-292c196a3695e57980dc79dea3863462fa4831c4.tar.xz linux-292c196a3695e57980dc79dea3863462fa4831c4.zip |
f2fs: reserve nid resource for quota sysfile
During mkfs, quota sysfiles have already occupied nid resource,
it needs to adjust remaining available nid count in kernel side.
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 | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/fs/f2fs/super.c b/fs/f2fs/super.c index 708155d9c2e4..7ef7620b2010 100644 --- a/fs/f2fs/super.c +++ b/fs/f2fs/super.c @@ -1008,7 +1008,8 @@ static int f2fs_statfs(struct dentry *dentry, struct kstatfs *buf) buf->f_bavail = user_block_count - valid_user_blocks(sbi) - sbi->current_reserved_blocks; - avail_node_count = sbi->total_node_count - F2FS_RESERVED_NODE_NUM; + avail_node_count = sbi->total_node_count - sbi->nquota_files - + F2FS_RESERVED_NODE_NUM; if (avail_node_count > user_block_count) { buf->f_files = user_block_count; @@ -2462,6 +2463,13 @@ try_onemore: else sb->s_qcop = &f2fs_quotactl_ops; sb->s_quota_types = QTYPE_MASK_USR | QTYPE_MASK_GRP | QTYPE_MASK_PRJ; + + if (f2fs_sb_has_quota_ino(sbi->sb)) { + for (i = 0; i < MAXQUOTAS; i++) { + if (f2fs_qf_ino(sbi->sb, i)) + sbi->nquota_files++; + } + } #endif sb->s_op = &f2fs_sops; |