[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [PATCH] blkif: reconcile protocol specification with in-use implementations
On Wed, Sep 04, 2024 at 09:39:17AM +0100, Paul Durrant wrote: > On 04/09/2024 09:21, Roger Pau Monné wrote: > > > In the absence of that I'm afraid it is a little harder to > > > judge whether the proposal here is the best we can do at this point. > > > > While I don't mind looking at what we can do to better handle 4K > > sector disks, we need IMO to revert to the specification before > > 67e1c050e36b, as that change switched the hardcoded sector based units > > from 512 to 'sector-size', thus breaking the existing ABI. > > > > But that's the crux of the problem. What *is* is the ABI? We apparently > don't have one that all OS subscribe to. At least prior to 67e1c050e36b the specification in blkif.h and (what I consider) the reference implementation in Linux blk{front,back} matched. Previous to 67e1c050e36b blkif.h stated: /* * NB. first_sect and last_sect in blkif_request_segment, as well as * sector_number in blkif_request, are always expressed in 512-byte units. * However they must be properly aligned to the real sector size of the * physical disk, which is reported in the "physical-sector-size" node in * the backend xenbus info. Also the xenbus "sectors" node is expressed in * 512-byte units. */ I think it was quite clear, and does in fact match the implementation in Linux. > From your findings it appears that the only thing that will work globally is > to define 'sector-size' is strictly 512 and deprecate any large sector size > support of any kind. As said to Anthony, how do we deal with disks with 4K logical sectors? I'm not really up for implementing read-modify-write in blkback on Linux, as it would be complex, slow, and likely prone to errors. We could introduce a new feature (`logical-sector-size` or some such?) to expose a sector size != 4K, but we might as well just fix existing implementations to match with the specification, as that's overall less changes. In kernel Linux blk{front,back} have always worked fine with 4K sector disks, and did match the specification prior to 67e1c050e36b. Let's clarify the specification as required and fix the remaining front and backends to adhere to it. Thanks, Roger.
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |