summaryrefslogtreecommitdiff
path: root/fs/f2fs
diff options
context:
space:
mode:
authorChao Yu <chao@kernel.org>2024-11-08 09:25:54 +0800
committerJaegeuk Kim <jaegeuk@kernel.org>2024-11-21 16:12:29 +0000
commit3273d8ad947dea925a65a78ca29e5351c960c801 (patch)
treefea41d665296c1728c422485639e8e8bfbd32a7b /fs/f2fs
parent789ca0eb47f7782b3230ab0957eabd7967b78cae (diff)
downloadlwn-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.c2
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;
}