Re: [PATCH] md/md-bitmap: fix writing non bitmap pages

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

 




On 07/06/2024 7:53, Christoph Hellwig wrote:
> On Thu, Jun 06, 2024 at 06:32:20PM +0300, Ofir Gal wrote:
>> +	unsigned int bitmap_limit = (bitmap->storage.file_pages - pg_index) << PAGE_SHIFT;
> Please split the line after the "<<".
>
>>  	loff_t sboff, offset = mddev->bitmap_info.offset;
>>  	sector_t ps = pg_index * PAGE_SIZE / SECTOR_SIZE;
>>  	unsigned int size = PAGE_SIZE;
>> @@ -273,7 +274,7 @@ static int __write_sb_page(struct md_rdev *rdev, struct bitmap *bitmap,
>>  		/* DATA METADATA BITMAP - no problems */
>>  	}
>>  
>> -	md_super_write(mddev, rdev, sboff + ps, (int) size, page);
>> +	md_super_write(mddev, rdev, sboff + ps, (int)min(size, bitmap_limit), page);
> and drop the pointless case here.
>
> With that:
>
>
> Reviewed-by: Christoph Hellwig <hch@xxxxxx>
Thanks for the review! applied to v2.




[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