Skip to content

Commit 14b9910

Browse files
chaseyugregkh
authored andcommitted
f2fs: fix condition in __allow_reserved_blocks()
[ Upstream commit e75ce11 ] If reserve_root mount option is not assigned, __allow_reserved_blocks() will return false, it's not correct, fix it. Fixes: 7e65be4 ("f2fs: add reserved blocks for root user") Signed-off-by: Chao Yu <[email protected]> Signed-off-by: Jaegeuk Kim <[email protected]> Signed-off-by: Sasha Levin <[email protected]>
1 parent 9e5e22c commit 14b9910

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

fs/f2fs/f2fs.h

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2361,8 +2361,6 @@ static inline bool __allow_reserved_blocks(struct f2fs_sb_info *sbi,
23612361
{
23622362
if (!inode)
23632363
return true;
2364-
if (!test_opt(sbi, RESERVE_ROOT))
2365-
return false;
23662364
if (IS_NOQUOTA(inode))
23672365
return true;
23682366
if (uid_eq(F2FS_OPTION(sbi).s_resuid, current_fsuid()))
@@ -2383,7 +2381,7 @@ static inline unsigned int get_available_block_count(struct f2fs_sb_info *sbi,
23832381
avail_user_block_count = sbi->user_block_count -
23842382
sbi->current_reserved_blocks;
23852383

2386-
if (!__allow_reserved_blocks(sbi, inode, cap))
2384+
if (test_opt(sbi, RESERVE_ROOT) && !__allow_reserved_blocks(sbi, inode, cap))
23872385
avail_user_block_count -= F2FS_OPTION(sbi).root_reserved_blocks;
23882386

23892387
if (unlikely(is_sbi_flag_set(sbi, SBI_CP_DISABLED))) {

0 commit comments

Comments
 (0)