Open xyunsw opened 1 year ago
I think seeding+zoned hasn't been tested as a use case, it might work if the super block update is done in the zoned friendly way.
The commands from btrfstune
do some changes directly to the superblock which might not be using the log-style write and violate the sequential writing constraint. We need to do full coverage of all zoned + btrfstune features too.
Dear all,
(linux 6.5.0, btrfs-progs v6.3.3) I was trying to set seeding status on a host-managed smr drive (HGST HSH721414ALE6M4), which was encrypted by dm-crypt.
But
btrfs check
didn't report any error.lsblk shows:
Looks like something went wrong when reading the drive. So I strace btrfstune to see what was happening.
My drive was opened with direct IO and the two pread failed with EINVAL. It is possible that the address or offset isn't aligned properly. In this example, the buffer 0x1bd1ad0 passed to pread may not aligned properly because
0x1bd1ad0 % 4096 = 2768
,0x1bd1ad0 % 512 = 208
. I wrote a simple program to pread the size and offset indicated above, with aligned (aligned_alloc to 16384) and unaligned (malloc) buffers. The aligned buffer can be pread successfully but the unaligned buffer fails with EINVAL. I believe this issue only relates to host-managed smr drives because I testedbtrfstune -S 1
on normal drives and it works properly. I also checked the code in tune/main.c and disk-io.c but still not sure how this happened and how to fix. Any idea on this issue?