]> git.hungrycats.org Git - btrfs-progs/commitdiff
btrfs-progs topic series: logical-resolve-fixes gets the inode-resolve patch
authorZygo Blaxell <ce3g8jdj@umail.furryterror.org>
Fri, 30 Oct 2026 21:30:59 +0000 (17:30 -0400)
committerZygo Blaxell <ce3g8jdj@umail.furryterror.org>
Fri, 30 Oct 2026 21:30:59 +0000 (17:30 -0400)
New patch 3 "btrfs-progs: inspect inode-resolve: print paths relative to
the argument" (topic da97c420, testing 14c065a7); the stderr patch is now
patch 4.  Cover and TESTING.md updated; the other topics' notes point at
the new testing.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
15 files changed:
README.md
topics/dump-tree-replace-stop-time/TESTING.md
topics/logical-resolve-fixes/0000-cover-letter.patch
topics/logical-resolve-fixes/0001-btrfs-progs-utils-parse-any-number-of-optional-field.patch
topics/logical-resolve-fixes/0002-btrfs-progs-inspect-logical-resolve-find-subvolumes-.patch
topics/logical-resolve-fixes/0003-btrfs-progs-inspect-inode-resolve-print-paths-relati.patch [new file with mode: 0644]
topics/logical-resolve-fixes/0003-btrfs-progs-inspect-logical-resolve-fail-on-an-unres.patch [deleted file]
topics/logical-resolve-fixes/0004-btrfs-progs-inspect-logical-resolve-fail-on-an-unres.patch [new file with mode: 0644]
topics/logical-resolve-fixes/TESTING.md
topics/mkfs-remap-tree/TESTING.md
topics/replace-abort-uncorrectable/TESTING.md
topics/scrub-limit-only-with-option/0000-cover-letter.patch
topics/scrub-limit-only-with-option/TESTING.md
topics/scrub-progress-socket/0000-cover-letter.patch
topics/scrub-progress-socket/TESTING.md

index 6dfcc1f6327e192105a793bae324f4f0262a9ff1..0736ab80488aa3cb4cdcaa0c8482399e20b50a25 100644 (file)
--- a/README.md
+++ b/README.md
@@ -8,7 +8,7 @@ side (`~/share/linux-upstream`, branch `upstream` of `~/share/linux`).
 | | |
 |---|---|
 | base of every series | `9d01fb77f46e` (`v7.1-102-g9d01fb77`), upstream btrfs-progs `devel` as of 2026-10-29: `testing^1` |
-| integration branch | `testing` `6b5d82205a2c` (octopus of the base and the 6 topics; `scrub-progress-socket` contains `scrub-limit-only-with-option`, which is also a parent, as on the kernel lanes) |
+| integration branch | `testing` `14c065a7fff1` (octopus of the base and the 6 topics; `scrub-progress-socket` contains `scrub-limit-only-with-option`, which is also a parent, as on the kernel lanes) |
 | upstream `devel` now | `55f4cfb9c932` (one docs-only commit past the base; the lane has not been rebased onto it) |
 
 Unlike the kernel lane's base, this base is a published upstream commit,
@@ -72,7 +72,7 @@ base.
 | `mkfs-remap-tree` | 1 | | Zygo | `mkfs.btrfs -O remap-tree` (experimental builds) segfaults in `write_ctree_super()` without it |
 | `dump-tree-replace-stop-time` | 1 | | Zygo | dump-tree printed the dev-replace start time as the stop time |
 | `replace-abort-uncorrectable` | 1 | | Zygo | `btrfs replace start --abort-on-uncorrectable`; the user space half of the kernel patch "btrfs: dev-replace: optionally abort on uncorrectable read errors" (kernel export `~/share/linux-upstream/topics/replace-fixes/`).  Send with or after the kernel series: the flag value is defined there |
