summaryrefslogtreecommitdiff
path: root/fs/f2fs/sysfs.c
diff options
context:
space:
mode:
authorJaegeuk Kim <jaegeuk@kernel.org>2017-12-27 15:05:52 -0800
committerJaegeuk Kim <jaegeuk@kernel.org>2018-01-16 15:39:58 -0800
commit7e65be49ed94f89cbf5add7dadf6e338f0cc6e7b (patch)
treeccea427a00e1202c15bfb7e23b4d0162e47fa233 /fs/f2fs/sysfs.c
parent2c1905042c8c3da45ec347d5397d1133ff30fce4 (diff)
f2fs: add reserved blocks for root user
This patch allows root to reserve some blocks via mount option. "-o reserve_root=N" means N x 4KB-sized blocks for root only. Reviewed-by: Chao Yu <yuchao0@huawei.com> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Diffstat (limited to 'fs/f2fs/sysfs.c')
-rw-r--r--fs/f2fs/sysfs.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/fs/f2fs/sysfs.c b/fs/f2fs/sysfs.c
index 93c3364250dd..ab6028c332aa 100644
--- a/fs/f2fs/sysfs.c
+++ b/fs/f2fs/sysfs.c
@@ -162,7 +162,8 @@ static ssize_t f2fs_sbi_store(struct f2fs_attr *a,
#endif
if (a->struct_type == RESERVED_BLOCKS) {
spin_lock(&sbi->stat_lock);
- if (t > (unsigned long)sbi->user_block_count) {
+ if (t > (unsigned long)(sbi->user_block_count -
+ sbi->root_reserved_blocks)) {
spin_unlock(&sbi->stat_lock);
return -EINVAL;
}