vasi / squashfuse

FUSE filesystem to mount squashfs archives
Other
286 stars 66 forks source link

Add support for mounting of subdirectory #89

Closed SeTSeR closed 1 year ago

SeTSeR commented 1 year ago

This commit adds ability to mount subdirectory of image with option -o subdir=/dir.

Continuation of #75, rebased and renamed branch

SeTSeR commented 1 year ago

@DrDaveD I don't think I would be able to properly implement and test this with low-level API right now, I didn't work with the project for a quite a long time and I did not manage to install testing environment on my available boards quickly enough. I added description of new option to usage though, so it should show up at least for hl program.

DrDaveD commented 1 year ago

I don't think this should be only in high-level, so this isn't going to make it into the next release. Hopefully someone else who is interested in the feature will complete it.

SeTSeR commented 1 year ago

Redesigned the implementation in a way it would work with both high-level and low-level versions, tested with archive with archive with branching structure:

~/test/
├── 1
│   ├── 2
│   ├── 3
│   └── 4
├── 2
├── 3
│   └── 4

-subdir option, as intended, allows to narrow mount to one subdirectory.

SeTSeR commented 1 year ago

Please rebase on the current main, because it wasn't uploading the test-suite.log to hopefully give us information about why the ll-smoke.sh test is failing.

Also please add the new option to squashfuse.1. It doesn't need to be in squashfuse_ll.1 because that refers people to squashfuse for descriptions of common options.

Added option to manual, fixed review comment and also fixed style to more consistent to codebase. As for test failure, I couldn't reproduce that locally, everything passes correctly:

============================================================================
Testsuite summary for squashfuse 0.2.0
============================================================================
# TOTAL: 4
# PASS:  4
# SKIP:  0
# XFAIL: 0
# FAIL:  0
# XPASS: 0
# ERROR: 0
============================================================================

And also I'm planning to add some tests with subdirectories.

SeTSeR commented 1 year ago

Getting CI logs is kinda tricky but the test logs seem to be here, in after stage. Recent change to GitHub workflow seems to have no effect, as FreeBSD job is set up in cirrus.yml, not in GitHub Actions.

Logs show there is some problem with mounting:

Mounting squashfs image...
Image did not mount after 5 seconds.
There may be clues in /tmp/squashfs_ll.smoke.log

I was unable trace the source of hang further, smoke test logs are not exposed by this CI.

SeTSeR commented 1 year ago

Thanks, in docker with ubuntu 20.04 I was able to reproduce the issue. For some reason mounting with these changes began to hang, but only with debug information enabled. Might be some issue with argument handling in older libfuse versions.

DrDaveD commented 1 year ago

It was the github action logs that I most cared about, but it turned out that they were only preserving logs from one of the matrix tests. I have now fixed that in #96 to save logs for each of them.

Meanwhile I too have been able to reproduce this interactively on an Ubuntu 20.04 VM. There's a little more information in test-suite.log:

FIO tests...
file:filesetup.c:350, func=fstat, error=Software caused connection abort
fio: pid=0, err=103/file:filesetup.c:350, func=fstat, error=Software caused connection abort
file:filesetup.c:350, func=fstat, error=Transport endpoint is not connected
fio: pid=0, err=107/file:filesetup.c:350, func=fstat, error=Transport endpoint is not connected
file:filesetup.c:350, func=fstat, error=Transport endpoint is not connected
fio: pid=0, err=107/file:filesetup.c:350, func=fstat, error=Transport endpoint is not connected
file:filesetup.c:350, func=fstat, error=Transport endpoint is not connected
fio: pid=0, err=107/file:filesetup.c:350, func=fstat, error=Transport endpoint is not connected
FAIL tests/ll-smoke.sh (exit status: 4)

Ah, but you have fixed it in the latest force-push?

DrDaveD commented 1 year ago

Except it still failed on freebsd. Those logs are shown in the "Run after" section rather than being uploaded, except not all of them. I will update that test too.

SeTSeR commented 1 year ago

Yes, I fixed the crash on Ubuntu 22.04 and also added test for subdir mounting in ll-smoke.sh. I'll try to create a VM with FreeBSD to reproduce crash there if I have the time.

DrDaveD commented 1 year ago

Meanwhile I updated the freebsd after check to show all logs in #98 so if you rebase on master again you should get that debugging help.

DrDaveD commented 1 year ago

Well that wasn't helpful. It did indicate there might be some help in a /tmp log, so now in #99 those are saved as well. Please rebase once again.

SeTSeR commented 1 year ago

I managed to reproduce the problem on VM with FreeBSD 13, log is quite simple:

Something went wrong trying to read the squashfs image.

Looks like some arguments are still not on their places.