diff mbox series

[v3,49/49] btrfs: support metadata read write for test

Message ID 20200930015539.48867-50-wqu@suse.com (mailing list archive)
State New, archived
Headers show
Series btrfs: add partial rw support for subpage sector size | expand

Commit Message

Qu Wenruo Sept. 30, 2020, 1:55 a.m. UTC
Signed-off-by: Qu Wenruo <wqu@suse.com>
---
 fs/btrfs/disk-io.c | 10 ----------
 fs/btrfs/file.c    |  4 ++++
 fs/btrfs/super.c   |  7 -------
 3 files changed, 4 insertions(+), 17 deletions(-)
diff mbox series

Patch

diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c
index 2ac980f739dc..8b5f65e6c5fa 100644
--- a/fs/btrfs/disk-io.c
+++ b/fs/btrfs/disk-io.c
@@ -3335,16 +3335,6 @@  int __cold open_ctree(struct super_block *sb, struct btrfs_fs_devices *fs_device
 		goto fail_alloc;
 	}
 
-	/* For 4K sector size support, it's only read-only yet */
-	if (PAGE_SIZE == SZ_64K && sectorsize == SZ_4K) {
-		if (!sb_rdonly(sb) || btrfs_super_log_root(disk_super)) {
-			btrfs_err(fs_info,
-				"subpage sector size only support RO yet");
-			err = -EINVAL;
-			goto fail_alloc;
-		}
-	}
-
 	ret = btrfs_init_workqueues(fs_info, fs_devices);
 	if (ret) {
 		err = ret;
diff --git a/fs/btrfs/file.c b/fs/btrfs/file.c
index 4507c3d09399..0785e16ba243 100644
--- a/fs/btrfs/file.c
+++ b/fs/btrfs/file.c
@@ -1937,6 +1937,10 @@  static ssize_t btrfs_file_write_iter(struct kiocb *iocb,
 	loff_t oldsize;
 	int clean_page = 0;
 
+	/* Don't support data write yet */
+	if (btrfs_is_subpage(fs_info))
+		return -EOPNOTSUPP;
+
 	if (!(iocb->ki_flags & IOCB_DIRECT) &&
 	    (iocb->ki_flags & IOCB_NOWAIT))
 		return -EOPNOTSUPP;
diff --git a/fs/btrfs/super.c b/fs/btrfs/super.c
index 743a2fadf4ee..25967ecaaf0a 100644
--- a/fs/btrfs/super.c
+++ b/fs/btrfs/super.c
@@ -1922,13 +1922,6 @@  static int btrfs_remount(struct super_block *sb, int *flags, char *data)
 			ret = -EINVAL;
 			goto restore;
 		}
-		if (btrfs_is_subpage(fs_info)) {
-			btrfs_warn(fs_info,
-	"read-write mount is not yet allowed for sector size %u page size %lu",
-				   fs_info->sectorsize, PAGE_SIZE);
-			ret = -EINVAL;
-			goto restore;
-		}
 
 		ret = btrfs_cleanup_fs_roots(fs_info);
 		if (ret)