Skip to contentSkip to conversation

hfsplus: Avoid truncating the logical block size

PATCH Viacheslav Dubeyko 1 participant 1 message Sep 21, 2020 1 message not in the archive VFS

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

Viacheslav Dubeyko

author Reviewed-by
#1 lore raw
Quoted 24 lines · Yi Wang

From: Liao Pingfang <[email protected]>

Return type of bdev_logical_blfsock_size() got changed from unsigned short to unsigned int, but it was forgotten to update hfsplus_min_io_size() to use the new type. Fix it by calling max_t with new type and returning new type as well.

Fixes ad6bf88a6c19 ("block: fix an integer overflow in logical block size")
---
 fs/hfsplus/hfsplus_fs.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
fs/hfsplus/hfsplus_fs.h +0 -0
index 3b03fff..3ed36d8 100644
@@ -302,9 +302,9 @@ struct hfsplus_readdir_data {
 /*

fs/hfsplus/hfsplus_fs.h struct hfsplus_readdir_data { · line 310

Quoted 10 lines
fs/hfsplus/hfsplus_fs.h +2 -2
  * Find minimum acceptible I/O size for an hfsplus sb.
  */
-static inline unsigned short hfsplus_min_io_size(struct super_block *sb)
+static inline unsigned int hfsplus_min_io_size(struct super_block *sb)
 {
-    return max_t(unsigned short, bdev_logical_block_size(sb->s_bdev),
+    return max_t(unsigned int, bdev_logical_block_size(sb->s_bdev),
              HFSPLUS_SECTOR_SIZE);
 }
 

Looks good. Thanks.

Quoted 2 lines
Signature · 1 line
1.8.3.1