Re: [Nbd] Setting the physical block size
- To: nbd-general@lists.sourceforge.net
- Subject: Re: [Nbd] Setting the physical block size
- From: Goswin von Brederlow <goswin-v-b@...186...>
- Date: Fri, 02 Mar 2012 22:54:14 +0100
- Message-id: <874nu6vfcp.fsf@...860...>
- In-reply-to: <6E8200C9F749AE8AD1BC5991@...874...> (Alex Bligh's message of "Thu, 01 Mar 2012 16:47:29 +0000")
- References: <87vcmoy9o2.fsf@...860...> <9A4E41323A793A2FAF045CAD@...874...> <87k4341eje.fsf@...860...> <6E8200C9F749AE8AD1BC5991@...874...>
Alex Bligh <alex@...872...> writes:
> --On 1 March 2012 17:17:41 +0100 Goswin von Brederlow
> <goswin-v-b@...186...> wrote:
>
>> There is an ioctl NBD_SET_BLKSIZE, which sets the lo->blksize. The only
> ...
>> Or did you mean that there should be a new ioctl NBD_SET_PHYS_BLKSIZE?
>
> No, I meant was there a non-nbd-specific block device ioctl to do this.
> Getting changes into nbd-client userspace code is (quite correctly) easier
> than getting them into the kernel.
Ahh, no idea. I wouldn't expect those values to be settable from
userspace for normal devices. They are something the driver sets to
reflet the hardware capabilities. But can't hurt to ask around.
On another note setting the physical block size does not prevent the
kernel to send requests aligned and sized to multiples of the logical
block size. Setting the logical block size to > 512 means that O_DIRECT
access needs to also use blocks >512 bytes. So for example "dd
if=/dev/zero of=/dev/nbd0 oflag=direct" fails but works if you add "bs=4k".
Can anyone think of other reasons why setting the logical block size
might be bad?
MfG
Goswin
Reply to: