hayley-leblanc / linux

Adding support for the Rust language to the Linux kernel.
Other
0 stars 3 forks source link

Device size not recognized correctly on dm-linear devices #9

Open hayley-leblanc opened 9 months ago

hayley-leblanc commented 9 months ago

Use dm-linear to map two 1 GB PM devices:

$ echo -e "0 `sudo blockdev --getsz /dev/pmem0` linear /dev/pmem0 0 "\\n"`sudo blockdev --getsz /dev/pmem0` `sudo blockdev --getsz /dev/pmem1` linear /dev/pmem1 0" | sudo dmsetup create linear-pmem
$ lsblk /dev/pmem*
NAME          MAJ:MIN RM SIZE RO TYPE MOUNTPOINTS
pmem0         259:0    0   1G  0 disk 
└─linear-pmem 252:0    0   2G  0 dm   
pmem1         259:1    0   1G  0 disk 
└─linear-pmem 252:0    0   2G  0 dm 
$ sudo mount -t hayleyfs -o init /dev/mapper/linear-pmem /mnt/pmem/
$ df -h
Filesystem               Size  Used Avail Use% Mounted on
tmpfs                    2.2G  1.2M  2.2G   1% /run
/dev/sda3                 98G   47G   46G  51% /
tmpfs                     11G     0   11G   0% /dev/shm
tmpfs                    5.0M     0  5.0M   0% /run/lock
/dev/sda2                512M  5.3M  507M   2% /boot/efi
tmpfs                    2.2G   84K  2.2G   1% /run/user/1000
/dev/mapper/linear-pmem  1.0G     0  1.0G   0% /mnt/pmem

The size on the last line should be 2G. ext4-DAX handles this correctly.

hayley-leblanc commented 9 months ago

NOVA and WineFS do not handle this correctly - they also only recognize the first device. Ext4-DAX probably does something different to obtain the DAX device.