koverstreet / bcachefs-tools

http://bcachefs.org
GNU General Public License v2.0
116 stars 88 forks source link

coreutils shred-test fails on bcachefs filesystem #270

Closed JohnRTitor closed 2 months ago

JohnRTitor commented 3 months ago

As reported in https://github.com/NixOS/nixpkgs/issues/306760 and https://github.com/NixOS/nixpkgs/issues/313700 shred-exact test of coreutils is failing on bcachefs filesystem.

Relevant log:

FAIL: tests/shred/shred-exact
=============================

shred: file.slop: error writing at offset 1048576
FAIL tests/shred/shred-exact.sh (exit status: 1)

CC: @jcaesar @Jayman2000

koverstreet commented 3 months ago

I'll need a real log, or something to go off of...

Jayman2000 commented 3 months ago

I can reproduce this bug by doing this:

$ rm -f test_file
$ truncate --size=1MiB test_file
$ truncate --size=+1 test_file
$ shred --exact --iterations=2 test_file
shred: test_file: error writing at offset 1048576
$ 

That being said, I don’t really know if this is a bcachefs bug or a Coreutils bug.

koverstreet commented 2 months ago

strace shows that it's doing a misaligned DIO write - we were failing to return an error in that case.

Fixed by a316668abbf2