[Top] [All Lists]

Re: [PATCH v2 1/5] xfs_repair: refuse to run if we don't recognize versi

To: Eric Sandeen <sandeen@xxxxxxxxxxx>, "Darrick J. Wong" <darrick.wong@xxxxxxxxxx>, david@xxxxxxxxxxxxx
Subject: Re: [PATCH v2 1/5] xfs_repair: refuse to run if we don't recognize version or feature flags
From: Fanael Linithien <fanael4@xxxxxxxxx>
Date: Wed, 27 May 2015 18:04:57 +0200
Cc: xfs@xxxxxxxxxxx
Delivered-to: xfs@xxxxxxxxxxx
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=8Lvg9sKDlbBeAeDmQoaJgXSMWK0CfFpnIevCGPa27NM=; b=Mtc9jtHkacci0Lf09HHjBPR5Yy2N4YkB9dkFPZIvAdrkZo1egiLr8ZV7a3xUhZLQ6K gZjm8AiOcXzCXcpB6TKBiVFziZUPNR4WHeLyfQ77kkMrM8o8G1SNRyAhKkoTjhf7XqR0 4i8ruqn19TF/r2ydJCZu9C3/DRU02q+Roju2dUax9fDiiQsS/iXWTyiH6ACl9uh+lZJD QjxWhc3DimCoqciNZKVKBqZKj9RhKZDhPmVdN4L+yQ0S4FilxHVNXF0W4lY+vcE0PWF8 S8k/0fUfrauEcBVIZjd4WvJNJH97JXCzFdxNGIMQ089ie7TU71FQRbMvSXAuVZCwJdn6 gA3w==
In-reply-to: <5565E265.5040202@xxxxxxxxxxx>
References: <20150526225126.26434.69010.stgit@xxxxxxxxxxxxxxxx> <20150526225132.26434.82404.stgit@xxxxxxxxxxxxxxxx> <20150527054536.GB10175@xxxxxxxxxxxxxxxx> <5565DAA7.4040406@xxxxxxxxxxx> <5565DFEB.9040000@xxxxxxxxxxx> <5565E265.5040202@xxxxxxxxxxx>
User-agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0
On 2015-05-27 17:27, Eric Sandeen wrote:

I wonder if something like:

        /* Look for V5 feature flags we don't know about */
        if (XFS_SB_VERSION_NUM(sb) >= XFS_SB_VERSION_5 &&
            (xfs_sb_has_ro_compat_feature(sb, XFS_SB_FEAT_RO_COMPAT_UNKNOWN) ||
             xfs_sb_has_incompat_feature(sb, XFS_SB_FEAT_INCOMPAT_UNKNOWN) ||
             xfs_sb_has_compat_feature(sb, XFS_SB_FEAT_COMPAT_UNKNOWN))) {
                printf("unknown feature flags 0x%x/0x%x/0x%x\n",
                        sb->sb_features_ro_compat & 
                        sb->sb_features_incompat & XFS_SB_FEAT_INCOMPAT_UNKNOWN,
                        sb->sb_features_compat & XFS_SB_FEAT_COMPAT_UNKNOWN);

would suffice, given that the user will need to read code to unerstand the hex
values, anyway.
Hm, and as Fanael also pointed out, "compat" features ... should be ok, right,
and can be removed from the exclusions?

I'm not entirely sure silently ignoring unknown compat features in xfs_repair is a good idea. Consider this ext2 example: xattr support is a compat flag. It's okay to rw mount a FS with xattrs on some ancient (or non-Linux) kernel without xattr support — everything will be fine, even though there's no way to access them — but if the fsck tool doesn't understand them, it wouldn't be able to diagnose xattr corruption.

I'd either warn the user about unknown compat features, telling them they're on their own if something in the FS is still broken; or barf outright.

<Prev in Thread] Current Thread [Next in Thread>