[sle-beta] [Request For Comment] - bsc#1151302 blkdiscard on KVM guest VM is not working as expected

Vincent Moutoussamy vmoutoussamy at suse.com
Thu Oct 31 05:26:59 MDT 2019


Hi everyone,

We would like to know if any of you experienced the issue below or if you have 
any means to reproduce this one. 

Internal only bug - bsc#1151302 - blkdiscard on KVM guest VM is not working as expected
But here is the description of the bug: 

> KVM : SLES15SP1
> 
> 0. Install SLES12SP5 RC1 build
> 1. Add one scsi device
> 2. Create a partition on the device and ext4 file system on it
> 3. mount the ext4 partition
> 4. Run blkdiscard on the the thin device
> 
> Observation 1 : 
> ------------
> 
> # blkdiscard -v /dev/sda
> /dev/sda: Discarded 1073741824 bytes from the offset 0
> 
> # fdisk -l /dev/sda
> Disk /dev/sda: 1 GiB, 1073741824 bytes, 2097152 sectors
> Disk model: QEMU HARDDISK
> Units: sectors of 1 * 512 = 512 bytes
> Sector size (logical/physical): 512 bytes / 512 bytes
> I/O size (minimum/optimal): 512 bytes / 512 bytes
> Disklabel type: gpt
> Disk identifier: D37C1387-D72C-374F-9844-3F1F9922DF47
> 
> Device     Start     End Sectors  Size Type
> /dev/sda1   2048 2097118 2095071 1023M Linux filesystem
> 
> 
> Sysfs details : 
> 
> # cat /sys/block/sda/queue/discard_max_hw_bytes
> 1073741824
> # cat /sys/block/sda/queue/discard_max_bytes
> 1073741824
> # cat /sys/block/sda/queue/discard_granularity
> 4096
> # cat /sys/block/sda/queue/discard_
> discard_granularity   discard_max_bytes     discard_max_hw_bytes  discard_zeroes_data
> # cat /sys/block/sda/queue/max_discard_segments
> 1
> 
> 
> Observation 2:
> --------------
> 
> 1. sg lba status command shows "bad field" when executed on a thin device
> # sg_get_lba_status /dev/sda
> Get LBA Status command: bad field in cdb
> 
> # lsscsi
> [0:0:0:1]    disk    QEMU     QEMU HARDDISK    2.5+  /dev/sda
> 
> 
> # sg_vpd -a /dev/sda | grep -i "provisioning type"
>   Provisioning type: 2
> 
> 
> Expectation:
> ------------
> 1. blkdiscard should discard properly
> 2. sg lba status should be functioning.

Regards,
--
Vincent Moutoussamy
SUSE Beta Program, JeOS and SDK Project Manager



More information about the sle-beta mailing list