tarfs: Set mountedfrom correctly.

Sponsored by:	Juniper Networks, Inc.
Sponsored by:	Klara, Inc.
Reviewed by:	sjg, kib
Differential Revision:	https://reviews.freebsd.org/D38930
This commit is contained in:
Dag-Erling Smørgrav 2023-03-07 16:04:18 +00:00
parent 343c112dfe
commit b1218349ed
2 changed files with 5 additions and 3 deletions

View File

@ -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);

View File

@ -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)"