-| `logical-resolve-fixes` | 3 | | Zygo | Issue #400; patch 3 changes the exit status and moves a message to stderr, and updates misc-tests/042; hex addresses (defect 6) left out on purpose |
+| `logical-resolve-fixes` | 4 | | Zygo | Issue #400; patch 3 fixes inode-resolve paths below the subvolume root; patch 4 changes the exit status and moves a message to stderr, and updates misc-tests/042; hex addresses (defect 6) left out on purpose |
 | `scrub-limit-only-with-option` | 2 | | Zygo | follows up 01c8277d (Issue #1165) |
 | `scrub-progress-socket` | 2 | `scrub-limit-only-with-option` | Zygo | both change the parent's branch after the fork in `scrub_start()`; patch 2 includes the combined code |
 
index d58c558c8a963853852b08053b3dff96773174c4..1c56981eee81e84d2d50f414e060a93fa51cf519 100644 (file)
@@ -29,12 +29,12 @@ Wed Oct 28 21:00:00 EDT 2026` (KASAN, PROVE_LOCKING, BTRFS_DEBUG,
 BTRFS_ASSERT).  Evidence: raid56-wh-harness
 `forensics/progs-testsuite-20261030/SUMMARY.md` (harness b243013).
 
-3bc81a49 differs from the current `testing` 6b5d8220 in three ways,
+3bc81a49 differs from the current `testing` 14c065a7 in four ways,
 all in logical-resolve-fixes: it still had the arg_strtou64() hex patch
 that was since dropped, and the collapsed misc-tests/042 line that was
 since restored; and it predates the fix for a path argument inside a
 subvolume (e.g. a bind-mounted directory) and the bind mount cases of
-misc-tests/042 (2026-10-30).
+misc-tests/042 (2026-10-30); and it predates the inode-resolve patch.
 
 | suite | pass | not run | fail |
 |---|---|---|---|
index 5563f9a101166df611b8d62d57f2015b132498b3..8d55560b902915d7994f65b63316590d8ac88775 100644 (file)
@@ -1,13 +1,14 @@
-From 130213bd487c08d9e73aa4d96496ea7989c8bf15 Mon Sep 17 00:00:00 2001
+From da97c420ee4aeebef7f405b7dd45ad47865d33b8 Mon Sep 17 00:00:00 2001
 From: Zygo Blaxell <ce3g8jdj@umail.furryterror.org>
-Date: Fri, 30 Oct 2026 16:58:38 -0400
-Subject: [PATCH 0/3] btrfs-progs: inspect logical-resolve: find the file names again
+Date: Fri, 30 Oct 2026 17:30:53 -0400
+Subject: [PATCH 0/4] btrfs-progs: inspect logical-resolve: find the file names again
 To: linux-btrfs@vger.kernel.org
 
 "btrfs inspect-internal logical-resolve" prints no file names for most
 references since v5.10 (Issue #400).  The kernel returns every
 reference (-P lists them all); what fails is the step that turns a
-(subvolume, inode) pair into a path.  Six defects, all in user space:
+(subvolume, inode) pair into a path.  Six defects, all in user space;
+inode-resolve has had a seventh since it was added:
 
 1. The mountinfo parser skips exactly one optional field, so mounts with
    none (private propagation, e.g. in a container) or two ("shared:N
@@ -26,6 +27,11 @@ reference (-P lists them all); what fails is the step that turns a
    subvolume and prints a wrong name or fails (6055e736045d).
 6. Hexadecimal addresses ("0x...") are rejected since v6.7
    (8f8d94b8c932).
+7. inode-resolve prints the inode's paths, which are relative to the
+   subvolume root, after its path argument even when the argument is a
+   directory inside the subvolume (or a bind mount of one), so the
+   printed paths repeat the part between the two and do not exist
+   (6055e736045d, v0.20).
 
 Defect 6 is left alone on purpose: it has been that way for years with
 no complaints, and decimal addresses, or shell arithmetic such as
@@ -49,7 +55,18 @@ of that subvolume.
 find_mount_fsroot() and find_option() lose their only user and are
 replaced by iterate_btrfs_mounts().
 
-Patch 3 reports a reference whose subvolume cannot be reached at all as
+Patch 3 fixes 7 with the same rule as patch 2 uses for an argument
+inside the subvolume: print the inode's paths below the argument,
+relative to it.  Paths of other hard links outside the argument cannot
+be printed relative to it; they are counted and reported on stderr, with
+exit status 1.  With the subvolume root as the argument nothing changes.
+It adds inode-resolve cases to misc-tests/042 (there is no inode-resolve
+test): a directory inside the subvolume, ".", a bind mount of a
+directory, and a second hard link outside the argument.  It is a patch
+of its own because it fixes a different command and an older commit,
+but it reuses the helpers of patch 2, so it comes after it.
+
+Patch 4 reports a reference whose subvolume cannot be reached at all as
 an error on stderr and exits with status 1, after printing all the other
 paths.  Today the message goes to stdout with status 0, so a script sees
 fewer paths, or none, and no error.  It updates misc-tests/042, which
@@ -68,27 +85,34 @@ User-visible changes:
   /mnt2, sv1's file is printed as /mnt/sv1/f1 (was /mnt2/f1) when /mnt
   is the argument.  The mount point route is used only for subvolumes
   outside the argument.
-- Patch 3: the "could not be accessed" message moves from stdout to
+- Patch 3: inode-resolve with a directory inside the subvolume as the
+  argument prints existing paths relative to it (was argument + path
+  from the subvolume root), and exits with status 1 when some of the
+  inode's names are outside the argument.
+- Patch 4: the "could not be accessed" message moves from stdout to
   stderr, and the exit status becomes 1.  This patch is separable; the
   others do not depend on it.
 
 Patch 2 depends on patch 1 only for mounts in namespaces whose
-propagation is not exactly one optional field; patch 3 changes the
-message that patch 2 leaves in place.  Apply in order.
+propagation is not exactly one optional field; patch 3 uses helpers
+that patch 2 adds; patch 4 changes the message that patch 2 leaves in
+place.  Apply in order.
 
 Link: https://github.com/kdave/btrfs-progs/issues/400
 
-Zygo Blaxell (3):
+Zygo Blaxell (4):
   btrfs-progs: utils: parse any number of optional fields in mountinfo
   btrfs-progs: inspect logical-resolve: find subvolumes under any mount
+  btrfs-progs: inspect inode-resolve: print paths relative to the
+    argument
   btrfs-progs: inspect logical-resolve: fail on an unresolvable
     reference
 
- cmds/inspect.c                                | 350 ++++++++++++++----
- common/utils.c                                | 135 ++-----
+ cmds/inspect.c                                | 399 +++++++++++++++---
+ common/utils.c                                | 135 ++----
  common/utils.h                                |   3 +-
- .../test.sh                                   | 101 ++++-
- 4 files changed, 416 insertions(+), 173 deletions(-)
+ .../test.sh                                   | 160 ++++++-
+ 4 files changed, 523 insertions(+), 174 deletions(-)
 
 
 base-commit: 9d01fb77f46e98047df6767e237718b5ed816558
index 75ca8c1e005248ce4f8fb158302cdf0690be766f..40fbeb35b897d720e913315ac59db5deb17c8735 100644 (file)
@@ -1,7 +1,7 @@
 From 4bd84e5ad066c7e56ef9614a459fa616c168e8e9 Mon Sep 17 00:00:00 2001
 From: Zygo Blaxell <ce3g8jdj@umail.furryterror.org>
 Date: Thu, 29 Oct 2026 23:28:01 -0400
-Subject: [PATCH 1/3] btrfs-progs: utils: parse any number of optional fields
+Subject: [PATCH 1/4] btrfs-progs: utils: parse any number of optional fields
  in mountinfo
 To: linux-btrfs@vger.kernel.org
 
index 3a32ea734a586d8d298b6ead7eec640a070f0e4a..99054682a6757460094fbdea207aef05b85589fc 100644 (file)
@@ -1,7 +1,7 @@
 From 2147f7bb001f3c244788ebd6ea4c03cdf3e00b23 Mon Sep 17 00:00:00 2001
 From: Zygo Blaxell <ce3g8jdj@umail.furryterror.org>
 Date: Thu, 29 Oct 2026 23:34:26 -0400
-Subject: [PATCH 2/3] btrfs-progs: inspect logical-resolve: find subvolumes
+Subject: [PATCH 2/4] btrfs-progs: inspect logical-resolve: find subvolumes
  under any mount
 To: linux-btrfs@vger.kernel.org
 
diff --git a/topics/logical-resolve-fixes/0003-btrfs-progs-inspect-inode-resolve-print-paths-relati.patch b/topics/logical-resolve-fixes/0003-btrfs-progs-inspect-inode-resolve-print-paths-relati.patch
new file mode 100644 (file)
index 0000000..5c654b4
--- /dev/null
@@ -0,0 +1,269 @@
+From eb127d09ca5cefed488c55633764f86810b5c977 Mon Sep 17 00:00:00 2001
+From: Zygo Blaxell <ce3g8jdj@umail.furryterror.org>
+Date: Fri, 30 Oct 2026 17:18:00 -0400
+Subject: [PATCH 3/4] btrfs-progs: inspect inode-resolve: print paths relative
+ to the argument
+To: linux-btrfs@vger.kernel.org
+
+INO_PATHS returns the paths of the inode relative to the root of the
+subvolume of the file descriptor, and inode-resolve prints each of them
+after the path argument.  That is only right when the argument is the
+root of the subvolume.  For a directory inside the subvolume, a bind
+mount of one, or a relative path from such a directory, the printed paths
+repeat the part between the subvolume root and the argument, and do not
+exist:
+
+  # mount --bind /mnt/vol1/dir /mnt/bind
+  # btrfs inspect-internal inode-resolve 257 /mnt/bind
+  /mnt/bind/dir/file
+
+Find the argument's path in its subvolume with INO_LOOKUP and print only
+the paths below it, relative to it, as logical-resolve does for its path
+argument.  Paths of other hard links outside the argument cannot be
+printed relative to it; count them, report them on stderr and exit with
+status 1, so that missing names are not silent.  When the argument is the
+subvolume root nothing changes.
+
+The INO_LOOKUP part of fs_path_of_fd() becomes subvol_path_of_fd(), used
+by both commands.
+
+Link: https://github.com/kdave/btrfs-progs/issues/400
+Fixes: 6055e736045d ("Btrfs-progs: added ioctls and commands to resolve inodes and logical addrs")
+Assisted-by: Claude:claude-opus-5-5
+---
+ cmds/inspect.c                                | 93 ++++++++++++++-----
+ .../test.sh                                   | 59 ++++++++++++
+ 2 files changed, 129 insertions(+), 23 deletions(-)
+
+diff --git a/cmds/inspect.c b/cmds/inspect.c
+index 8f12c6ed..f01a6b73 100644
+--- a/cmds/inspect.c
++++ b/cmds/inspect.c
+@@ -59,10 +59,10 @@ static const char * const inspect_cmd_group_usage[] = {
+  * Print the paths of inode @inum in the subvolume of @fd, each after
+  * @prepend.  If @strip is set, print only the paths below the directory
+  * @strip (relative to the subvolume root), without that part, and count
+- * them in @printed.
++ * them in @printed; count the paths not below @strip in @skipped.
+  */
+ static int ino_to_path_fd_below(u64 inum, int fd, const char *prepend,
+-                              const char *strip, int *printed)
++                              const char *strip, int *printed, int *skipped)
+ {
+       int ret;
+       int i;
+@@ -95,8 +95,11 @@ static int ino_to_path_fd_below(u64 inum, int fd, const char *prepend,
+               if (strip) {
+                       size_t len = strlen(strip);
+ 
+-                      if (strncmp(str, strip, len) != 0 || str[len] != '/')
++                      if (strncmp(str, strip, len) != 0 || str[len] != '/') {
++                              if (skipped)
++                                      (*skipped)++;
+                               continue;
++                      }
+                       str += len + 1;
+               }
+               if (printed)
+@@ -113,7 +116,36 @@ out:
+ 
+ static int __ino_to_path_fd(u64 inum, int fd, const char *prepend)
+ {
+-      return ino_to_path_fd_below(inum, fd, prepend, NULL, NULL);
++      return ino_to_path_fd_below(inum, fd, prepend, NULL, NULL, NULL);
++}
++
++/*
++ * Path of the directory open at @fd relative to the root of its subvolume,
++ * without leading or trailing slash ("" for the subvolume root).
++ */
++static int subvol_path_of_fd(int fd, char *buf, size_t size)
++{
++      struct btrfs_ioctl_ino_lookup_args args = { 0 };
++      struct stat st;
++      size_t len;
++
++      buf[0] = 0;
++      if (fstat(fd, &st) < 0)
++              return -errno;
++      if (st.st_ino == BTRFS_FIRST_FREE_OBJECTID)
++              return 0;
++
++      /* treeid 0 is the subvolume of @fd, the path ends with a slash */
++      args.objectid = st.st_ino;
++      if (ioctl(fd, BTRFS_IOC_INO_LOOKUP, &args) < 0)
++              return -errno;
++      len = strlen(args.name);
++      if (len && args.name[len - 1] == '/')
++              args.name[--len] = 0;
++      if (len + 1 > size)
++              return -EOVERFLOW;
++      memcpy(buf, args.name, len + 1);
++      return 0;
+ }
+ 
+ static const char * const cmd_inspect_inode_resolve_usage[] = {
+@@ -129,6 +161,10 @@ static const char * const cmd_inspect_inode_resolve_usage[] = {
+ static int cmd_inspect_inode_resolve(const struct cmd_struct *cmd,
+                                    int argc, char **argv)
+ {
++      char rel[PATH_MAX];
++      const char *path;
++      int skipped = 0;
++      u64 inum;
+       int fd;
+       int ret;
+ 
+@@ -154,8 +190,29 @@ static int cmd_inspect_inode_resolve(const struct cmd_struct *cmd,
+       if (fd < 0)
+               return 1;
+ 
+-      ret = __ino_to_path_fd(arg_strtou64(argv[optind]), fd, argv[optind+1]);
++      inum = arg_strtou64(argv[optind]);
++      path = argv[optind + 1];
++
++      /*
++       * The inode paths are relative to the subvolume root, print only those
++       * below @path and relative to it when @path is a directory inside the
++       * subvolume.
++       */
++      ret = subvol_path_of_fd(fd, rel, sizeof(rel));
++      if (ret < 0) {
++              errno = -ret;
++              error("cannot find the subvolume path of %s: %m", path);
++              close(fd);
++              return 1;
++      }
++      ret = ino_to_path_fd_below(inum, fd, path, rel[0] ? rel : NULL, NULL,
++                                 &skipped);
+       close(fd);
++      if (skipped) {
++              error("inode %llu: %d path%s not below %s",
++                    inum, skipped, skipped == 1 ? "" : "s", path);
++              return 1;
++      }
+       return !!ret;
+ 
+ }
+@@ -187,10 +244,8 @@ static const char *path_below(const char *path, const char *prefix)
+  */
+ static int fs_path_of_fd(int fd, char *buf, size_t size)
+ {
+-      struct btrfs_ioctl_ino_lookup_args args = { 0 };
+-      struct stat st;
++      char rel[PATH_MAX];
+       u64 rootid;
+-      size_t len;
+       int ret;
+ 
+       ret = lookup_path_rootid(fd, &rootid);
+@@ -199,24 +254,16 @@ static int fs_path_of_fd(int fd, char *buf, size_t size)
+       ret = btrfs_subvolid_resolve(fd, buf, size, rootid);
+       if (ret < 0)
+               return ret;
+-      if (fstat(fd, &st) < 0)
+-              return -errno;
+-      if (st.st_ino == BTRFS_FIRST_FREE_OBJECTID)
++      ret = subvol_path_of_fd(fd, rel, sizeof(rel));
++      if (ret < 0)
++              return ret;
++      if (!rel[0])
+               return 0;
+-
+-      /* A directory inside the subvolume, its path ends with a slash */
+-      args.treeid = rootid;
+-      args.objectid = st.st_ino;
+-      if (ioctl(fd, BTRFS_IOC_INO_LOOKUP, &args) < 0)
+-              return -errno;
+-      len = strlen(args.name);
+-      if (len && args.name[len - 1] == '/')
+-              args.name[--len] = 0;
+-      if (strlen(buf) + 1 + len + 1 > size)
++      if (strlen(buf) + 1 + strlen(rel) + 1 > size)
+               return -EOVERFLOW;
+       if (buf[0])
+               strcat(buf, "/");
+-      strcat(buf, args.name);
++      strcat(buf, rel);
+       return 0;
+ }
+ 
+@@ -495,7 +542,7 @@ static int cmd_inspect_logical_resolve(const struct cmd_struct *cmd,
+                       int printed = 0;
+ 
+                       ret2 = ino_to_path_fd_below(inum, path_fd, sl.path,
+-                                                  sl.strip, &printed);
++                                                  sl.strip, &printed, NULL);
+                       close(path_fd);
+                       if (ret2)
+                               ret = ret2;
+diff --git a/tests/misc-tests/042-inspect-internal-logical-resolve/test.sh b/tests/misc-tests/042-inspect-internal-logical-resolve/test.sh
+index 0ef90e93..448fafea 100755
+--- a/tests/misc-tests/042-inspect-internal-logical-resolve/test.sh
++++ b/tests/misc-tests/042-inspect-internal-logical-resolve/test.sh
+@@ -82,3 +82,62 @@ for offset in $("$TOP/btrfs" inspect-internal dump-tree -t "$subvol1id" "$TEST_D
+ done
+ 
+ run_check_umount_test_dev
++
++# Resolve inode $1 with $2 as the path argument: the printed paths must be
++# exactly $4..., and the command must exit with status $3, which is 1 if
++# some paths are not below $2
++check_inode_resolve()
++{
++      local ino="$1"
++      local path="$2"
++      local want_ret="$3"
++      local output
++      local ret
++      local got
++      local want
++
++      shift 3
++      output=$(run_mayfail_stdout $SUDO_HELPER "$TOP/btrfs" inspect-internal \
++                                      inode-resolve "$ino" "$path")
++      ret=$?
++      got=$(grep -v '^ERROR: ' <<< "$output" | sort)
++      want=$(printf '%s\n' "$@" | sort)
++      if [ "$got" != "$want" ]; then
++              _fail "inode-resolve $ino $path printed '$got', not '$want'"
++      fi
++      if [ "$ret" -ne "$want_ret" ]; then
++              _fail "inode-resolve $ino $path exited with $ret, not $want_ret"
++      fi
++      if [ "$want_ret" -ne 0 ] &&
++         ! grep -q "^ERROR: inode $ino: .* not below $path\$" <<< "$output"; then
++              _fail "inode-resolve $ino $path did not report the paths not below it"
++      fi
++}
++
++# inode-resolve prints the paths relative to its path argument, which can be
++# a directory inside the subvolume, a bind mount of one, or a relative path.
++# A path that is not below the argument is reported on stderr instead.
++run_check $SUDO_HELPER mount -o subvol=/@/vol1 "$TEST_DEV" "$TEST_MNT"
++run_check $SUDO_HELPER mkdir -p "$TEST_MNT/idir/sub"
++run_check $SUDO_HELPER touch "$TEST_MNT/idir/sub/ifile"
++ino=$(stat -c %i "$TEST_MNT/idir/sub/ifile")
++
++check_inode_resolve "$ino" "$TEST_MNT" 0 "$TEST_MNT/idir/sub/ifile"
++check_inode_resolve "$ino" "$TEST_MNT/idir" 0 "$TEST_MNT/idir/sub/ifile"
++( cd "$TEST_MNT/idir" && check_inode_resolve "$ino" . 0 ./sub/ifile ) ||
++      _fail "inode-resolve $ino in idir"
++
++run_check mkdir -p mnt6
++run_check $SUDO_HELPER mount --bind "$TEST_MNT/idir" mnt6
++check_inode_resolve "$ino" mnt6 0 mnt6/sub/ifile
++check_inode_resolve "$ino" mnt6/sub 0 mnt6/sub/ifile
++
++# A second name outside idir
++run_check $SUDO_HELPER ln "$TEST_MNT/idir/sub/ifile" "$TEST_MNT/ilink"
++check_inode_resolve "$ino" "$TEST_MNT" 0 "$TEST_MNT/idir/sub/ifile" "$TEST_MNT/ilink"
++check_inode_resolve "$ino" mnt6 1 mnt6/sub/ifile
++check_inode_resolve "$ino" "$TEST_MNT/idir/sub" 1 "$TEST_MNT/idir/sub/ifile"
++
++run_check_umount_test_dev mnt6
++run_check rmdir -- mnt6
++run_check_umount_test_dev "$TEST_MNT"
+-- 
+2.47.3
+
diff --git a/topics/logical-resolve-fixes/0003-btrfs-progs-inspect-logical-resolve-fail-on-an-unres.patch b/topics/logical-resolve-fixes/0003-btrfs-progs-inspect-logical-resolve-fail-on-an-unres.patch
deleted file mode 100644 (file)
index 8cac75e..0000000
+++ /dev/null
@@ -1,189 +0,0 @@
-From 130213bd487c08d9e73aa4d96496ea7989c8bf15 Mon Sep 17 00:00:00 2001
-From: Zygo Blaxell <ce3g8jdj@umail.furryterror.org>
-Date: Thu, 29 Oct 2026 23:34:39 -0400
-Subject: [PATCH 3/3] btrfs-progs: inspect logical-resolve: fail on an
- unresolvable reference
-To: linux-btrfs@vger.kernel.org
-
-When the subvolume of a reference cannot be opened, logical-resolve
-prints "inode N subvol S could not be accessed: not mounted" to stdout
-and exits with status 0, so a script that reads the paths sees fewer
-paths, or none at all, and no error.
-
-Report it as an error on stderr and exit with status 1 once all the
-other references have been printed.
-
-This changes the output: scripts that parsed the message from stdout
-will no longer see it there.
-
-Update misc-tests/042, which read the message from stdout and relied on
-the exit status 0: accept exit status 1 only together with at least one
-such error, and require the error whenever the status is 1.  Also add
-cases where bind mounts of directories are the only way in: a directory
-of a subvolume with a file in it and a subvolume nested below it, and a
-directory of that nested subvolume, each resolved with the bind mount
-point, a directory in it, "." and an absolute path as the argument, and
-checked to print the expected path relative to the argument.
-
-Link: https://github.com/kdave/btrfs-progs/issues/400
-Assisted-by: Claude:claude-opus-5-5
----
- cmds/inspect.c                                |   5 +-
- .../test.sh                                   | 101 +++++++++++++++++-
- 2 files changed, 101 insertions(+), 5 deletions(-)
-
-diff --git a/cmds/inspect.c b/cmds/inspect.c
-index 8f12c6ed..0d094480 100644
---- a/cmds/inspect.c
-+++ b/cmds/inspect.c
-@@ -511,8 +511,9 @@ static int cmd_inspect_logical_resolve(const struct cmd_struct *cmd,
- 
-                       if (btrfs_subvolid_resolve(fd, name, sizeof(name), root) < 0)
-                               snprintf(name, sizeof(name), "<id %llu>", root);
--                      printf("inode %llu subvol %s could not be accessed: not mounted\n",
--                             inum, name[0] ? name : "<FS_TREE>");
-+                      error("inode %llu subvol %s could not be accessed: not mounted",
-+                            inum, name[0] ? name : "<FS_TREE>");
-+                      ret = -ENOENT;
-                       continue;
-               }
-               ret2 = __ino_to_path_fd(inum, path_fd, sl.path);
-diff --git a/tests/misc-tests/042-inspect-internal-logical-resolve/test.sh b/tests/misc-tests/042-inspect-internal-logical-resolve/test.sh
-index 0ef90e93..b03b4419 100755
---- a/tests/misc-tests/042-inspect-internal-logical-resolve/test.sh
-+++ b/tests/misc-tests/042-inspect-internal-logical-resolve/test.sh
-@@ -11,22 +11,54 @@ prepare_test_dev
- check_prereq btrfs
- check_prereq mkfs.btrfs
- 
-+# A reference whose subvolume is not reachable from any mount is reported on
-+# stderr, and makes logical-resolve exit with status 1 after printing the
-+# paths of all the other references
-+unreachable_re='^ERROR: inode [0-9]+ subvol .* could not be accessed: not mounted$'
-+
-+# Resolve $1 with $2 (default $TEST_MNT) as the path argument: every printed
-+# path must be a file, and if $3 is given it must be one of them
- check_logical_offset_filename()
- {
-       local offset
-+      local path
-+      local want
-+      local output
-+      local ret
-+      local unreachable=0
-+      local found=false
- 
-       offset="$1"
-+      path="${2:-$TEST_MNT}"
-+      want="$3"
- 
-+      output=$(run_mayfail_stdout $SUDO_HELPER "$TOP/btrfs" inspect-internal \
-+                                      logical-resolve "$offset" "$path")
-+      ret=$?
-       while read file; do
--              if [[ "$file" = *"inode "* ]]; then
-+              if [ -z "$file" ]; then
-+                      continue
-+              elif [[ "$file" =~ $unreachable_re ]]; then
-                       _log "$file"
-+                      unreachable=$((unreachable + 1))
-               elif [ ! -f "$file" ]; then
-                       _fail "path '$file' file cannot be accessed"
-               else
-                       _log "$file"
-+                      [ "$file" = "$want" ] && found=true
-               fi
--      done < <(run_check_stdout $SUDO_HELPER "$TOP/btrfs" inspect-internal \
--                                      logical-resolve "$offset" "$TEST_MNT")
-+      done <<< "$output"
-+
-+      if [ -n "$want" ] && ! $found; then
-+              _fail "logical-resolve $offset $path did not print $want"
-+      fi
-+
-+      if [ "$ret" -ne 0 ] && [ "$unreachable" -eq 0 ]; then
-+              _fail "logical-resolve $offset failed with no unreachable references"
-+      fi
-+      if [ "$ret" -eq 0 ] && [ "$unreachable" -ne 0 ]; then
-+              _fail "logical-resolve $offset succeeded with unreachable references"
-+      fi
- }
- 
- run_check_mkfs_test_dev
-@@ -49,6 +81,22 @@ run_check $SUDO_HELPER dd if=/dev/zero bs=1M count=150 of="$TEST_MNT/@/vol1/subv
- run_check $SUDO_HELPER "$TOP/btrfs" subvolume snapshot "$TEST_MNT/@/vol1/subvol1" \
-                                                       "$TEST_MNT/@/vol1/snapshot1"
- 
-+# For the bind mount cases below: file3 in a directory of vol1, subvol2
-+# nested below that directory with file4, and file5 in a directory of
-+# subvol2.  They are created after the snapshots, so only one subvolume
-+# refers to each of them.
-+run_check $SUDO_HELPER mkdir -p "$TEST_MNT/@/vol1/bdir/sub"
-+run_check $SUDO_HELPER dd if=/dev/zero bs=1M count=4 of="$TEST_MNT/@/vol1/bdir/file3"
-+run_check $SUDO_HELPER "$TOP/btrfs" subvolume create "$TEST_MNT/@/vol1/bdir/sub/subvol2"
-+subvol2id=$(run_check_stdout $SUDO_HELPER "$TOP/btrfs" inspect-internal rootid \
-+                      "$TEST_MNT/@/vol1/bdir/sub/subvol2")
-+run_check $SUDO_HELPER dd if=/dev/zero bs=1M count=4 of="$TEST_MNT/@/vol1/bdir/sub/subvol2/file4"
-+run_check $SUDO_HELPER mkdir "$TEST_MNT/@/vol1/bdir/sub/subvol2/d2"
-+run_check $SUDO_HELPER dd if=/dev/zero bs=1M count=4 of="$TEST_MNT/@/vol1/bdir/sub/subvol2/d2/file5"
-+file3ino=$(stat -c %i "$TEST_MNT/@/vol1/bdir/file3")
-+file4ino=$(stat -c %i "$TEST_MNT/@/vol1/bdir/sub/subvol2/file4")
-+file5ino=$(stat -c %i "$TEST_MNT/@/vol1/bdir/sub/subvol2/d2/file5")
-+
- run_check "$TOP/btrfs" filesystem sync "$TEST_MNT"
- 
- run_check_umount_test_dev
-@@ -82,3 +130,50 @@ for offset in $("$TOP/btrfs" inspect-internal dump-tree -t "$subvol1id" "$TEST_D
- done
- 
- run_check_umount_test_dev
-+
-+# Print the logical addresses of the extents of inode $2 in tree $1
-+inode_offsets()
-+{
-+      "$TOP/btrfs" inspect-internal dump-tree -t "$1" "$TEST_DEV" |
-+              awk -v key="key ($2 EXTENT_DATA " \
-+                      'index($0, key) { f = 1; next }
-+                       /key \(/ { f = 0 }
-+                       f && /disk byte/ && $5 != 0 { print $5 }'
-+}
-+file3offsets=$(inode_offsets "$vol1id" "$file3ino")
-+file4offsets=$(inode_offsets "$subvol2id" "$file4ino")
-+file5offsets=$(inode_offsets "$subvol2id" "$file5ino")
-+[ -n "$file3offsets" ] && [ -n "$file4offsets" ] && [ -n "$file5offsets" ] ||
-+      _fail "no extents found for file3, file4 or file5"
-+
-+# Bind mounts of directories are the only way in: mnt4 is vol1's directory
-+# bdir, mnt5 the directory d2 of the nested subvol2.  Paths are printed
-+# relative to the path argument, which can be the bind mount point, a
-+# directory in it, or a relative path.
-+run_check $SUDO_HELPER mount -o subvol=/@/vol1 "$TEST_DEV" "$TEST_MNT"
-+run_check mkdir -p mnt4 mnt5
-+run_check $SUDO_HELPER mount --bind "$TEST_MNT/bdir" mnt4
-+run_check $SUDO_HELPER mount --bind "$TEST_MNT/bdir/sub/subvol2/d2" mnt5
-+run_check_umount_test_dev "$TEST_MNT"
-+
-+for offset in $file3offsets; do
-+      check_logical_offset_filename "$offset" mnt4 mnt4/file3
-+      check_logical_offset_filename "$offset" "$PWD/mnt4" "$PWD/mnt4/file3"
-+      ( cd mnt4 && check_logical_offset_filename "$offset" . ./file3 ) ||
-+              _fail "logical-resolve $offset in mnt4"
-+done
-+for offset in $file4offsets; do
-+      check_logical_offset_filename "$offset" mnt4 mnt4/sub/subvol2/file4
-+      check_logical_offset_filename "$offset" mnt4/sub mnt4/sub/subvol2/file4
-+      ( cd mnt4/sub && check_logical_offset_filename "$offset" . ./subvol2/file4 ) ||
-+              _fail "logical-resolve $offset in mnt4/sub"
-+done
-+for offset in $file5offsets; do
-+      check_logical_offset_filename "$offset" mnt5 mnt5/file5
-+      ( cd mnt5 && check_logical_offset_filename "$offset" . ./file5 ) ||
-+              _fail "logical-resolve $offset in mnt5"
-+done
-+
-+run_check_umount_test_dev mnt5
-+run_check_umount_test_dev mnt4
-+run_check rmdir -- mnt4 mnt5
--- 
-2.47.3
-
diff --git a/topics/logical-resolve-fixes/0004-btrfs-progs-inspect-logical-resolve-fail-on-an-unres.patch b/topics/logical-resolve-fixes/0004-btrfs-progs-inspect-logical-resolve-fail-on-an-unres.patch
new file mode 100644 (file)
index 0000000..c4ea4eb
--- /dev/null
@@ -0,0 +1,192 @@
+From da97c420ee4aeebef7f405b7dd45ad47865d33b8 Mon Sep 17 00:00:00 2001
+From: Zygo Blaxell <ce3g8jdj@umail.furryterror.org>
+Date: Thu, 29 Oct 2026 23:34:39 -0400
+Subject: [PATCH 4/4] btrfs-progs: inspect logical-resolve: fail on an
+ unresolvable reference
+To: linux-btrfs@vger.kernel.org
+
+When the subvolume of a reference cannot be opened, logical-resolve
+prints "inode N subvol S could not be accessed: not mounted" to stdout
+and exits with status 0, so a script that reads the paths sees fewer
+paths, or none at all, and no error.
+
+Report it as an error on stderr and exit with status 1 once all the
+other references have been printed.
+
+This changes the output: scripts that parsed the message from stdout
+will no longer see it there.
+
+Update misc-tests/042, which read the message from stdout and relied on
+the exit status 0: accept exit status 1 only together with at least one
+such error, and require the error whenever the status is 1.  Also add
+cases where bind mounts of directories are the only way in: a directory
+of a subvolume with a file in it and a subvolume nested below it, and a
+directory of that nested subvolume, each resolved with the bind mount
+point, a directory in it, "." and an absolute path as the argument, and
+checked to print the expected path relative to the argument.
+
+Link: https://github.com/kdave/btrfs-progs/issues/400
+Assisted-by: Claude:claude-opus-5-5
+---
+ cmds/inspect.c                                |   5 +-
+ .../test.sh                                   | 101 +++++++++++++++++-
+ 2 files changed, 101 insertions(+), 5 deletions(-)
+
+diff --git a/cmds/inspect.c b/cmds/inspect.c
+index f01a6b73..36d892ca 100644
+--- a/cmds/inspect.c
++++ b/cmds/inspect.c
+@@ -558,8 +558,9 @@ static int cmd_inspect_logical_resolve(const struct cmd_struct *cmd,
+ 
+                       if (btrfs_subvolid_resolve(fd, name, sizeof(name), root) < 0)
+                               snprintf(name, sizeof(name), "<id %llu>", root);
+-                      printf("inode %llu subvol %s could not be accessed: not mounted\n",
+-                             inum, name[0] ? name : "<FS_TREE>");
++                      error("inode %llu subvol %s could not be accessed: not mounted",
++                            inum, name[0] ? name : "<FS_TREE>");
++                      ret = -ENOENT;
+                       continue;
+               }
+               ret2 = __ino_to_path_fd(inum, path_fd, sl.path);
+diff --git a/tests/misc-tests/042-inspect-internal-logical-resolve/test.sh b/tests/misc-tests/042-inspect-internal-logical-resolve/test.sh
+index 448fafea..a28d28c9 100755
+--- a/tests/misc-tests/042-inspect-internal-logical-resolve/test.sh
++++ b/tests/misc-tests/042-inspect-internal-logical-resolve/test.sh
+@@ -11,22 +11,54 @@ prepare_test_dev
+ check_prereq btrfs
+ check_prereq mkfs.btrfs
+ 
++# A reference whose subvolume is not reachable from any mount is reported on
++# stderr, and makes logical-resolve exit with status 1 after printing the
++# paths of all the other references
++unreachable_re='^ERROR: inode [0-9]+ subvol .* could not be accessed: not mounted$'
++
++# Resolve $1 with $2 (default $TEST_MNT) as the path argument: every printed
++# path must be a file, and if $3 is given it must be one of them
+ check_logical_offset_filename()
+ {
+       local offset
++      local path
++      local want
++      local output
++      local ret
++      local unreachable=0
++      local found=false
+ 
+       offset="$1"
++      path="${2:-$TEST_MNT}"
++      want="$3"
+ 
++      output=$(run_mayfail_stdout $SUDO_HELPER "$TOP/btrfs" inspect-internal \
++                                      logical-resolve "$offset" "$path")
++      ret=$?
+       while read file; do
+-              if [[ "$file" = *"inode "* ]]; then
++              if [ -z "$file" ]; then
++                      continue
++              elif [[ "$file" =~ $unreachable_re ]]; then
+                       _log "$file"
++                      unreachable=$((unreachable + 1))
+               elif [ ! -f "$file" ]; then
+                       _fail "path '$file' file cannot be accessed"
+               else
+                       _log "$file"
++                      [ "$file" = "$want" ] && found=true
+               fi
+-      done < <(run_check_stdout $SUDO_HELPER "$TOP/btrfs" inspect-internal \
+-                                      logical-resolve "$offset" "$TEST_MNT")
++      done <<< "$output"
++
++      if [ -n "$want" ] && ! $found; then
++              _fail "logical-resolve $offset $path did not print $want"
++      fi
++
++      if [ "$ret" -ne 0 ] && [ "$unreachable" -eq 0 ]; then
++              _fail "logical-resolve $offset failed with no unreachable references"
++      fi
++      if [ "$ret" -eq 0 ] && [ "$unreachable" -ne 0 ]; then
++              _fail "logical-resolve $offset succeeded with unreachable references"
++      fi
+ }
+ 
+ run_check_mkfs_test_dev
+@@ -49,6 +81,22 @@ run_check $SUDO_HELPER dd if=/dev/zero bs=1M count=150 of="$TEST_MNT/@/vol1/subv
+ run_check $SUDO_HELPER "$TOP/btrfs" subvolume snapshot "$TEST_MNT/@/vol1/subvol1" \
+                                                       "$TEST_MNT/@/vol1/snapshot1"
+ 
++# For the bind mount cases below: file3 in a directory of vol1, subvol2
++# nested below that directory with file4, and file5 in a directory of
++# subvol2.  They are created after the snapshots, so only one subvolume
++# refers to each of them.
++run_check $SUDO_HELPER mkdir -p "$TEST_MNT/@/vol1/bdir/sub"
++run_check $SUDO_HELPER dd if=/dev/zero bs=1M count=4 of="$TEST_MNT/@/vol1/bdir/file3"
++run_check $SUDO_HELPER "$TOP/btrfs" subvolume create "$TEST_MNT/@/vol1/bdir/sub/subvol2"
++subvol2id=$(run_check_stdout $SUDO_HELPER "$TOP/btrfs" inspect-internal rootid \
++                      "$TEST_MNT/@/vol1/bdir/sub/subvol2")
++run_check $SUDO_HELPER dd if=/dev/zero bs=1M count=4 of="$TEST_MNT/@/vol1/bdir/sub/subvol2/file4"
++run_check $SUDO_HELPER mkdir "$TEST_MNT/@/vol1/bdir/sub/subvol2/d2"
++run_check $SUDO_HELPER dd if=/dev/zero bs=1M count=4 of="$TEST_MNT/@/vol1/bdir/sub/subvol2/d2/file5"
++file3ino=$(stat -c %i "$TEST_MNT/@/vol1/bdir/file3")
++file4ino=$(stat -c %i "$TEST_MNT/@/vol1/bdir/sub/subvol2/file4")
++file5ino=$(stat -c %i "$TEST_MNT/@/vol1/bdir/sub/subvol2/d2/file5")
++
+ run_check "$TOP/btrfs" filesystem sync "$TEST_MNT"
+ 
+ run_check_umount_test_dev
+@@ -83,6 +131,53 @@ done
+ 
+ run_check_umount_test_dev
+ 
++# Print the logical addresses of the extents of inode $2 in tree $1
++inode_offsets()
++{
++      "$TOP/btrfs" inspect-internal dump-tree -t "$1" "$TEST_DEV" |
++              awk -v key="key ($2 EXTENT_DATA " \
++                      'index($0, key) { f = 1; next }
++                       /key \(/ { f = 0 }
++                       f && /disk byte/ && $5 != 0 { print $5 }'
++}
++file3offsets=$(inode_offsets "$vol1id" "$file3ino")
++file4offsets=$(inode_offsets "$subvol2id" "$file4ino")
++file5offsets=$(inode_offsets "$subvol2id" "$file5ino")
++[ -n "$file3offsets" ] && [ -n "$file4offsets" ] && [ -n "$file5offsets" ] ||
++      _fail "no extents found for file3, file4 or file5"
++
++# Bind mounts of directories are the only way in: mnt4 is vol1's directory
++# bdir, mnt5 the directory d2 of the nested subvol2.  Paths are printed
++# relative to the path argument, which can be the bind mount point, a
++# directory in it, or a relative path.
++run_check $SUDO_HELPER mount -o subvol=/@/vol1 "$TEST_DEV" "$TEST_MNT"
++run_check mkdir -p mnt4 mnt5
++run_check $SUDO_HELPER mount --bind "$TEST_MNT/bdir" mnt4
++run_check $SUDO_HELPER mount --bind "$TEST_MNT/bdir/sub/subvol2/d2" mnt5
++run_check_umount_test_dev "$TEST_MNT"
++
++for offset in $file3offsets; do
++      check_logical_offset_filename "$offset" mnt4 mnt4/file3
++      check_logical_offset_filename "$offset" "$PWD/mnt4" "$PWD/mnt4/file3"
++      ( cd mnt4 && check_logical_offset_filename "$offset" . ./file3 ) ||
++              _fail "logical-resolve $offset in mnt4"
++done
++for offset in $file4offsets; do
++      check_logical_offset_filename "$offset" mnt4 mnt4/sub/subvol2/file4
++      check_logical_offset_filename "$offset" mnt4/sub mnt4/sub/subvol2/file4
++      ( cd mnt4/sub && check_logical_offset_filename "$offset" . ./subvol2/file4 ) ||
++              _fail "logical-resolve $offset in mnt4/sub"
++done
++for offset in $file5offsets; do
++      check_logical_offset_filename "$offset" mnt5 mnt5/file5
++      ( cd mnt5 && check_logical_offset_filename "$offset" . ./file5 ) ||
++              _fail "logical-resolve $offset in mnt5"
++done
++
++run_check_umount_test_dev mnt5
++run_check_umount_test_dev mnt4
++run_check rmdir -- mnt4 mnt5
++
+ # Resolve inode $1 with $2 as the path argument: the printed paths must be
+ # exactly $4..., and the command must exit with status $3, which is 1 if
+ # some paths are not below $2
+-- 
+2.47.3
+
index 713c29cd92f9b49d918af6f711557c75bbe2534b..a93d19897fc460d29406a4b38c583ef5c0e58b77 100644 (file)
@@ -1,11 +1,16 @@
 # Testing: logical-resolve-fixes
 
-Three patches on devel 9d01fb77 (btrfs-progs Issue #400):
+Four patches on devel 9d01fb77 (btrfs-progs Issue #400):
 1. 4bd84e5a mountinfo optional fields;
 2. 2147f7bb subvolume lookup;
-3. 130213bd unreachable reference = error (with the misc-tests/042
+3. eb127d09 inode-resolve relative to its argument (with its
+   misc-tests/042 cases);
+4. da97c420 unreachable reference = error (with the misc-tests/042
    update, including its bind mount cases).
 
+Patch numbers in the tables below before 2026-10-30 "inode-resolve" are
+those of the 3-patch series: their "3" is today's 4.
+
 Not a kernel bug: on the misc-next lane kernel `-P` (inode, offset, root)
 returns every expected reference in every case below.  Only the user
 space step from (root, inode) to a path fails.
@@ -27,7 +32,10 @@ decimal addresses only.
 
 | test | verifies | patch(es) | last result | date | progs | harness | evidence |
 |---|---|---|---|---|---|---|---|
-| `logical-resolve-repro.sh`, bind mount layouts (bind1/bind1u: the bind of the non-subvolume directory /dir is the only way in, alone or with an unrelated subvol=/sv1 mount, argument the bind point and the directory above the nested subvolume; bind2/bind2t: argument inside that bind (".", $PWD, relative, absolute, a directory in it) for a file of the same subvolume and of a nested one, without and with the top level also mounted; bind3: bind of a directory of the nested subvolume sv1/sv2 as the argument and only way in), each checking one expected path | the expected path relative to the argument is printed | 2 | topic: 36/36 ok.  v6.14 and stock v7.1: 0/36 (same-subvolume files get a nonexistent path such as `./dir/fd`: the old root-5 shortcut; nested ones are "not mounted").  Topic before the fix (4ba66afa): bind1, bind1u and the nested-subvolume bind2 cases ok; the same-subvolume bind2/bind2t cases (`./fd` printed via the other mount or "not mounted", rc 1) and bind3 (rc 1) MISSING.  All non-bind lines identical to the 4ba66afa run | 2026-10-30 | v6.14, v7.1, testing 4ba66afa and df38fbfe (6b5d8220 has the same binary) | see Lane SHAs | `run-ahive-bind-testing-4ba66afa.txt`, `run-ahive-testing-df38fbfe.txt` |
+| `logical-resolve-repro.sh` ir-* (inode-resolve with the argument the subvolume root, a directory inside it, "." in it, the bind of /dir, the bind of sv1/sv2/d2; ir-hlink: a second hard link outside the bind) | the existing path relative to the argument is printed; names outside the argument are an error with rc 1 | 3 | topic 10/10 ok.  v6.14 and stock v7.1: 3/10 each (only the subvolume-root arguments); otherwise they print a nonexistent path repeating the argument's part, e.g. `$M/dir/dir/fd`, `$M6/d2/fd2`, and with the hard link two nonexistent paths, rc 0 | 2026-10-30 | v6.14, v7.1, topic da97c420 | b2dbbe5a | `run-ahive-ir-da97c420.txt` |
+| misc-tests 042 inode-resolve cases (patch 3): `$TEST_MNT` (vol1 root), `$TEST_MNT/idir`, "." in idir, a bind of idir at mnt6 and mnt6/sub; then a second link outside idir: both names from the root, rc 1 + the error from mnt6 and idir/sub | exact path set, exit status, error message | 3 | PASS (8 inode-resolve runs, 2 with rc 1).  Control: the same test with cmds/inspect.c of 6b5d8220 FAILS at `inode-resolve 264 .../mnt/idir printed '.../mnt/idir/idir/sub/ifile'` | 2026-10-30 | topic da97c420, testing 14c065a7 | b2dbbe5a | `misc-042-results-{topic-da97c420,testing-14c065a7}.txt` |
+| `logical-resolve-repro.sh` bind1u with the unrelated subvol=/sv1 mount `$M2` as the argument | a nested subvolume below a bind of a non-subvolume directory resolves through the mount route | 2 | topic: `dir/sub/sv3/f3` -> `$M5/sub/sv3/f3` 2/2 ok (stock "not mounted").  `dir/fd` (its subvolume reachable only through the bind of its own directory): "not mounted", rc 1, the known gap below (stock `ino paths ioctl: No such file or directory`) | 2026-10-30 | v6.14, v7.1, topic da97c420 | b2dbbe5a | `run-ahive-ir-da97c420.txt` |
+| `logical-resolve-repro.sh`, bind mount layouts (bind1/bind1u: the bind of the non-subvolume directory /dir is the only way in, alone or with an unrelated subvol=/sv1 mount, argument the bind point and the directory above the nested subvolume; bind2/bind2t: argument inside that bind (".", $PWD, relative, absolute, a directory in it) for a file of the same subvolume and of a nested one, without and with the top level also mounted; bind3: bind of a directory of the nested subvolume sv1/sv2 as the argument and only way in), each checking one expected path | the expected path relative to the argument is printed | 2 | topic: 36/36 ok (again on da97c420).  v6.14 and stock v7.1: 0/36 (same-subvolume files get a nonexistent path such as `./dir/fd`: the old root-5 shortcut; nested ones are "not mounted").  Topic before the fix (4ba66afa): bind1, bind1u and the nested-subvolume bind2 cases ok; the same-subvolume bind2/bind2t cases (`./fd` printed via the other mount or "not mounted", rc 1) and bind3 (rc 1) MISSING.  All non-bind lines identical to the 4ba66afa run | 2026-10-30 | v6.14, v7.1, testing 4ba66afa and df38fbfe (6b5d8220 has the same binary) | see Lane SHAs | `run-ahive-bind-testing-4ba66afa.txt`, `run-ahive-testing-df38fbfe.txt` |
 | misc-tests 042 bind mount cases (patch 3): vol1's directory bdir bound at mnt4 and subvol2's directory d2 at mnt5, `$TEST_MNT` unmounted; file3 (vol1, in bdir), file4 (subvol2 nested below bdir), file5 (subvol2, in d2), argument the bind point, a directory in it, "." and an absolute path; the expected path must be printed | 2, 3 | PASS (26 path lines, 4 unreachable references as before).  Control: the same test with the 4ba66afa binary FAILS at `logical-resolve 13631488 mnt4 did not print mnt4/file3`; with stock v7.1 it fails earlier, as before | 2026-10-30 | testing df38fbfe, 6b5d8220 | see Lane SHAs | `misc-042-results-testing-{df38fbfe,6b5d8220}.txt`, `progs-tests-ahive-testing-df38fbfe.txt` |
 | `logical-resolve-repro.sh` (matrix: layouts top, top with ".", top with a subvolume directory argument, both, sub, sub with ".", priv, 2opt, wrongfs, wrongfs with a bind mount first; plain, reflinked, zstd-compressed and nested-subvolume extents, at the extent start and mid-extent, with and without -o; decimal addresses) | every reference resolves to the right file under the right filesystem; paths relative to the argument | 1-3 | 98 cases per build.  v6.14: 28/98 fully resolved; stock v7.1: 28/98.  Topic: 86/98; the other 12 are the `sub` layout's references that are really unreachable (root 5 and snap1 with only subvol=/sv1 mounted): reported as `ERROR: ... could not be accessed: not mounted` on stderr, rc 1.  wrongfs: stock prints `/mnt/wh/lr-mnt3/WRONG-FS-B-f1` (another filesystem's file), topic resolves fs A through both routes.  Every topic line is identical to the 4-patch run's | 2026-10-30 | v6.14, v7.1, testing 4ba66afa | b2dc5d3 | `run-ahive-testing-4ba66afa.txt` |
 | same, 4-patch (also a `hex` layout) | as above, plus `0x` addresses | 1-3 + hex | 99 cases: stock 28/99, topic 87/99; hex: stock `ERROR: 0xd00000 is not a valid numeric value`, topic 2/2 | 2026-10-30 | testing 25b77be8; earlier devel + 0001-0004 | 09b7609 | `run-ahive-testing-25b77be8.txt`, `run-ahive-mn759c6b78edf4.txt` |
@@ -48,6 +56,7 @@ these tests pass decimal numbers):
 |---|---|---|---|---|
 | misc-tests 024-inspect-internal-rootid, 013-subvolume-sync-crash, 040-subvolume-delete-default, 043-subvolume-set-default-toplevel, 055-qgroup-clear-stale | PASS (rc 0 each) | 2026-10-30 | testing 25b77be8 | `progs-tests-ahive-testing-25b77be8.txt` |
 | cli-tests 008-subvolume-get-set-default | PASS | 2026-10-30 | testing 25b77be8 | same |
+| misc 042, 024, 013, 040, 043, 055, cli 008, with patch 3 | PASS | 2026-10-30 | topic da97c420, testing 14c065a7 | `progs-tests-ahive-{topic-da97c420,testing-14c065a7}.txt` |
 
 `make testsuite` was not built on ahive at the time (fsstress needs
 liburing, which ahive did not have); `make all` and `TEST=...
@@ -55,6 +64,16 @@ liburing, which ahive did not have); `make all` and `TEST=...
 
 ## Lane SHAs
 
+- 2026-10-30 inode-resolve (Zygo: "do fix #1"): new patch 3 eb127d09
+  (Fixes 6055e736045d) after the subvolume lookup patch, whose helpers it
+  uses (`ino_to_path_fd_below()` gains a skipped count; the INO_LOOKUP
+  part of `fs_path_of_fd()` becomes `subvol_path_of_fd()`, shared).  The
+  stderr patch is replayed on it, 130213bd -> da97c420 (author, committer
+  and dates kept; only the 042 append conflicted, resolved by appending
+  the inode-resolve cases after the bind cases).  testing 6b5d8220 ->
+  14c065a7, same parent layout; its tree is 6b5d8220's plus exactly the
+  topic's difference, and equals a real octopus merge.  Backups
+  refs/backup/progs-20261030-ir/.
 - 2026-10-30 bind mounts (Zygo approved the coverage and the fix): an
   argument that is a directory inside the reference's subvolume (a bind
   mount of a directory, or a directory in one) now resolves that
@@ -90,12 +109,12 @@ Wed Oct 28 21:00:00 EDT 2026` (KASAN, PROVE_LOCKING, BTRFS_DEBUG,
 BTRFS_ASSERT).  Evidence: raid56-wh-harness
 `forensics/progs-testsuite-20261030/SUMMARY.md` (harness b243013).
 
