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

2016-12-08 Thread Liu Bo
On Thu, Dec 08, 2016 at 02:35:59PM +0100, David Sterba wrote:
> On Wed, Dec 07, 2016 at 01:45:06PM -0800, Liu Bo wrote:
> > Dax on btrfs is not ready for multiple device.
> 
> How about DUP? Technically it's not multi-device but still stores
> multiple copies, so I don't know if the implementation is ok with that.

Good question.

For this patch set, meta DUP is OK while data DUP is not, the main
obstacle is that the actual copy-to-device operation happens in iomap
code (iomap_dax_actor), not inside filesystem itself, and it only takes
one  pair to copy to device.

Thanks,

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


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

2016-12-08 Thread David Sterba
On Wed, Dec 07, 2016 at 01:45:06PM -0800, Liu Bo wrote:
> Dax on btrfs is not ready for multiple device.

How about DUP? Technically it's not multi-device but still stores
multiple copies, so I don't know if the implementation is ok with that.
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


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

2016-12-07 Thread Liu Bo
Dax on btrfs is not ready for multiple device.

Signed-off-by: Liu Bo 
---
 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(>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 majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html