From: Liu Bo <bo.li.liu@oracle.com>
To: Qu Wenruo <quwenruo@cn.fujitsu.com>
Cc: dsterba@suse.cz, Anand Jain <anand.jain@oracle.com>,
linux-btrfs@vger.kernel.org
Subject: Re: [PATCH v2 0/5] Make btrfs-progs really compatible with any kernel version
Date: Fri, 4 Dec 2015 10:23:04 -0800 [thread overview]
Message-ID: <20151204182304.GB8792@localhost.localdomain> (raw)
In-Reply-To: <56610F43.4060306@cn.fujitsu.com>
On Fri, Dec 04, 2015 at 11:57:55AM +0800, Qu Wenruo wrote:
>
>
> Liu Bo wrote on 2015/12/03 18:53 -0800:
> >On Fri, Dec 04, 2015 at 10:08:35AM +0800, Qu Wenruo wrote:
> >>
> >>
> >>Liu Bo wrote on 2015/12/03 17:44 -0800:
> >>>On Mon, Nov 23, 2015 at 06:56:09PM +0100, David Sterba wrote:
> >>>>On Mon, Nov 23, 2015 at 08:56:13PM +0800, Anand Jain wrote:
> >>>>>Btrfs-progs is a tool for the btrfs kernel and we hope latest btrfs-progs
> >>>>>be compatible w any set of older/newer kernels.
> >>>>>
> >>>>>So far mkfs.btrfs and btrfs-convert sets the default features, for eg,
> >>>>>skinny-metadata even if the running kernel does not supports it, and
> >>>>>so the mount fails on the running.
> >>>>
> >>>>So the default behaviour of mkfs will try to best guess the feature set
> >>>>of currently running kernel. I think this is is the most common scenario
> >>>>and justifies the change in default behaviours.
> >>>>
> >>>>For the other cases I'd like to introduce some human-readable shortcuts
> >>>>to the --features option. Eg. 'mkfs.btrfs -O compat-3.2' will pick all
> >>>>options supported by the unpatched mainline kernel of version 3.2. This
> >>>>would be present for all version, regardless if there was a change in the
> >>>>options or not.
> >>>>
> >>>>Similarly for convenience, add 'running' that would pick the options
> >>>>from running kernel but will be explicit.
> >>>>
> >>>>A remaining option should override the 'running' behaviour and pick the
> >>>>latest mkfs options. Naming it 'defaults' sounds a bit ambiguous so the
> >>>>name is yet to be determined.
> >>>>
> >>>>>Here in this set of patches will make sure the progs understands the
> >>>>>kernel supported features.
> >>>>>
> >>>>>So in this patch, checks if sysfs tells whether the feature is
> >>>>>supported if not, then it will relay on static kernel version which
> >>>>>provided that feature (skinny-metadata here in this example), next
> >>>>>if for some reason the running kernel does not provide the kernel
> >>>>>version, then it will fall back to the original method to enable
> >>>>>the feature with a hope that kernel will support it.
> >>>>>
> >>>>>Also the last patch adds a warning when we fail to read either
> >>>>>sysfs features or the running kernel version.
> >>>>
> >>>>Your patchset is a good start, the additional options I've described can
> >>>>be added on top of that. We might need to switch the version
> >>>>representation from string to KERNEL_VERSION but that's an
> >>>>implementation detail.
> >>>
> >>>Depending on sysfs is stable but depending on kernel version may be not,
> >>>we may have a distro kernel which backports some incompat features from
> >>>upstream, then we have to decide based on sysfs interface.
> >>
> >>+1.
> >>
> >>Although sysfs does not always show up even for supported kernel, e.g btrfs
> >>modules is not loaded after boot.
> >>So we need to consider twice before choosing a fallback method.
> >>
> >>>
> >>>However, this brings another problems, for very old kernels, they don't
> >>>have sysfs, do you have any suggestions for that?
> >>
> >>Other fs, like xfs/ext* doesn't even have sysfs feature interface, only
> >>release announcement mentioning default behavior change.
> >>And I don't see many users complaining about it.
> >>
> >>Here is the example of xfsprogs changed its default feature recently:
> >>In 10th, June, 2015, xfsprogs v3.2.3 is released, with new default feature
> >>of enabling CRC for fs.
> >>The first supported kernel is 3.15, which is release in 8th Jun, 2014.
> >>Almost one year ago.
> >
> >It's the same thing, if you use a earlier version(before v5) xfs and a
> >v5 xfsprogs, you are not going to mount it.
> >
> >>
> >>On the other hand, the sysfs feature is introduced at the end of year 2013.
> >>It's already over 2 years.
> >>
> >>So just forgot the extra minor case of super old kernel would be good
> >>enough.
> >
> >Sorry we're not able to do that since most users won't keep up upgrading their
> >kernels to the latest one, instead they use the stable one they think.
> >
> >The fact is that btrfs has way more incompatible features than either ext4 or xfs,
> >and no complain on ext4/xfs from them won't solve our btrfs issue anyway.
> >
> >The problem is much more serious for enterprise users which are sort of
> >conservative, they would backport what they need, if they use
> >btrfs they will experience the painful things.
>
> Only if enterprise really think btrfs is stable enough.
> For this point, xfs is considered more stable than btrfs, but v5 xfs recent
> change doesn't introduce such facility to do that compatibility check in
> xfsprogs.
Xfs on kernel side obviously refuses to mount if you create an incompatible
feature with a recent xfsprogs but try to mount it with older kernel.
STATIC int
xfs_mount_validate_sb()
{
...
if (xfs_sb_has_incompat_feature(sbp, XFS_SB_FEAT_INCOMPAT_UNKNOWN)) {
xfs_warn(mp,
"Superblock has unknown incompatible features (0x%x) enabled.",
(sbp->sb_features_incompat & XFS_SB_FEAT_INCOMPAT_UNKNOWN));
xfs_warn(mp,
"Filesystem can not be safely mounted by this kernel.");
return -EINVAL;
}
...
}
And this did happen:
http://comments.gmane.org/gmane.comp.file-systems.xfs.general/69514
>
> >
> >There're plenty of fixes for progs code, people needs stabler recovery
> >tools rather than new features they may not use.
> >
> >So we'd like to have a univeral progs code for old kernels.
>
> Overall, btrfs is considered as a fast-moving and not that stable fs (at
> least not as stable as ext4/xfs).
> And users are always encourages to use latest kernel for these reason.
>
> Shouldn't we do such thing when btrfs is stable enough?
That's not true, we use a stable kernel instead, which has a stable btrfs,
it's not latest kernel but stable kernel that is more suitable for production use.
We offer btrfs support as the customers requested, I asked for this
because our customer needs btrfs-progs to be wiser on this feature selecting stuff.
Thanks,
-liubo
next prev parent reply other threads:[~2015-12-04 18:23 UTC|newest]
Thread overview: 33+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-11-23 12:56 [PATCH v2 0/5] Make btrfs-progs really compatible with any kernel version Anand Jain
2015-11-23 12:56 ` [PATCH v2 1/5] btrfs-progs: introduce framework to check kernel supported features Anand Jain
2015-11-24 14:39 ` Mike Fleetwood
2015-11-24 20:21 ` Austin S Hemmelgarn
2015-11-26 17:38 ` David Sterba
2015-11-30 12:30 ` Austin S Hemmelgarn
2015-11-25 10:58 ` [PATCH v3 " Anand Jain
2015-11-23 12:56 ` [PATCH v2 2/5] btrfs-progs: add framework to check features supported by sysfs Anand Jain
2015-11-23 12:56 ` [PATCH v2 3/5] btrfs-progs: kernel based default features for mkfs Anand Jain
2015-11-23 15:57 ` Christoph Anton Mitterer
2015-11-23 16:05 ` Austin S Hemmelgarn
2015-11-23 16:14 ` Christoph Anton Mitterer
2015-11-23 16:55 ` Austin S Hemmelgarn
2015-11-23 12:56 ` [PATCH v2 4/5] btrfs-progs: kernel based default features for btrfs-convert Anand Jain
2015-11-23 12:56 ` [PATCH 5/5] btrfs-progs: add warning when we fail to read sysfs or version Anand Jain
2015-11-23 17:56 ` [PATCH v2 0/5] Make btrfs-progs really compatible with any kernel version David Sterba
2015-11-23 20:14 ` Austin S Hemmelgarn
2015-11-24 6:29 ` Duncan
2015-11-24 13:22 ` Anand Jain
2015-12-04 1:44 ` Liu Bo
2015-12-04 2:08 ` Qu Wenruo
2015-12-04 2:53 ` Liu Bo
2015-12-04 3:57 ` Qu Wenruo
2015-12-04 18:23 ` Liu Bo [this message]
2015-12-04 14:19 ` David Sterba
2015-12-05 5:12 ` Anand Jain
2015-11-24 13:04 ` Anand Jain
2016-11-08 13:14 ` Anand Jain
2016-11-14 12:13 ` David Sterba
2016-11-22 8:54 ` Anand Jain
2016-11-22 13:16 ` David Sterba
2016-11-23 3:00 ` Anand Jain
2016-11-23 10:31 ` David Sterba
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20151204182304.GB8792@localhost.localdomain \
--to=bo.li.liu@oracle.com \
--cc=anand.jain@oracle.com \
--cc=dsterba@suse.cz \
--cc=linux-btrfs@vger.kernel.org \
--cc=quwenruo@cn.fujitsu.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).