]> Git Repo - J-linux.git/commitdiff
btrfs: scrub: allow scrub to work with subpage sectorsize
authorQu Wenruo <[email protected]>
Wed, 2 Dec 2020 06:48:11 +0000 (14:48 +0800)
committerDavid Sterba <[email protected]>
Wed, 9 Dec 2020 18:16:11 +0000 (19:16 +0100)
Since btrfs scrub is utilizing its own infrastructure to submit
read/write, scrub is independent from all other routines.

This brings one very neat feature, allow us to read 4K data into offset
0 of a 64K page.  So is the writeback routine.

This makes scrub on subpage sector size much easier to implement, and
thanks to previous commits which just changed the implementation to
always do scrub based on sector size, now scrub can handle subpage
filesystem without any problem.

This patch will just remove the restriction on
(sectorsize != PAGE_SIZE), to make scrub finally work on subpage
filesystems.

Signed-off-by: Qu Wenruo <[email protected]>
Reviewed-by: David Sterba <[email protected]>
Signed-off-by: David Sterba <[email protected]>
fs/btrfs/scrub.c

index 00429e4e64f4d1638947d7c381c5401b6ca658ea..5f4f88a4d2c8a23f7ca801cde803b98c7a18ba5b 100644 (file)
@@ -3885,14 +3885,6 @@ int btrfs_scrub_dev(struct btrfs_fs_info *fs_info, u64 devid, u64 start,
                return -EINVAL;
        }
 
-       if (fs_info->sectorsize != PAGE_SIZE) {
-               /* not supported for data w/o checksums */
-               btrfs_err_rl(fs_info,
-                          "scrub: size assumption sectorsize != PAGE_SIZE (%d != %lu) fails",
-                      fs_info->sectorsize, PAGE_SIZE);
-               return -EINVAL;
-       }
-
        if (fs_info->nodesize >
            PAGE_SIZE * SCRUB_MAX_PAGES_PER_BLOCK ||
            fs_info->sectorsize > PAGE_SIZE * SCRUB_MAX_PAGES_PER_BLOCK) {
This page took 0.075341 seconds and 4 git commands to generate.