linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Anand Jain <anand.jain@oracle.com>
To: linux-btrfs@vger.kernel.org
Subject: [RFC PATCH 2/3] btrfs-progs: kernel based default features for mkfs
Date: Wed, 21 Oct 2015 16:45:48 +0800	[thread overview]
Message-ID: <1445417149-804-2-git-send-email-anand.jain@oracle.com> (raw)
In-Reply-To: <1445417149-804-1-git-send-email-anand.jain@oracle.com>

mkfs from latest btrfs-progs will enable latest default features,
and if the kernel is down-rev and does not support a latest default
feature then mount fails, as expected.

This patch disables default features based on the running kernel.

Signed-off-by: Anand Jain <anand.jain@oracle.com>
---
 mkfs.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/mkfs.c b/mkfs.c
index a5802f7..2b9d734 100644
--- a/mkfs.c
+++ b/mkfs.c
@@ -1357,10 +1357,13 @@ int main(int ac, char **av)
 	int dev_cnt = 0;
 	int saved_optind;
 	char fs_uuid[BTRFS_UUID_UNPARSED_SIZE] = { 0 };
-	u64 features = BTRFS_MKFS_DEFAULT_FEATURES;
+	u64 features;
 	struct mkfs_allocation allocation = { 0 };
 	struct btrfs_mkfs_config mkfs_cfg;
 
+	features = btrfs_features_allowed_by_kernel();
+	features &= BTRFS_MKFS_DEFAULT_FEATURES;
+
 	while(1) {
 		int c;
 		static const struct option long_options[] = {
-- 
2.4.1


  reply	other threads:[~2015-10-21  8:47 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-21  8:45 [RFC PATCH 1/3] btrfs-progs: introduce framework to check kernel supported features Anand Jain
2015-10-21  8:45 ` Anand Jain [this message]
2015-10-21  9:12   ` [RFC PATCH 2/3] btrfs-progs: kernel based default features for mkfs Qu Wenruo
2015-10-21 14:15     ` Anand Jain
2015-10-21 14:25       ` Qu Wenruo
2015-10-22  3:09     ` Anand Jain
2015-10-22  4:10       ` Qu Wenruo
2015-10-23 15:24   ` Jeff Mahoney
2015-10-26 11:42     ` Anand Jain
2015-10-21  8:45 ` [RFC PATCH 3/3] btrfs-progs: kernel based default features for btrfs-convert Anand Jain
2015-10-21  9:12   ` Qu Wenruo
2015-10-21  9:09 ` [RFC PATCH 1/3] btrfs-progs: introduce framework to check kernel supported features Qu Wenruo
2015-10-21 14:41   ` Eric Sandeen
2015-10-21 14:49     ` Anand Jain
2015-10-21 15:12       ` Eric Sandeen

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=1445417149-804-2-git-send-email-anand.jain@oracle.com \
    --to=anand.jain@oracle.com \
    --cc=linux-btrfs@vger.kernel.org \
    /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).