Commit 9b450949 authored by Linus Torvalds's avatar Linus Torvalds
Browse files
Pull btrfs fixes from David Sterba:
 "A few more fixes to zoned mode and one regression fix for chunk limit:

    - Zoned mode fixes:
        - fix how wait/wake up is done when finishing zone
        - fix zone append limit in emulated mode
        - fix mount on devices with conventional zones

   - fix regression, user settable data chunk limit got accidentally
     lowered and causes allocation problems on some profiles (raid0,
     raid1)"

* tag 'for-6.0-rc4-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux:
  btrfs: fix the max chunk size and stripe length calculation
  btrfs: zoned: fix mounting with conventional zones
  btrfs: zoned: set pseudo max append zone limit in zone emulation mode
  btrfs: zoned: fix API misuse of zone finish waiting
parents 725f3f3b 5da431b7
Loading
Loading
Loading
Loading
+0 −2
Original line number Diff line number Diff line
@@ -1088,8 +1088,6 @@ struct btrfs_fs_info {

	spinlock_t zone_active_bgs_lock;
	struct list_head zone_active_bgs;
	/* Waiters when BTRFS_FS_NEED_ZONE_FINISH is set */
	wait_queue_head_t zone_finish_wait;

	/* Updates are not protected by any lock */
	struct btrfs_commit_stats commit_stats;
+0 −1
Original line number Diff line number Diff line
@@ -3068,7 +3068,6 @@ void btrfs_init_fs_info(struct btrfs_fs_info *fs_info)
	init_waitqueue_head(&fs_info->transaction_blocked_wait);
	init_waitqueue_head(&fs_info->async_submit_wait);
	init_waitqueue_head(&fs_info->delayed_iputs_wait);
	init_waitqueue_head(&fs_info->zone_finish_wait);

	/* Usable values until the real ones are cached from the superblock */
	fs_info->nodesize = 4096;
+3 −4
Original line number Diff line number Diff line
@@ -1644,10 +1644,9 @@ static noinline int run_delalloc_zoned(struct btrfs_inode *inode,
			done_offset = end;

		if (done_offset == start) {
			struct btrfs_fs_info *info = inode->root->fs_info;

			wait_var_event(&info->zone_finish_wait,
				       !test_bit(BTRFS_FS_NEED_ZONE_FINISH, &info->flags));
			wait_on_bit_io(&inode->root->fs_info->flags,
				       BTRFS_FS_NEED_ZONE_FINISH,
				       TASK_UNINTERRUPTIBLE);
			continue;
		}

+1 −1
Original line number Diff line number Diff line
@@ -199,7 +199,7 @@ static u64 calc_chunk_size(const struct btrfs_fs_info *fs_info, u64 flags)
	ASSERT(flags & BTRFS_BLOCK_GROUP_TYPE_MASK);

	if (flags & BTRFS_BLOCK_GROUP_DATA)
		return SZ_1G;
		return BTRFS_MAX_DATA_CHUNK_SIZE;
	else if (flags & BTRFS_BLOCK_GROUP_SYSTEM)
		return SZ_32M;

+3 −0
Original line number Diff line number Diff line
@@ -5267,6 +5267,9 @@ static int decide_stripe_size_regular(struct alloc_chunk_ctl *ctl,
				       ctl->stripe_size);
	}

	/* Stripe size should not go beyond 1G. */
	ctl->stripe_size = min_t(u64, ctl->stripe_size, SZ_1G);

	/* Align to BTRFS_STRIPE_LEN */
	ctl->stripe_size = round_down(ctl->stripe_size, BTRFS_STRIPE_LEN);
	ctl->chunk_size = ctl->stripe_size * data_stripes;
Loading