| | |
|---|---|
| base of every series | `9d01fb77f46e` (`v7.1-102-g9d01fb77`), upstream btrfs-progs `devel` as of 2026-10-29: `testing^1` |
-| integration branch | `testing` `d541f7768952` (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` `71ea14752adb` (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,
BTRFS_ASSERT). Evidence: raid56-wh-harness
`forensics/progs-testsuite-20261030/SUMMARY.md` (harness b243013).
-3bc81a49 differs from the current `testing` d541f776 in five ways,
+3bc81a49 differs from the current `testing` 71ea1475 in five 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
-From 85ca1f91a962d1d538d764ee25fcf3d144b2f883 Mon Sep 17 00:00:00 2001
+From c9ea03d86d7c8f16c214247df12e1a9ef9b3eeb8 Mon Sep 17 00:00:00 2001
From: Zygo Blaxell <ce3g8jdj@umail.furryterror.org>
-Date: Fri, 30 Oct 2026 20:38:09 -0400
+Date: Fri, 30 Oct 2026 22:59:36 -0400
Subject: [PATCH 0/5] btrfs-progs: inspect logical-resolve: find the file names again
To: linux-btrfs@vger.kernel.org
and exit status.
Patch 5 is a feature: -z (--zero) for both commands ends each path (and
-each -P line) with a NUL character instead of a newline, without any
-escaping, so that file names with newlines can be parsed. No progs
-command has such an option yet; the name follows coreutils' realpath,
-readlink, dirname and basename. Tests in 042 and 074.
+each -P line) with a NUL character instead of a newline, so that file
+names with newlines can be parsed. No progs command has such an option
+yet; the name follows coreutils' realpath, readlink, dirname and
+basename. Tests in 042 and 074.
User-visible changes:
- Patch 2: paths are printed relative to the path argument when the
reference
btrfs-progs: inspect: add -z to logical-resolve and inode-resolve
- Documentation/btrfs-inspect-internal.rst | 13 +-
+ Documentation/btrfs-inspect-internal.rst | 11 +-
cmds/inspect.c | 599 +++++++++++++++---
common/utils.c | 135 +---
common/utils.h | 3 +-
.../test.sh | 176 ++++-
.../test.sh | 120 ++++
- 6 files changed, 846 insertions(+), 200 deletions(-)
+ 6 files changed, 844 insertions(+), 200 deletions(-)
create mode 100755 tests/misc-tests/074-inspect-internal-inode-resolve/test.sh
-From 85ca1f91a962d1d538d764ee25fcf3d144b2f883 Mon Sep 17 00:00:00 2001
+From c9ea03d86d7c8f16c214247df12e1a9ef9b3eeb8 Mon Sep 17 00:00:00 2001
From: Zygo Blaxell <ce3g8jdj@umail.furryterror.org>
Date: Fri, 30 Oct 2026 20:26:49 -0400
Subject: [PATCH 5/5] btrfs-progs: inspect: add -z to logical-resolve and
The paths that logical-resolve and inode-resolve print are file names,
which may contain newlines, so a script cannot split the output into
paths reliably. Add -z (--zero): end each path with a NUL character
-instead of a newline, and print it as it is, without any escaping or
-quoting. With logical-resolve -P each inode line ends with NUL instead.
-Errors still go to stderr as text.
+instead of a newline. With logical-resolve -P each inode line ends
+with NUL instead. Errors still go to stderr.
No btrfs-progs command has such an option yet. The name follows the
coreutils commands that print file names, such as realpath, readlink,
Link: https://github.com/kdave/btrfs-progs/issues/400
Assisted-by: Claude:claude-opus-5-5
---
- Documentation/btrfs-inspect-internal.rst | 13 ++++++-
+ Documentation/btrfs-inspect-internal.rst | 11 +++++-
cmds/inspect.c | 39 +++++++++++++++----
.../test.sh | 30 ++++++++++++++
.../test.sh | 27 +++++++++++++
- 4 files changed, 99 insertions(+), 10 deletions(-)
+ 4 files changed, 97 insertions(+), 10 deletions(-)
diff --git a/Documentation/btrfs-inspect-internal.rst b/Documentation/btrfs-inspect-internal.rst
-index e86135ff..f52e427c 100644
+index e86135ff..fceab9b1 100644
--- a/Documentation/btrfs-inspect-internal.rst
+++ b/Documentation/btrfs-inspect-internal.rst
@@ -137,7 +137,7 @@ dump-tree [options] <device> [device...]
(needs root privileges)
resolve paths to all files with given inode number *ino* in a given subvolume
-@@ -147,8 +147,12 @@ inode-resolve [-v] <ino> <path>
+@@ -147,8 +147,11 @@ inode-resolve [-v] <ino> <path>
-v
(deprecated) alias for global *-v* option
+ -z|--zero
-+ end each path with a NUL character instead of a newline, for paths that
-+ may contain newlines. Paths are printed as they are, without any escaping
-+ or quoting. Errors still go to standard error as text.
++ end each path with a NUL character instead of a newline, for names that
++ contain newlines. Errors still go to standard error.
-logical-resolve [-Pvo] [-s <bufsize>] <logical> <path>
+logical-resolve [-Pvoz] [-s <bufsize>] <logical> <path>
(needs root privileges)
resolve paths to all files at given *logical* address in the linear filesystem space
-@@ -168,6 +172,11 @@ logical-resolve [-Pvo] [-s <bufsize>] <logical> <path>
+@@ -168,6 +171,10 @@ logical-resolve [-Pvo] [-s <bufsize>] <logical> <path>
(added in 4.15).
-v
(deprecated) alias for global *-v* option
+ -z|--zero
+ end each line of output (each path, or each inode with *-P*) with a NUL
-+ character instead of a newline, for paths that may contain newlines. Paths
-+ are printed as they are, without any escaping or quoting. Errors still go
-+ to standard error as text.
++ character instead of a newline, for names that contain newlines. Errors
++ still go to standard error.
list-chunks [options] <path>
(needs root privileges)
diff --git a/cmds/inspect.c b/cmds/inspect.c
-index e1ad1579..53532b90 100644
+index e1ad1579..88e37202 100644
--- a/cmds/inspect.c
+++ b/cmds/inspect.c
@@ -94,12 +94,15 @@ static const char *ino_path(const char *pathbuf, int i)
"",
OPTLINE("-v", "deprecated, alias for global -v option"),
+ OPTLINE("-z, --zero", "end each path with a NUL character instead of a newline, "
-+ "without any escaping"),
++ "for names that contain newlines"),
HELPINFO_INSERT_GLOBALS,
HELPINFO_INSERT_VERBOSE,
NULL
"v1 ioctl. Sizes over 64k will use the v2 ioctl (kernel 4.15+)"),
OPTLINE("-v", "deprecated, alias for global -v option"),
+ OPTLINE("-z, --zero", "end each line of output (path, or inode with -P) with a NUL "
-+ "character instead of a newline, without any escaping"),
++ "character instead of a newline, for names that contain newlines"),
HELPINFO_INSERT_GLOBALS,
HELPINFO_INSERT_VERBOSE,
NULL
run_check $SUDO_HELPER mount -o subvol=/@/vol1/bdir/sub/subvol2 "$TEST_DEV" "mnt8 $odd"
for offset in $file6offsets; do
diff --git a/tests/misc-tests/074-inspect-internal-inode-resolve/test.sh b/tests/misc-tests/074-inspect-internal-inode-resolve/test.sh
-index 0e46e4b8..5aee3f62 100755
+index 0e46e4b8..c70a1b3c 100755
--- a/tests/misc-tests/074-inspect-internal-inode-resolve/test.sh
+++ b/tests/misc-tests/074-inspect-internal-inode-resolve/test.sh
@@ -50,6 +50,24 @@ check_inode_resolve()
check_inode_resolve "$ino" "$TEST_MNT/idir/sub" 0 "$TEST_MNT/idir/sub/file" \
"$TEST_MNT/ldir/link" "$TEST_MNT/link"
-+# With -z, names with a newline and a space are printed as they are
++# With -z, each path ends with NUL, also for a name with a newline and a space
+name=$'new\nline and space'
+run_check $SUDO_HELPER ln "$TEST_MNT/idir/sub/file" "$TEST_MNT/ldir/$name"
+check_inode_resolve_zero "$ino" "$TEST_MNT" "$TEST_MNT/idir/sub/file" \
4. a4893e1e unreachable reference or path = error (with the
misc-tests/042 update, including its bind mount and escaped-name
cases, and the 074 update);
-5. 85ca1f91 -z/--zero NUL-terminated output for both commands (feature).
+5. c9ea03d8 -z/--zero NUL-terminated output for both commands (feature).
Rows older than 2026-10-30 "bind2" ran earlier versions of patches 2-4
(see Lane SHAs); their results are kept for the history.
| 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` |
| misc 042, 074, 024, 013, 040, 043, 055, cli 008 ("bind2") | PASS | 2026-10-30 | topic bed8b5eb, testing a32d9351 | `bind2/progs-tests-ahive-bisect-and-testing.txt` |
| same ("esc") | PASS | 2026-10-31 | topic 85ca1f91, testing d541f776 | `esc/progs-tests-ahive-*.txt` |
+| same ("z", patch 5 text only) | PASS | 2026-10-31 | topic c9ea03d8, testing 71ea1475 | `z/progs-tests-ahive-c9ea03d8-71ea1475.txt` |
`make testsuite` was not built on ahive at the time (fsstress needs
liburing, which ahive did not have); `make all` and `TEST=...
## Lane SHAs
+- 2026-10-31 "z" (Zygo: the resolve commands never escaped their output,
+ so -z is described only as ending each path with NUL instead of a
+ newline): patch 5 usage strings, rst, commit message and the 074
+ comment reworded, no code change; 85ca1f91 -> c9ea03d8 (author,
+ committer, dates kept). testing d541f776 -> 71ea1475, same parents;
+ tree = oracle = real merge. Backups refs/backup/progs-20261031-z/.
- 2026-10-31 "esc" (Zygo: unescape mount points; add -z/-0): the
mountinfo parser already decodes octal escapes (read_path(), from
e31679c1), so no code change; escaped-name cases added to 042 in patch
BTRFS_ASSERT). Evidence: raid56-wh-harness
`forensics/progs-testsuite-20261030/SUMMARY.md` (harness b243013).
-3bc81a49 differs from the current `testing` d541f776 in five ways,
+3bc81a49 differs from the current `testing` 71ea1475 in five 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
BTRFS_ASSERT). Evidence: raid56-wh-harness
`forensics/progs-testsuite-20261030/SUMMARY.md` (harness b243013).
-3bc81a49 differs from the current `testing` d541f776 in five ways,
+3bc81a49 differs from the current `testing` 71ea1475 in five 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
BTRFS_ASSERT). Evidence: raid56-wh-harness
`forensics/progs-testsuite-20261030/SUMMARY.md` (harness b243013).
-3bc81a49 differs from the current `testing` d541f776 in five ways,
+3bc81a49 differs from the current `testing` 71ea1475 in five 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
BTRFS_ASSERT). Evidence: raid56-wh-harness
`forensics/progs-testsuite-20261030/SUMMARY.md` (harness b243013).
-3bc81a49 differs from the current `testing` d541f776 in five ways,
+3bc81a49 differs from the current `testing` 71ea1475 in five 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
BTRFS_ASSERT). Evidence: raid56-wh-harness
`forensics/progs-testsuite-20261030/SUMMARY.md` (harness b243013).
-3bc81a49 differs from the current `testing` d541f776 in five ways,
+3bc81a49 differs from the current `testing` 71ea1475 in five 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