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

Re: [Nbd] Setting the physical block size



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: