[PATCH] eulerfs: fix bitmap minimum size calculation error

19 May
2022
19 May
'22
11:24 a.m.
uniontech inclusion category: bugfix bugzilla: NA CVE: NA ---------- If it can't be divided, minimum_size need to add another byte. Signed-off-by: Gou Hao <gouhao@uniontech.com> --- fs/eulerfs/super.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/eulerfs/super.c b/fs/eulerfs/super.c index 43fc717002d7..20c7fe845b6c 100644 --- a/fs/eulerfs/super.c +++ b/fs/eulerfs/super.c @@ -216,7 +216,7 @@ static bool eufs_check_size(struct super_block *sb, unsigned long size) /* For Super Block */ minimum_size = 2 << sb->s_blocksize_bits; /* For Bitmaps */ - minimum_size += size / EUFS_BLOCK_SIZE / 8; + minimum_size += DIV_ROUND_UP(size / EUFS_BLOCK_SIZE, 8); if (size < minimum_size) return false; -- 2.20.1
1013
Age (days ago)
1013
Last active (days ago)
0 comments
1 participants
participants (1)
-
Gou Hao