On 2015-11-24 09:39, Mike Fleetwood wrote:
On 23 November 2015 at 12:56, Anand Jain <[email protected]> wrote:In the newer kernel, supported kernel features can be known from /sys/fs/btrfs/features however this interface was introduced only after 3.14, and most the incompatible FS features were introduce before 3.14.This patch proposes to maintain kernel version against the feature list, and so that will be the minimum kernel version needed to use the feature. Further, for features supported later than 3.14 this list can still be updated, so it serves as a repository which can be displayed for easy reference. Signed-off-by: Anand Jain <[email protected]> --- v2: Check for condition that what happens when we fail to read kernel version. Now the code will fail back to use the default as set by the progs. utils.c | 80 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++----- utils.h | 1 + 2 files changed, 76 insertions(+), 5 deletions(-) diff --git a/utils.c b/utils.c index b754686..24042e5 100644 --- a/utils.c +++ b/utils.c @@ -32,10 +32,12 @@ #include <linux/loop.h> #include <linux/major.h> #include <linux/kdev_t.h> +#include <linux/version.h> #include <limits.h> #include <blkid/blkid.h> #include <sys/vfs.h> #include <sys/statfs.h> +#include <sys/utsname.h> #include <linux/magic.h> #include "kerncompat.h" @@ -567,21 +569,28 @@ out: return ret; } +/* + * min_ker_ver: update with minimum kernel version at which the feature + * was integrated into the mainline. For the transit period, that is + * feature not yet in mainline but in mailing list and for testing, + * please use "0.0" to indicate the same. + */ static const struct btrfs_fs_feature { const char *name; u64 flag; const char *desc; + const char *min_ker_ver; } mkfs_features[] = { { "mixed-bg", BTRFS_FEATURE_INCOMPAT_MIXED_GROUPS, - "mixed data and metadata block groups" }, + "mixed data and metadata block groups", "2.7.31"},I think you mean 2.6.37 here. 67377734fd24c3 "Btrfs: add support for mixed data+metadata block groups"
This brings up a rather important question:Should compat-X.Y mean features that were considered usable in that version, or everything that version offered? I understand wanting consistency with the kernel versions, but we shouldn't be creating filesystems that we know will break on the specified kernel even if it is mountable on it.
smime.p7s
Description: S/MIME Cryptographic Signature
