Skip to content

allow dump levels 0-254

Diego Rivera linux-xfs 1 version New

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest2 patches 0 repliesNew

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2xfsrestore: don't assume single-digit dump levels in dump labelsrestore/content.c+3 -40 replies
2/2xfsdump: allow dump levels up to 254common/arch_xlate.c common/content_inode.h dump/content.c +3 more+94 -140 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH xfsdump 0/2] allow dump levels 0-254

xfsdump limits dump levels to 0-9. Nothing on media or in the inventory imposes that: the media file header stores the level as an int32_t and the inventory session header as a byte. The limit is the LEVEL_MAX policy constant in dump/content.c, plus an assert in xfsrestore's label display that the level is a single digit. Linux dump(8) has accepted any integer level for years.

This can be very useful in environments for which frequent incrementals are desirable, but the current ten levels (0-9) are simply too narrow.

1/2 makes xfsrestore print levels of any size
2/2 raises xfsdump's limit to 254, the most the inventory byte can
hold with 255 kept as the -I level= "any level" marker. The level written into the media header is capped at 9 so that released xfsrestore, whose assert would otherwise abort, can still restore these dumps (reporting them as level 9); the real level goes into the adjacent 4 bytes of alignment padding, which xfsdump always zeroed.

No on-disk layout changes and no inventory format change. Dumps at levels 0-9 are byte-for-byte what xfsdump writes today, and existing dumps and inventories decode unchanged.

Testing: built with gcc 13.3 against xfsprogs 6.6 headers, with no new warnings. On a 6.8 kernel, fstests -g dump gives the same results with and without this series (29 pass; 14 not run: the tape tests and xfs/287). A new fstests test, xfs/842 (sent separately), passes with the series and is skipped with xfsdump 3.3.0.

An end-to-end script also checked compatibility with 3.3.0. A chain of incrementals at levels 0-12, 100, 253 and 254 restores correctly with the new xfsrestore and with 3.3.0 xfsrestore, which reports every level above 9 as 9. Dumps from 3.3.0 xfsdump restore correctly with the new xfsrestore. 3.3.0 xfsdump sharing the inventory lists the real levels and still bases its incrementals on levels below its own. For comparison, a dump carrying the raw level 10 in cih_level makes 3.3.0 xfsrestore (assertions enabled) abort in display_dump_label().

Tool use: this series was developed with an AI coding assistant (Claude Opus 5.5, Anthropic). It traced the level limit through xfsdump, xfsrestore, xfsinvutil and the inventory code, and drafted the code, man page change and changelogs from a request to lift the 0-9 limit without changing on-disk formats or breaking older xfsrestore. I reviewed all of it and found no need to change any of it. The changes center on the self-imposed enforcement of the 0-9 level limit itself and on displaying levels of any size safely. The coding tool ran all the tests in a QEMU VM, and I reviewed both the code and the test results.

Diego Rivera (2):
xfsrestore: don't assume single-digit dump levels in dump labels
xfsdump: allow dump levels up to 254

 common/arch_xlate.c    |  2 +-
 common/content_inode.h | 60 +++++++++++++++++++++++++++++++++++++++---
 dump/content.c         | 23 +++++++++++++---
 inventory/inventory.h  |  7 ++++-
 man/man8/xfsdump.8     | 10 +++++--
 restore/content.c      | 11 ++++----
 6 files changed, 96 insertions(+), 17 deletions(-)

base-commit: 04051066b6c66218717cb6cbfd51e96df393d183

Signature · 1 line
2.43.0