]> git.baikalelectronics.ru Git - kernel.git/commitdiff
btrfs: raid56: enable subpage support for RAID56
authorQu Wenruo <wqu@suse.com>
Fri, 1 Apr 2022 11:23:31 +0000 (19:23 +0800)
committerDavid Sterba <dsterba@suse.com>
Mon, 16 May 2022 15:03:15 +0000 (17:03 +0200)
Now the btrfs RAID56 infrastructure has migrated to use sector_ptr
interface, it should be safe to enable subpage support for RAID56.

Signed-off-by: Qu Wenruo <wqu@suse.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/disk-io.c
fs/btrfs/raid56.c
fs/btrfs/volumes.c

index 647e93691b3644c569917fbb6331c07509753d2f..d70289ef581a2e900451d102903cb2db274c3f78 100644 (file)
@@ -3686,14 +3686,6 @@ int __cold open_ctree(struct super_block *sb, struct btrfs_fs_devices *fs_device
                btrfs_warn(fs_info,
                "read-write for sector size %u with page size %lu is experimental",
                           sectorsize, PAGE_SIZE);
-               if (btrfs_super_incompat_flags(fs_info->super_copy) &
-                       BTRFS_FEATURE_INCOMPAT_RAID56) {
-                       btrfs_err(fs_info,
-               "RAID56 is not yet supported for sector size %u with page size %lu",
-                               sectorsize, PAGE_SIZE);
-                       err = -EINVAL;
-                       goto fail_alloc;
-               }
                subpage_info = kzalloc(sizeof(*subpage_info), GFP_KERNEL);
                if (!subpage_info)
                        goto fail_alloc;
index b30ec77c17242c217328fc17d9e0c14478ee9bb6..31f16f86081b97c707561f9eb23e588628d13f4d 100644 (file)
@@ -1154,9 +1154,6 @@ static int rbio_add_io_sector(struct btrfs_raid_bio *rbio,
        ASSERT(sector_nr >= 0 && sector_nr < rbio->stripe_nsectors);
        ASSERT(sector->page);
 
-       /* We don't yet support subpage, thus pgoff should always be 0 */
-       ASSERT(sector->pgoff == 0);
-
        stripe = &rbio->bioc->stripes[stripe_nr];
        disk_start = stripe->physical + sector_nr * sectorsize;
 
@@ -2378,9 +2375,6 @@ struct btrfs_raid_bio *raid56_parity_alloc_scrub_rbio(struct bio *bio,
        }
        ASSERT(i < rbio->real_stripes);
 
-       /* Now we just support the sectorsize equals to page size */
-       ASSERT(fs_info->sectorsize == PAGE_SIZE);
-       ASSERT(rbio->stripe_npages == stripe_nsectors);
        bitmap_copy(rbio->dbitmap, dbitmap, stripe_nsectors);
 
        /*
index ba1e7f1b9a7236e196d56917b760c63182581d25..869acf5928af49500a4be281e1d95594a79a4e74 100644 (file)
@@ -4063,13 +4063,6 @@ static inline int validate_convert_profile(struct btrfs_fs_info *fs_info,
        if (!(bargs->flags & BTRFS_BALANCE_ARGS_CONVERT))
                return true;
 
-       if (fs_info->sectorsize < PAGE_SIZE &&
-               bargs->target & BTRFS_BLOCK_GROUP_RAID56_MASK) {
-               btrfs_err(fs_info,
-               "RAID56 is not yet supported for sectorsize %u with page size %lu",
-                         fs_info->sectorsize, PAGE_SIZE);
-               return false;
-       }
        /* Profile is valid and does not have bits outside of the allowed set */
        if (alloc_profile_is_valid(bargs->target, 1) &&
            (bargs->target & ~allowed) == 0)