[PATCH 2/6] Btrfs: set single device limit for dax usecase

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Dax on btrfs is not ready for multiple device.

Signed-off-by: Liu Bo <bo.li.liu@xxxxxxxxxx>
---
 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

--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Filesystem Development]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux