summaryrefslogtreecommitdiff
path: root/drivers/block
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2026-04-14 10:17:48 +0200
committerJens Axboe <axboe@kernel.dk>2026-04-15 13:58:36 -0600
commit6466b211f797ae88073b5826dd764a6a98b67edb (patch)
tree116b910f3226eff3f9a423ad3545a7cebad84d50 /drivers/block
parent14e0077911e3d5e11e94417861e700cbb521a107 (diff)
zloop: improve the unaligned write pointer warning
Use the IS_ALIGNED helper and avoid extra conversions, and tell the user what the unaligned size is. Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Damien Le Moal <dlemoal@kernel.org> Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com> Link: https://patch.msgid.link/20260414081811.549755-4-hch@lst.de Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'drivers/block')
-rw-r--r--drivers/block/zloop.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/block/zloop.c b/drivers/block/zloop.c
index fc54480ed62d..a738f8629062 100644
--- a/drivers/block/zloop.c
+++ b/drivers/block/zloop.c
@@ -313,9 +313,9 @@ static int zloop_update_seq_zone(struct zloop_device *zlo, unsigned int zone_no)
return -EINVAL;
}
- if (file_sectors & ((zlo->block_size >> SECTOR_SHIFT) - 1)) {
- pr_err("Zone %u file size not aligned to block size %u\n",
- zone_no, zlo->block_size);
+ if (!IS_ALIGNED(stat.size, zlo->block_size)) {
+ pr_err("Zone %u file size (%llu) not aligned to block size %u\n",
+ zone_no, stat.size, zlo->block_size);
return -EINVAL;
}