git: b1218349edec - main - tarfs: Set mountedfrom correctly.
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Tue, 07 Mar 2023 17:21:40 UTC
The branch main has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=b1218349edecda9723430be45c68f6e1d29e32fe commit b1218349edecda9723430be45c68f6e1d29e32fe Author: Dag-Erling Smørgrav <des@FreeBSD.org> AuthorDate: 2023-03-07 16:04:18 +0000 Commit: Dag-Erling Smørgrav <des@FreeBSD.org> CommitDate: 2023-03-07 17:20:49 +0000 tarfs: Set mountedfrom correctly. Sponsored by: Juniper Networks, Inc. Sponsored by: Klara, Inc. Reviewed by: sjg, kib Differential Revision: https://reviews.freebsd.org/D38930 --- sys/fs/tarfs/tarfs_vfsops.c | 2 +- tests/sys/fs/tarfs/tarfs_test.sh | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/sys/fs/tarfs/tarfs_vfsops.c b/sys/fs/tarfs/tarfs_vfsops.c index 059608ea60a5..03dc598f4b69 100644 --- a/sys/fs/tarfs/tarfs_vfsops.c +++ b/sys/fs/tarfs/tarfs_vfsops.c @@ -991,7 +991,7 @@ tarfs_mount(struct mount *mp) MNT_IUNLOCK(mp); vfs_getnewfsid(mp); - vfs_mountedfrom(mp, "tarfs"); + vfs_mountedfrom(mp, from); TARFS_DPF(FS, "%s: success\n", __func__); return (0); diff --git a/tests/sys/fs/tarfs/tarfs_test.sh b/tests/sys/fs/tarfs/tarfs_test.sh index 388a78efa476..32576cbf57b6 100644 --- a/tests/sys/fs/tarfs/tarfs_test.sh +++ b/tests/sys/fs/tarfs/tarfs_test.sh @@ -38,10 +38,12 @@ tarfs_basic_head() { atf_set "require.user" "root" } tarfs_basic_body() { + local tarball="${PWD}/tarfs_test.tar.zst" kldload -n tarfs || atf_skip "This test requires tarfs and could not load it" mkdir "${mnt}" - "${mktar}" tarfs_test.tar.zst - atf_check mount -rt tarfs tarfs_test.tar.zst "${mnt}" + "${mktar}" "${tarball}" + atf_check mount -rt tarfs "${tarball}" "${mnt}" + atf_check -o match:"^${tarball} on ${mnt} \(tarfs," mount atf_check_equal "$(stat -f%d,%i "${mnt}"/sparse_file)" "$(stat -f%d,%i "${mnt}"/hard_link)" atf_check_equal "$(stat -f%d,%i "${mnt}"/sparse_file)" "$(stat -L -f%d,%i "${mnt}"/short_link)" atf_check_equal "$(stat -f%d,%i "${mnt}"/sparse_file)" "$(stat -L -f%d,%i "${mnt}"/long_link)"