# Re: \[PATCH v2 2/2\] libata-core: do not set dev-\>max\_sectors for LBA48 devices

- From: Martin K. Petersen \<hidden\>
- Date: 2016-08-12 21:06:55 
- List: linux-ide
- Page: https://ratatoskr.run/linux-ide/2016/08/6369167
- Thread: https://ratatoskr.run/linux-ide/2016/08/6369167/t.md

```text
>>>>> "Tom" == Tom Yan [ref] writes:

Tom,

Tom> Sounds like libata-scsi is doing something wrong then. It should
Tom> not set max_hw_sectors to dev->max_sectors that is set by
Tom> libata-core:

Tom> but instead it should report it as Maximum Transfer Length and let
Tom> sd set it as max_dev_sectors:

Well, it's mostly academic since there is a 1:1 mapping. It is important
in SCSI where you have many devices with different properties hooked up
to the same controller.

SCSI MTL is a recent addition. There wasn't much point in making a
distinction between hw and dev outside of sd.c since it is the only
device type that has a way to communicate a transfer limit.

Tom> Although that means setting dev->max_sectors to a value larger than
Tom> 1024 will probably be a no-op, if that's really an issue, we should
Tom> have the host templates in libata updated.

I am still not sure exactly which problem it is you are trying to fix?

-- 
Martin K. Petersen	Oracle Linux Engineering
```
