diff options
author | Chao Yu <chao@kernel.org> | 2024-11-08 09:25:54 +0800 |
---|---|---|
committer | Jaegeuk Kim <jaegeuk@kernel.org> | 2024-11-21 16:12:29 +0000 |
commit | 3273d8ad947dea925a65a78ca29e5351c960c801 (patch) | |
tree | fea41d665296c1728c422485639e8e8bfbd32a7b /fs/f2fs | |
parent | 789ca0eb47f7782b3230ab0957eabd7967b78cae (diff) | |
download | lwn-3273d8ad947dea925a65a78ca29e5351c960c801.tar.gz lwn-3273d8ad947dea925a65a78ca29e5351c960c801.zip |
f2fs: fix to do cast in F2FS_{BLK_TO_BYTES, BTYES_TO_BLK} to avoid overflow
It missed to cast variable to unsigned long long type before
bit shift, which will cause overflow, fix it.
Fixes: f7ef9b83b583 ("f2fs: introduce macros to convert bytes and blocks in f2fs")
Signed-off-by: Chao Yu <chao@kernel.org>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Diffstat (limited to 'fs/f2fs')
-rw-r--r-- | fs/f2fs/super.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/f2fs/super.c b/fs/f2fs/super.c index 7bcd6471af9a..0097a5770fa3 100644 --- a/fs/f2fs/super.c +++ b/fs/f2fs/super.c @@ -3344,7 +3344,7 @@ loff_t max_file_blocks(struct inode *inode) * fit within U32_MAX + 1 data units. */ - result = min(result, F2FS_BYTES_TO_BLK(((loff_t)U32_MAX + 1) * 4096)); + result = umin(result, F2FS_BYTES_TO_BLK(((loff_t)U32_MAX + 1) * 4096)); return result; } |