xfs
[Top] [All Lists]

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

To: Fanael Linithien <fanael4@xxxxxxxxx>
Subject: Re: [PATCH v2 1/5] xfs_repair: refuse to run if we don't recognize version or feature flags
From: "Darrick J. Wong" <darrick.wong@xxxxxxxxxx>
Date: Wed, 27 May 2015 10:17:38 -0700
Cc: Eric Sandeen <sandeen@xxxxxxxxxxx>, david@xxxxxxxxxxxxx, xfs@xxxxxxxxxxx
Delivered-to: xfs@xxxxxxxxxxx
In-reply-to: <5565EB29.4080200@xxxxxxxxx>
References: <20150526225126.26434.69010.stgit@xxxxxxxxxxxxxxxx> <20150526225132.26434.82404.stgit@xxxxxxxxxxxxxxxx> <20150527054536.GB10175@xxxxxxxxxxxxxxxx> <5565DAA7.4040406@xxxxxxxxxxx> <5565DFEB.9040000@xxxxxxxxxxx> <5565E265.5040202@xxxxxxxxxxx> <5565EB29.4080200@xxxxxxxxx>
User-agent: Mutt/1.5.21 (2010-09-15)
On Wed, May 27, 2015 at 06:04:57PM +0200, Fanael Linithien wrote:
> 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 & 
> > XFS_SB_FEAT_RO_COMPAT_UNKNOWN,
> >                     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.

<shrug> I guess repair could do that.  I'd broken things out separately
(key word: broken ;)) to avoid complaining about whichever fields aren't
broken, but I suppose it doesn't really matter.

> >     
> >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.

I prefer any repair tool be forthcoming about not knowing what something is.

--D

> 
> _______________________________________________
> xfs mailing list
> xfs@xxxxxxxxxxx
> http://oss.sgi.com/mailman/listinfo/xfs

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