[dm-devel] Bug#648367: device-mapper devices such as dm-crypt always have rotational=1; should inherit "rotational" setting from underlying devices

Milan Broz mbroz at redhat.com
Tue Nov 15 07:34:18 UTC 2011


On 11/14/2011 03:26 AM, Josh Triplett wrote:
> OK, I suppose I don't actually care what rotational shows for a
> device-mapper device backed by rotating media.  The case I care about:
> when the underlying media has rotational=0, the dm device definitely
> shouldn't have rotational=1.

Rotational flag is inherited in DM core, nothing dm-crypt specific.
And it works (for several kernel releases already):


create test scsi disk (also with discards)
# modprobe scsi_debug dev_size_mb=16 sector_size=512 num_tgts=1 lbpu=1
# grep scsi_debug /sys/block/*/device/model               
/sys/block/sdj/device/model:scsi_debug 

Map some crypt device over it
# echo "password" | cryptsetup create sdj_crypt /dev/sdj

And now see inherited ROTA flag (it is /sys rotational)

# lsblk -t /dev/sdj
NAME               ALIGNMENT MIN-IO OPT-IO PHY-SEC LOG-SEC ROTA SCHED RQ-SIZE
sdj                        0    512  32768     512     512    0 cfq       128
`-sdj_crypt (dm-0)         0    512  32768     512     512    0           128


Please paste lsblk -t output tree if you think there is a bug, do not blindly
check all dm-X devices queues.

Milan




More information about the dm-devel mailing list