[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 1/2] file-posix: Correctly read max_segments of SG nodes
From: |
Paolo Bonzini |
Subject: |
Re: [PATCH 1/2] file-posix: Correctly read max_segments of SG nodes |
Date: |
Sat, 19 Sep 2020 17:15:49 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.11.0 |
On 17/09/20 15:16, Max Reitz wrote:
> So is this path ever taken, or can we just replace it all with the ioctl?
>
> (Before 867eccfed84, this function was used for all host devices, which
> might explain why the code even exists.)
Because 867eccfed84 is wrong. If you use /dev/sda* with SG_IO you do
need to take into account the hardware max segment size/max segment count.
Probably ->sg needs to be set by the front-end, not by the back-end. An
even better way (but for which I'd leave the task to you and Kevin)
could be to have a new permission BLK_PERM_WRITE_BYPASS and to reduce
the limits to the hardware limits if anybody has requested that
permission. I tried to implement that a couple years ago but I just
couldn't wrap my mind around the permission code.
Paolo