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

[Nbd] Setting the physical block size



Hi,

below is a patch that makes the nbd kernel driver set the physical block
size of the device to the blocksize specified by the client.

With this patch GNU parted for example sees that the device has 4096
byte physical blocksize and will align partitions correctly.

Thoughts?

MfG
        Goswin

----------------------------------------------------------------------
--- linux/drivers/block/nbd.c~      2012-03-01 09:10:35.000000000 +0100
+++ linux/drivers/block/nbd.c       2012-03-01 08:57:49.000000000 +0100
@@ -413,6 +413,9 @@
                return ret;
        }
 
+       /* Set physical block size to blocksize */
+       blk_queue_physical_block_size(lo->disk->queue, lo->blksize);
+
        while ((req = nbd_read_stat(lo)) != NULL)
                nbd_end_request(req);
 



Reply to: