Christoph Hellwig wrote:
> Exit gracefully if the magic number doesn't match xfs in xfs_admin
> and xfs_ncheck. This is implemented by a new -C option to xfs_db
> which makes it exit with a useful error message in case the filesystem
> doesn't match the XFS superblock magic number.
> Reported-by: Dick Middleton <dick@xxxxxxxxxxxx>
> Signed-off-by: Christoph Hellwig <hch@xxxxxx>
I guess I'd rather see this the reverse, and require a flag to allow
xfs_db to work on something that doesn't look like xfs - err on the side
of safety (hm but I suppose db is usually in read-only mode...)
Addresses jeffpc's criticism too, to some degree; you can use -F to mean
"force" or "foreign" :) before xfs_db will touch the fs.
So I think I personally like it better with the inverse, where it always
exits on bad magic unless you explicitly tell it otherwise. Making the
error message reference the option might be nice ("Use -F to ignore this
error" or somesuch)