-3bc81a49 differs from the current `testing` 6b5d8220 in three ways,
+3bc81a49 differs from the current `testing` 14c065a7 in four ways,
 all in logical-resolve-fixes: it still had the arg_strtou64() hex patch
 that was since dropped, and the collapsed misc-tests/042 line that was
 since restored; and it predates the fix for a path argument inside a
 subvolume (e.g. a bind-mounted directory) and the bind mount cases of
-misc-tests/042 (2026-10-30).
+misc-tests/042 (2026-10-30); and it predates the inode-resolve patch.
 
 | suite | pass | not run | fail |
 |---|---|---|---|
@@ -130,18 +149,20 @@ misc-tests/042 (2026-10-30).
 - `-o` has no separate defect on devel: it resolves exactly what the
   plain command resolves in every case.
 - Bind mounts: the argument route works through them (tables above).
-  The mount route still does not use a bind of a directory inside a
-  subvolume as that subvolume's mount (wrongfs layout: `/sv1/bdir`
-  mounted first is skipped), so with the argument elsewhere a subvolume
-  reachable only through such a bind is reported unreachable.
+  The mount route also uses a bind of a directory that is an ancestor of
+  the subvolume (bind1u with `$M2` as the argument).  It still does not
+  use a bind of a directory inside a subvolume as that subvolume's mount
+  (wrongfs layout: `/sv1/bdir` mounted first is skipped; bind1u `dir/fd`),
+  so with the argument elsewhere a subvolume reachable only through such
+  a bind is reported unreachable (stderr, rc 1).
+- logical-resolve with an argument inside the subvolume prints only the
+  inode's names below the argument; other hard links outside it are
+  skipped without a message, rc 0 (repro hlink layout).  inode-resolve
+  reports the same case since patch 3.
 - Upstream misc-tests/042 before this series has two bind mounts (of
   `$TEST_MNT/dir`, an empty directory, and of the whole `$TEST_MNT`), but
   neither is the only way to any file and nothing checks which path is
   printed.
