From nobody Thu Mar 16 12:20:01 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PcmYF5fv3z3y3Lc; Thu, 16 Mar 2023 12:20:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4PcmYF4tjyz4KPp; Thu, 16 Mar 2023 12:20:01 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678969201; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=C+NCt6GARlz6Bi3F6moi02X2FhLdutZrVU68X+k+lYg=; b=nMtu74tPKy+V+uzTaDck9OAh4C2WeUvA/2eL8fskdt7Wrj9UGtvMaM/V1sDFHoDHTJ2WF1 aE87vwecUmAFZ0L08LocOQU5AzBpAxeVBHxgJvp51vLphk/zqc0IZZXuhnjJe8aYmPl81A glatBiI7AepFM7k6Jo+KZvc4vGkXQNbA6BgAEkBJpUhTCPnan474AxdujngYwcv3kXzL7O Ww/FFjyn2SV+U+rO90by+NNz5K0/TlSB+Q4bGdJH6NSDaByU6dXYfFOgFzqAK/bpYHixr+ hmvzQklRrdEVWx1p7yvgdxY/I/9GIHZYzokCpS54asEZJYkTwsdOFwrAjIlOZg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678969201; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=C+NCt6GARlz6Bi3F6moi02X2FhLdutZrVU68X+k+lYg=; b=EA8Gn+NXOOE2bLezF21oCr4fSVYCMeYuk+flljUNwVhrjrxhswOJBxsDTFdd1teo4rscmu jW0FnxtigfuCMF1eBVid6haTwTMPe8sFlF5UlgaqbhPx6AsPn3U0mUMaaoaY+fPzR1NUfa 4CGnPI1e6KX6tHU/WhTCxornKaTPq9UYdriLsTa29+WAvBj4ZcHHB6sY1pDoPcVAoK8J4i /+GctgjcHJSp5ws6tcBmjpBL/9SzV7QN5TfTDCuTE5VfWOPTiw2U9D9mf+n5HH5N4xAOGD ANxkD1ICknuPoHVys9W1hPZEaBfWC10zJNc93NrOpYxtkyZmVfuU9Hl3+kEtaQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1678969201; a=rsa-sha256; cv=none; b=P4o2LSmpT/Sx/E3pWJB0KalpXOpNTCYF5Wg2kKzhSZvTKsESoRzJoHhjg2Jn4ewRS1vESh JjzCvEcRHvoJ3LvZ++te0WHjMmCcChNI5VrVCpU1l7DIk2SeuJ4Z8eNwPh0lTAi6qceSYC qD/cRFk6xQt1GoMI0iff2Xn14PGUyARtzFZ3ZM/91y9gZnTKxrQ39ejXlUX6Uy3BYW/Myn H4/9XEBgLiE+J1Zigse1/5Vmb5tCwZ/TprADsTeId82iQK0ISBQDSW17hKZH+4RRlLtKPV NwYGQgv4HlmlHzNyeP1ZmbFNvtzZWR4SzNMnO2GOpR48PsUZDu+0CJ0z4YxdNA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PcmYF3t3qzhqW; Thu, 16 Mar 2023 12:20:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 32GCK1Vt081698; Thu, 16 Mar 2023 12:20:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 32GCK1cB081696; Thu, 16 Mar 2023 12:20:01 GMT (envelope-from git) Date: Thu, 16 Mar 2023 12:20:01 GMT Message-Id: <202303161220.32GCK1cB081696@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: =?utf-8?Q?Dag-Erling=20Sm=C3=B8rgrav?= Subject: git: ef184e989b54 - main - tarfs: Fix backtracking during node creation. List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: des X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: ef184e989b548da3a0cb703f58db00921ad612c4 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=ef184e989b548da3a0cb703f58db00921ad612c4 commit ef184e989b548da3a0cb703f58db00921ad612c4 Author: Dag-Erling Smørgrav AuthorDate: 2023-03-16 11:31:14 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2023-03-16 11:31:22 +0000 tarfs: Fix backtracking during node creation. Sponsored by: Juniper Networks, Inc. Sponsored by: Klara, Inc. Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D39082 --- sys/fs/tarfs/tarfs_vfsops.c | 5 +++++ tests/sys/fs/tarfs/mktar.c | 10 +--------- tests/sys/fs/tarfs/tarfs_test.sh | 12 ++++++++---- 3 files changed, 14 insertions(+), 13 deletions(-) diff --git a/sys/fs/tarfs/tarfs_vfsops.c b/sys/fs/tarfs/tarfs_vfsops.c index 837fc7644ac1..17d6814ba973 100644 --- a/sys/fs/tarfs/tarfs_vfsops.c +++ b/sys/fs/tarfs/tarfs_vfsops.c @@ -347,6 +347,11 @@ tarfs_lookup_path(struct tarfs_mount *tmp, char *name, size_t namelen, } tnp = parent; parent = tnp->parent; + cn.cn_nameptr = tnp->name; + cn.cn_namelen = tnp->namelen; + do_lookup = true; + TARFS_DPF(LOOKUP, "%s: back to %.*s/\n", __func__, + (int)tnp->namelen, tnp->name); name += len; namelen -= len; continue; diff --git a/tests/sys/fs/tarfs/mktar.c b/tests/sys/fs/tarfs/mktar.c index 4e7d1acc1c82..391ac9170171 100644 --- a/tests/sys/fs/tarfs/mktar.c +++ b/tests/sys/fs/tarfs/mktar.c @@ -41,7 +41,6 @@ #define PROGNAME "mktar" #define SUBDIRNAME "directory" -#define EMPTYDIRNAME "empty" #define NORMALFILENAME "file" #define SPARSEFILENAME "sparse_file" #define HARDLINKNAME "hard_link" @@ -128,11 +127,6 @@ mktar(void) if (mkdir(SUBDIRNAME, 0755) != 0) err(1, "%s", SUBDIRNAME); - /* create a second subdirectory which will remain empty */ - verbose("mkdir %s", EMPTYDIRNAME); - if (mkdir(EMPTYDIRNAME, 0755) != 0) - err(1, "%s", EMPTYDIRNAME); - /* create a normal file */ verbose("creating %s", NORMALFILENAME); mknormalfile(NORMALFILENAME, 0644); @@ -233,7 +227,7 @@ main(int argc, char *argv[]) #if 0 "--options", "zstd:frame-per-file", #endif - "./" EMPTYDIRNAME "/../" NORMALFILENAME, + "./" SUBDIRNAME "/../" NORMALFILENAME, "./" SPARSEFILENAME, "./" HARDLINKNAME, "./" SHORTLINKNAME, @@ -262,8 +256,6 @@ main(int argc, char *argv[]) (void)unlink(HARDLINKNAME); verbose("rm %s", SPARSEFILENAME); (void)unlink(SPARSEFILENAME); - verbose("rmdir %s", EMPTYDIRNAME); - (void)rmdir(EMPTYDIRNAME); verbose("rmdir %s", SUBDIRNAME); (void)rmdir(SUBDIRNAME); verbose("cd -"); diff --git a/tests/sys/fs/tarfs/tarfs_test.sh b/tests/sys/fs/tarfs/tarfs_test.sh index d0624b79eb2d..15354aac501a 100644 --- a/tests/sys/fs/tarfs/tarfs_test.sh +++ b/tests/sys/fs/tarfs/tarfs_test.sh @@ -58,10 +58,14 @@ tarfs_basic_body() { 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)" - atf_check_equal "$(sha256 -q "${mnt}"/sparse_file)" ${sum} - atf_check_equal "$(stat -f%p "${mnt}"/sparse_file)" 100644 - atf_check_equal "$(stat -f%l "${mnt}"/sparse_file)" 2 - atf_check_equal "$(stat -f%l "${mnt}"/hard_link)" 2 + atf_check -o inline:"${sum}\n" sha256 -q "${mnt}"/sparse_file + atf_check -o inline:"2,40755\n" stat -f%l,%p "${mnt}"/directory + atf_check -o inline:"1,100644\n" stat -f%l,%p "${mnt}"/file + atf_check -o inline:"2,100644\n" stat -f%l,%p "${mnt}"/hard_link + atf_check -o inline:"1,120755\n" stat -f%l,%p "${mnt}"/long_link + atf_check -o inline:"1,120755\n" stat -f%l,%p "${mnt}"/short_link + atf_check -o inline:"2,100644\n" stat -f%l,%p "${mnt}"/sparse_file + atf_check -o inline:"3,40755\n" stat -f%l,%p "${mnt}" } tarfs_basic_cleanup() { umount "${mnt}" || true