Re: [PATCH] scsi: fix the return value of scsi_logical_block_count

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

 



On Mon, 2024-08-12 at 21:52 -0400, Martin K. Petersen wrote:
>  	 
> External email : Please do not click links or open attachments until
> you have verified the sender or the content.
>  
> Chaotian,
> 
> > @@ -236,7 +236,7 @@ static inline unsigned int
> scsi_logical_block_count(struct scsi_cmnd *scmd)
> >  {
> >  	unsigned int shift = ilog2(scmd->device->sector_size) -
> SECTOR_SHIFT;
> >  
> > -	return blk_rq_bytes(scsi_cmd_to_rq(scmd)) >> shift;
> > +	return blk_rq_sectors(scsi_cmd_to_rq(scmd)) >> shift;
> >  }
> 
> There's no point in shifting twice by converting to sectors first.
> Please just remove the SECTOR_SHIFT subtraction.
> 
Thanks, will fix it at next version.
> -- 
> Martin K. Petersen	Oracle Linux Engineering




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]

  Powered by Linux