dagargo / emu3fs

Linux kernel module for the E-Mu EIII and EIV sampler filesystems

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Test failure on FC33

raybellis opened this issue · comments

Running 'setfattr -n user.bank.number -v 111 /home/ray/src/emu3fs/tests/mount/d2/t2'...
setfattr: /home/ray/src/emu3fs/tests/mount/d2/t2: Invalid argument
Results: 224/225

emu3fs: Test error: Fri Jan 14 14:26:20 UTC 2022
[ 8012.652214] emu3fs: *** Test: cp ***
[ 8012.673644] emu3fs: *** Test: mv ***
[ 8012.696764] emu3fs: *** Test: cp with big files ***
[ 8014.003241] emu3fs: 990976 physical blocks, 990317 addressable blocks, 967 clusters, 1024 blocks/cluster
[ 8014.003244] emu3fs: cluster list start block @ 2 + 4 blocks
[ 8014.003245] emu3fs: root start block @ 6 + 3 blocks
[ 8014.003246] emu3fs: dir content start block @ 9 + 106 blocks
[ 8014.003246] emu3fs: data start block @ 115 + 967 clusters
[ 8014.385914] emu3fs: *** Test: Truncate ***
[ 8014.430563] emu3fs: *** Test: cp with other size files (0 and non multiple of 512)... ***
[ 8014.530480] emu3fs: 990976 physical blocks, 990317 addressable blocks, 967 clusters, 1024 blocks/cluster
[ 8014.530483] emu3fs: cluster list start block @ 2 + 4 blocks
[ 8014.530484] emu3fs: root start block @ 6 + 3 blocks
[ 8014.530485] emu3fs: dir content start block @ 9 + 106 blocks
[ 8014.530486] emu3fs: data start block @ 115 + 967 clusters
[ 8014.565140] emu3fs: *** Test: Directory expansion ***
[ 8014.628026] emu3fs: *** Test: Directory full ***
[ 8014.790936] emu3fs: *** Test: mv (rename) ***
[ 8014.845547] emu3fs: *** Test: Extended attributes (bank number) ***
[ 8014.868957] emu3fs: Test error: Fri Jan 14 14:26:20 UTC 2022

This happens with both the master branch, and your previous release before my two patches.

The system is Fedora Core 33, with kernel 5.14.18, on x86_64 (virtualised under ESXi)

No idea of what's going on. A couple of questions.

  • Could you check that the file /home/ray/src/emu3fs/tests/mount/d2/t2 exists before the test is run?
  • Could you try to run setfattr command with sudo?

I've installed FC33 and I've replicated the issue.

You don't need to check anything. File exists and running setfattr with sudo has the same effect.

FWIW, after a quick look at the code, and comparing to ext4, I noticed four places where you pass &init_user_ns instead of the passed-in mnt_userns, but changing those didn't affect the test results.

I kind of know what's going on.

The module code fails here.

emu3fs/xattr.c

Lines 75 to 77 in 5aba6c1

ret = kstrtol(buffer, 10, &bn);
if (ret) {
return ret;

For whatever reason, printing the value of the buffer before the kstrtol call gives us this.

[ 4472.487620] 111\xef\x8d<\x1e...

That means that the buffer contains the value but it's not NULL terminated. That's the reason why we're getting an EINVAL error. See the kernel doc here.

Moreover, this works.

$ setfattr -n "user.bank.number" -v "111\0" foo/d2/t2

Fixed.

As said before, the problem was that the buffer was not NULL terminated but that's the reason the size parameter exists.

A new test has been added and the environment variable EMU3_MOUNTPOINT is not needed anymore. Now, I use your approach as it makes it much easier to run.

Let me know if it works for you.

It works fine on x86_64 - I'm getting two separate test issues on RPi. The first is this odd bash error on the first getfattr test:

Running 'getfattr -n "user.bank.number" $EMU3_MOUNTPOINT/d2/t2 2> /dev/null | awk -F\" '{print $2}''...
Results: 223/223

Running '[ $out -eq 0 ]'...
./tests.sh: line 19: [: -eq: unary operator expected
Results: 223/224

The error suggests that $out is undefined or empty at this point. I'll dig further

The second error is an intermittent test failure that merits its own issue (#7)

I dug further - the issue was caused by getfattr etc not being installed on the RaSCSI distro I'm using. Installing the attr package resolves this.

Thanks for reporting and testing it!