linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Liu Bo <bo.li.liu@oracle.com>
To: linux-btrfs@vger.kernel.org
Cc: Chris Mason <clm@fb.com>, Jan Kara <jack@suse.cz>,
	David Sterba <dsterba@suse.cz>
Subject: [PATCH 2/6] Btrfs: set single device limit for dax usecase
Date: Wed,  7 Dec 2016 13:45:06 -0800	[thread overview]
Message-ID: <1481147110-20048-3-git-send-email-bo.li.liu@oracle.com> (raw)
In-Reply-To: <1481147110-20048-1-git-send-email-bo.li.liu@oracle.com>

Dax on btrfs is not ready for multiple device.

Signed-off-by: Liu Bo <bo.li.liu@oracle.com>
---
 fs/btrfs/ioctl.c | 6 ++++++
 fs/btrfs/super.c | 7 +++++++
 2 files changed, 13 insertions(+)

diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c
index 7acbd2c..ab30d88 100644
--- a/fs/btrfs/ioctl.c
+++ b/fs/btrfs/ioctl.c
@@ -2663,6 +2663,12 @@ static long btrfs_ioctl_add_dev(struct btrfs_root *root, void __user *arg)
 	if (!capable(CAP_SYS_ADMIN))
 		return -EPERM;
 
+	if (btrfs_test_opt(root->fs_info, DAX)) {
+		btrfs_info(root->fs_info,
+			   "dax doesn't support multiple devices\n");
+		return -EOPNOTSUPP;
+	}
+
 	if (atomic_xchg(&root->fs_info->mutually_exclusive_operation_running,
 			1)) {
 		return BTRFS_ERROR_DEV_EXCL_RUN_IN_PROGRESS;
diff --git a/fs/btrfs/super.c b/fs/btrfs/super.c
index 9b18f3d..8cb94ab 100644
--- a/fs/btrfs/super.c
+++ b/fs/btrfs/super.c
@@ -475,6 +475,13 @@ int btrfs_parse_options(struct btrfs_root *root, char *options,
 #ifdef CONFIG_FS_DAX
 		case Opt_dax:
 			btrfs_set_and_info(info, DAX, "setting dax");
+			if (btrfs_super_num_devices(info->super_copy) > 1) {
+				btrfs_info(info,
+					  "dax doesn't support multiple devices(%llu)\n",
+					   btrfs_super_num_devices(info->super_copy));
+				ret = -EOPNOTSUPP;
+				goto out;
+			}
 			/*
 			 * sb->s_blocksize is set to root->sectorsize
 			 * sb->s_bdev is required, but btrfs doesn't set it
-- 
2.5.5


  parent reply	other threads:[~2016-12-07 21:37 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-12-07 21:45 [PATCH 0/6] btrfs dax IO Liu Bo
2016-12-07 21:45 ` [PATCH 1/6] Btrfs: add mount option for dax Liu Bo
2016-12-08  2:44   ` kbuild test robot
2016-12-09  4:47   ` Dave Chinner
2016-12-09 18:41     ` Liu Bo
2016-12-09 21:58       ` Dave Chinner
2016-12-07 21:45 ` Liu Bo [this message]
2016-12-08 13:35   ` [PATCH 2/6] Btrfs: set single device limit for dax usecase David Sterba
2016-12-08 15:19     ` Liu Bo
2016-12-07 21:45 ` [PATCH 3/6] Btrfs: refactor btrfs_file_write_iter Liu Bo
2016-12-08  0:44   ` kbuild test robot
2016-12-07 21:45 ` [PATCH 4/6] Btrfs: add DAX support for nocow btrfs Liu Bo
2016-12-07 22:15   ` Chris Mason
2016-12-07 22:51     ` Liu Bo
2016-12-08 10:47     ` Jan Kara
2016-12-08 16:45       ` Liu Bo
2016-12-09 12:31         ` Jan Kara
2016-12-09 18:38           ` Liu Bo
2016-12-08  1:16   ` kbuild test robot
2016-12-08  2:19     ` Janos Toth F.
2016-12-08  2:30   ` kbuild test robot
2016-12-09  5:13   ` Dave Chinner
2016-12-09 14:23     ` Chris Mason
2016-12-07 21:45 ` [PATCH 5/6] Btrfs: add mmap_sem to avoid race between page faults and truncate/hole_punch Liu Bo
2016-12-07 21:45 ` [PATCH 6/6] Btrfs: add tracepoint for btrfs_get_blocks_dax_fault Liu Bo

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=1481147110-20048-3-git-send-email-bo.li.liu@oracle.com \
    --to=bo.li.liu@oracle.com \
    --cc=clm@fb.com \
    --cc=dsterba@suse.cz \
    --cc=jack@suse.cz \
    --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).