Re: [PATCH 5/5] brd: make logical sector size configurable

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

 



Hi Hannes,

> @@ -309,8 +311,8 @@ static void brd_submit_bio(struct bio *bio)
>  		int err;
I think you missed the conversion from "kernel" logical sectors to the
device logical sector here:
sector_t sector = bio->bi_iter.bi_sector >> 
                 (brd->brd_logical_sector_shift - SECTOR_SHIFT);

This fixes the issue when you try to do a fio with -verify on a 4k
logical and physical block size.
>  
>  		/* Don't support un-aligned buffer */
> -		WARN_ON_ONCE((iter.offset & (SECTOR_SIZE - 1)) ||
> -				(len & (SECTOR_SIZE - 1)));
> +		WARN_ON_ONCE((iter.offset & (brd->brd_logical_sector_size - 1)) ||
> +				(len & (brd->brd_logical_sector_size - 1)));
>  
>  		err = brd_do_folio(brd, iter.folio, len, iter.offset,
>  				   bio->bi_opf, sector);
> @@ -322,7 +324,7 @@ static void brd_submit_bio(struct bio *bio)
>  			bio_io_error(bio);
>  			return;
>  		}
> -		sector += len >> SECTOR_SHIFT;
> +		sector += len >> brd->brd_logical_sector_shift;
As you can see here, you divide the len with device logical block size
to go to the next sector.
>  	}
>  
>  	bio_endio(bio);





[Index of Archives]     [Linux RAID]     [Linux SCSI]     [Linux ATA RAID]     [IDE]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Device Mapper]

  Powered by Linux