Re: [PATCH v9 11/19] scsi: sd: Translate data lifetime information

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

 



Bart,

>> Wouldn't it be appropriate to check sdkp->permanent_stream_count
>> here?
>> rq->write_hint being set doesn't help if the device uses 6-byte
>> commands.
>
> Something like this untested change?
>
> @@ -1256,7 +1283,8 @@ static blk_status_t sd_setup_read_write_cmnd(struct scsi_cmnd *cmd)
>  		ret = sd_setup_rw16_cmnd(cmd, write, lba, nr_blocks,
>  					 protect | fua, dld);
>  	} else if ((nr_blocks > 0xff) || (lba > 0x1fffff) ||
> -		   sdp->use_10_for_rw || protect) {
> +		   sdp->use_10_for_rw || protect ||
> +		   (rq->write_hint && sdkp->permanent_stream_count)) {
>  		ret = sd_setup_rw10_cmnd(cmd, write, lba, nr_blocks,
>  					 protect | fua);
>  	} else {

Do we even care about rq->write_hint being set? sd_group_number() will
check that later.

In my book, the device supporting permanent streams is a good heuristic
not to bother with 6-byte commands.

Another option would be to simply set use_16_for_rw when streams are
supported like Damien does for ZBC.

-- 
Martin K. Petersen	Oracle Linux Engineering




[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [NTFS 3]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [NTFS 3]     [Samba]     [Device Mapper]     [CEPH Development]

  Powered by Linux