-- inode-resolve has the same in-subvolume-argument problem as the old
-  logical-resolve root-5 shortcut (paths relative to the subvolume root
-  printed after an argument that is a directory below it); not changed
-  here.
 - Kernel lanes ruled out: logical-ino-costs (COMMIT_ROOT flag, default
   off; progs never sets it) and the add_all_parents rewind-cycle check,
   which would surface as `ERROR: logical ino ioctl: Resource temporarily
index d3cb339deec159d191896c4da578d09f14c01d94..f6feff527e37b00edb61211bec8dd7bd30778ee6 100644 (file)
@@ -41,12 +41,12 @@ Wed Oct 28 21:00:00 EDT 2026` (KASAN, PROVE_LOCKING, BTRFS_DEBUG,
 BTRFS_ASSERT).  Evidence: raid56-wh-harness
 `forensics/progs-testsuite-20261030/SUMMARY.md` (harness b243013).
 
-3bc81a49 differs from the current `testing` 6b5d8220 in three ways,
+3bc81a49 differs from the current `testing` 14c065a7 in four ways,
 all in logical-resolve-fixes: it still had the arg_strtou64() hex patch
 that was since dropped, and the collapsed misc-tests/042 line that was
 since restored; and it predates the fix for a path argument inside a
 subvolume (e.g. a bind-mounted directory) and the bind mount cases of
