Re: [PATCH] md: Fix bitmap offset type in sb writer

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Song,

On 4/26/2023 11:58 AM, Song Liu wrote:
Hi Jonathan,

On Tue, Apr 25, 2023 at 8:44 PM Song Liu <song@xxxxxxxxxx> wrote:

On Mon, Apr 24, 2023 at 6:16 PM Jonathan Derrick
<jonathan.derrick@xxxxxxxxx> wrote:

Bitmap offset is allowed to be negative, indicating that bitmap precedes
metadata. Change the type back from sector_t to loff_t to satisfy
conditionals and calculations.

This actually breaks the following tests from mdadm:

05r1-add-internalbitmap-v1a
05r1-internalbitmap-v1a
05r1-remove-internalbitmap-v1a

Please look into these.

I no longer work for Solidigm and don't have access to equipment that can test this. I'm CCing Sushma and Michael who should be able to test and report back.

Thanks,
Jon

Thanks,
Song


Signed-off-by: Jonathan Derrick <jonathan.derrick@xxxxxxxxx>

I added the following to the patch and applied it to md-next.

Thanks,
Song

Reported-by: Dan Carpenter <dan.carpenter@xxxxxxxxxx>
Fixes: 10172f200b67 ("md: Fix types in sb writer")

---
  drivers/md/md-bitmap.c | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/md/md-bitmap.c b/drivers/md/md-bitmap.c
index 920bb68156d2..29ae7f7015e4 100644
--- a/drivers/md/md-bitmap.c
+++ b/drivers/md/md-bitmap.c
@@ -237,8 +237,8 @@ static int __write_sb_page(struct md_rdev *rdev, struct bitmap *bitmap,
         struct block_device *bdev;
         struct mddev *mddev = bitmap->mddev;
         struct bitmap_storage *store = &bitmap->storage;
-       sector_t offset = mddev->bitmap_info.offset;
-       sector_t ps, sboff, doff;
+       loff_t sboff, offset = mddev->bitmap_info.offset;
+       sector_t ps, doff;
         unsigned int size = PAGE_SIZE;
         unsigned int opt_size = PAGE_SIZE;

--
2.40.0




[Index of Archives]     [Linux RAID Wiki]     [ATA RAID]     [Linux SCSI Target Infrastructure]     [Linux Block]     [Linux IDE]     [Linux SCSI]     [Linux Hams]     [Device Mapper]     [Device Mapper Cryptographics]     [Kernel]     [Linux Admin]     [Linux Net]     [GFS]     [RPM]     [git]     [Yosemite Forum]


  Powered by Linux