Commit e829083b authored by Linus Torvalds's avatar Linus Torvalds
Browse files
Pull btrfs fixes from David Sterba:

 - fix leaked folio refcount on s390x when using hw zlib compression
   acceleration

 - remove own threshold from ->writepages() which could collide with
   cgroup limits and lead to a deadlock when metadadata are not written
   because the amount is under the internal limit

* tag 'for-6.19-rc7-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux:
  btrfs: zlib: fix the folio leak on S390 hardware acceleration
  btrfs: do not strictly require dirty metadata threshold for metadata writepages
parents 8dfce899 0d0f1314
Loading
Loading
Loading
Loading
+0 −22
Original line number Diff line number Diff line
@@ -498,28 +498,6 @@ static int btree_migrate_folio(struct address_space *mapping,
#define btree_migrate_folio NULL
#endif

static int btree_writepages(struct address_space *mapping,
			    struct writeback_control *wbc)
{
	int ret;

	if (wbc->sync_mode == WB_SYNC_NONE) {
		struct btrfs_fs_info *fs_info;

		if (wbc->for_kupdate)
			return 0;

		fs_info = inode_to_fs_info(mapping->host);
		/* this is a bit racy, but that's ok */
		ret = __percpu_counter_compare(&fs_info->dirty_metadata_bytes,
					     BTRFS_DIRTY_METADATA_THRESH,
					     fs_info->dirty_metadata_batch);
		if (ret < 0)
			return 0;
	}
	return btree_write_cache_pages(mapping, wbc);
}

static bool btree_release_folio(struct folio *folio, gfp_t gfp_flags)
{
	if (folio_test_writeback(folio) || folio_test_dirty(folio))
+1 −2
Original line number Diff line number Diff line
@@ -2286,8 +2286,7 @@ void btrfs_btree_wait_writeback_range(struct btrfs_fs_info *fs_info, u64 start,
	}
}

int btree_write_cache_pages(struct address_space *mapping,
				   struct writeback_control *wbc)
int btree_writepages(struct address_space *mapping, struct writeback_control *wbc)
{
	struct btrfs_eb_write_context ctx = { .wbc = wbc };
	struct btrfs_fs_info *fs_info = inode_to_fs_info(mapping->host);
+1 −2
Original line number Diff line number Diff line
@@ -237,8 +237,7 @@ void extent_write_locked_range(struct inode *inode, const struct folio *locked_f
			       u64 start, u64 end, struct writeback_control *wbc,
			       bool pages_dirty);
int btrfs_writepages(struct address_space *mapping, struct writeback_control *wbc);
int btree_write_cache_pages(struct address_space *mapping,
			    struct writeback_control *wbc);
int btree_writepages(struct address_space *mapping, struct writeback_control *wbc);
void btrfs_btree_wait_writeback_range(struct btrfs_fs_info *fs_info, u64 start, u64 end);
void btrfs_readahead(struct readahead_control *rac);
int set_folio_extent_mapped(struct folio *folio);
+1 −0
Original line number Diff line number Diff line
@@ -139,6 +139,7 @@ static int copy_data_into_buffer(struct address_space *mapping,
		data_in = kmap_local_folio(folio, offset);
		memcpy(workspace->buf + cur - filepos, data_in, copy_length);
		kunmap_local(data_in);
		folio_put(folio);
		cur += copy_length;
	}
	return 0;