]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commit
xfs_metadump: Make -F (force) optional
authorEric Sandeen <sandeen@redhat.com>
Thu, 12 Dec 2013 17:47:59 +0000 (17:47 +0000)
committerRich Johnston <rjohnston@sgi.com>
Tue, 17 Dec 2013 16:51:51 +0000 (10:51 -0600)
commit4e83ac7b7416edb52815c6e5f4ca64dadfa5f974
treeda7c80f8b7b5722776b1618477742b6a82815d19
parentea4a8de1e135905e240a54f192daf23275a7e8a8
xfs_metadump: Make -F (force) optional

If we do something crazy like:

# xfs_metadump /root/anaconda.cfg outfile

xfs_metadump will pass "-F" to xfs_db to carry on even in the face
of bad superblock magic. [1]  Depending on what we gave as an input
file, we may very well fail quite badly:

> xfs_metadump: /root/anaconda.cfg is not a valid XFS filesystem (unexpected SB magic number 0x230a2320)
> Floating point exception

I don't think it's possible to harden every path through libxfs for
non-xfs filesystems as input.  (Even if it's possible, I don't think it's
worth the effort).

So I propose making the "-F" optional; by default, xfs_metadump will
say no, this has bad magic, I'm stopping.  If the admin really wants to
try to proceed, suggest that they can use "-F" and they can keep all the
broken pieces.

[1] behavior added in 7f98455 xfs_db: exit on invalid magic number

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Rich Johnston <rjohnston@sgi.com>
db/init.c
db/xfs_metadump.sh
man/man8/xfs_metadump.8