-misc-tests/042 (2026-10-30).
+misc-tests/042 (2026-10-30); and it predates the inode-resolve patch.
 
 | suite | pass | not run | fail |
 |---|---|---|---|
index 2e4563b1246d30189be2595df859d5f9329177da..2f95eaff4454bbb7b07dd53951dfb628646a6b11 100644 (file)
@@ -69,12 +69,12 @@ Wed Oct 28 21:00:00 EDT 2026` (KASAN, PROVE_LOCKING, BTRFS_DEBUG,
 BTRFS_ASSERT).  Evidence: raid56-wh-harness
 `forensics/progs-testsuite-20261030/SUMMARY.md` (harness b243013).
 
-3bc81a49 differs from the current `testing` 6b5d8220 in three ways,
+3bc81a49 differs from the current `testing` 14c065a7 in four ways,
 all in logical-resolve-fixes: it still had the arg_strtou64() hex patch
 that was since dropped, and the collapsed misc-tests/042 line that was
 since restored; and it predates the fix for a path argument inside a
 subvolume (e.g. a bind-mounted directory) and the bind mount cases of
-misc-tests/042 (2026-10-30).
+misc-tests/042 (2026-10-30); and it predates the inode-resolve patch.
 
 | suite | pass | not run | fail |
 |---|---|---|---|
index 1192326746ad4a2db842115b46be8629b0366a19..fabe191f20530f1cf3fca4af254866f6ab348d4a 100644 (file)
@@ -1,6 +1,6 @@
 From c6bdae69281400698579562f59ef003b323cf7f6 Mon Sep 17 00:00:00 2001
 From: Zygo Blaxell <ce3g8jdj@umail.furryterror.org>
-Date: Fri, 30 Oct 2026 16:58:38 -0400
+Date: Fri, 30 Oct 2026 17:30:53 -0400
 Subject: [PATCH 0/2] btrfs-progs: scrub: leave the device limits alone without --limit
 To: linux-btrfs@vger.kernel.org
 
index 82610382d8475d473241669a55d6febadc21334e..e6ce72a9fc415bb7f6ef03dd15d8da0ec97b17bc 100644 (file)
@@ -65,12 +65,12 @@ Wed Oct 28 21:00:00 EDT 2026` (KASAN, PROVE_LOCKING, BTRFS_DEBUG,
 BTRFS_ASSERT).  Evidence: raid56-wh-harness
 `forensics/progs-testsuite-20261030/SUMMARY.md` (harness b243013).
 
