]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commit
metadump: handle corruption errors without aborting
authorDave Chinner <dchinner@redhat.com>
Fri, 27 May 2022 20:36:14 +0000 (16:36 -0400)
committerEric Sandeen <sandeen@sandeen.net>
Fri, 27 May 2022 20:36:14 +0000 (16:36 -0400)
commita196ca6527083d8ad00bf69878e445cc8f710191
treea5902aa6242c0c0db0913180168154bacb7c09e9
parent0d376f6cf1799bd359a1c943e063f1a7db928660
metadump: handle corruption errors without aborting

Sean Caron reported that a metadump terminated after givin gthis
warning:

xfs_metadump: inode 2216156864 has unexpected extents

Metadump is supposed to ignore corruptions and continue dumping the
filesystem as best it can. Whilst it warns about many situations
where it can't fully dump structures, it should stop processing that
structure and continue with the next one until the entire filesystem
has been processed.

Unfortunately, some warning conditions also return an "abort" error
status, causing metadump to abort if that condition is hit. Most of
these abort conditions should really be "continue on next object"
conditions so that the we attempt to dump the rest of the
filesystem.

Fix the returns for warnings that incorrectly cause aborts
such that the only abort conditions are read errors when
"stop-on-read-error" semantics are specified. Also make the return
values consistently mean abort/continue rather than returning -errno
to mean "stop because read error" and then trying to infer what
the error means in callers without the context it occurred in.

Reported-and-tested-by: Sean Caron <scaron@umich.edu>
Signed-off-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Darrick J. Wong <djwong@kernel.org>
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
db/metadump.c