-3bc81a49 differs from the current `testing` 6b5d8220 in three ways,
+3bc81a49 differs from the current `testing` 14c065a7 in four ways,
 all in logical-resolve-fixes: it still had the arg_strtou64() hex patch
 that was since dropped, and the collapsed misc-tests/042 line that was
 since restored; and it predates the fix for a path argument inside a
 subvolume (e.g. a bind-mounted directory) and the bind mount cases of
-misc-tests/042 (2026-10-30).
+misc-tests/042 (2026-10-30); and it predates the inode-resolve patch.
 
 | suite | pass | not run | fail |
 |---|---|---|---|
index feb0ff297d2a0037ff1ffdbbd453e7c6a1c3742b..ed163bbc9962b108ee9491bd183dd2b337a592e4 100644 (file)
@@ -1,6 +1,6 @@
 From 37cc6ecb63f75d08913183387116f1ea7ecc05e0 Mon Sep 17 00:00:00 2001
 From: Zygo Blaxell <ce3g8jdj@umail.furryterror.org>
-Date: Fri, 30 Oct 2026 16:58:38 -0400
+Date: Fri, 30 Oct 2026 17:30:53 -0400
 Subject: [PATCH 0/2] btrfs-progs: scrub: progress socket fixes
 To: linux-btrfs@vger.kernel.org
 
index f1e9762700fc2b9e790134524b2f6b61fae4c5be..1aacca29b22ca198aafb3674879b4edd8cdbff7d 100644 (file)
@@ -53,12 +53,12 @@ Wed Oct 28 21:00:00 EDT 2026` (KASAN, PROVE_LOCKING, BTRFS_DEBUG,
 BTRFS_ASSERT).  Evidence: raid56-wh-harness
 `forensics/progs-testsuite-20261030/SUMMARY.md` (harness b243013).
 
-3bc81a49 differs from the current `testing` 6b5d8220 in three ways,
+3bc81a49 differs from the current `testing` 14c065a7 in four ways,
 all in logical-resolve-fixes: it still had the arg_strtou64() hex patch
 that was since dropped, and the collapsed misc-tests/042 line that was
 since restored; and it predates the fix for a path argument inside a
 subvolume (e.g. a bind-mounted directory) and the bind mount cases of
-misc-tests/042 (2026-10-30).
+misc-tests/042 (2026-10-30); and it predates the inode-resolve patch.
 
 | suite | pass | not run | fail |
 |---|---|---|---|