Skip to content

Commit e829083

Browse files
committed
Merge tag 'for-6.19-rc7-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux
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
2 parents 8dfce89 + 0d0f131 commit e829083

4 files changed

Lines changed: 3 additions & 26 deletions

File tree

fs/btrfs/disk-io.c

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -498,28 +498,6 @@ static int btree_migrate_folio(struct address_space *mapping,
498498
#define btree_migrate_folio NULL
499499
#endif
500500

501-
static int btree_writepages(struct address_space *mapping,
502-
struct writeback_control *wbc)
503-
{
504-
int ret;
505-
506-
if (wbc->sync_mode == WB_SYNC_NONE) {
507-
struct btrfs_fs_info *fs_info;
508-
509-
if (wbc->for_kupdate)
510-
return 0;
511-
512-
fs_info = inode_to_fs_info(mapping->host);
513-
/* this is a bit racy, but that's ok */
514-
ret = __percpu_counter_compare(&fs_info->dirty_metadata_bytes,
515-
BTRFS_DIRTY_METADATA_THRESH,
516-
fs_info->dirty_metadata_batch);
517-
if (ret < 0)
518-
return 0;
519-
}
520-
return btree_write_cache_pages(mapping, wbc);
521-
}
522-
523501
static bool btree_release_folio(struct folio *folio, gfp_t gfp_flags)
524502
{
525503
if (folio_test_writeback(folio) || folio_test_dirty(folio))

fs/btrfs/extent_io.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2286,8 +2286,7 @@ void btrfs_btree_wait_writeback_range(struct btrfs_fs_info *fs_info, u64 start,
22862286
}
22872287
}
22882288

2289-
int btree_write_cache_pages(struct address_space *mapping,
2290-
struct writeback_control *wbc)
2289+
int btree_writepages(struct address_space *mapping, struct writeback_control *wbc)
22912290
{
22922291
struct btrfs_eb_write_context ctx = { .wbc = wbc };
22932292
struct btrfs_fs_info *fs_info = inode_to_fs_info(mapping->host);

fs/btrfs/extent_io.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -237,8 +237,7 @@ void extent_write_locked_range(struct inode *inode, const struct folio *locked_f
237237
u64 start, u64 end, struct writeback_control *wbc,
238238
bool pages_dirty);
239239
int btrfs_writepages(struct address_space *mapping, struct writeback_control *wbc);
240-
int btree_write_cache_pages(struct address_space *mapping,
241-
struct writeback_control *wbc);
240+
int btree_writepages(struct address_space *mapping, struct writeback_control *wbc);
242241
void btrfs_btree_wait_writeback_range(struct btrfs_fs_info *fs_info, u64 start, u64 end);
243242
void btrfs_readahead(struct readahead_control *rac);
244243
int set_folio_extent_mapped(struct folio *folio);

fs/btrfs/zlib.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,7 @@ static int copy_data_into_buffer(struct address_space *mapping,
139139
data_in = kmap_local_folio(folio, offset);
140140
memcpy(workspace->buf + cur - filepos, data_in, copy_length);
141141
kunmap_local(data_in);
142+
folio_put(folio);
142143
cur += copy_length;
143144
}
144145
return 0;

0 commit comments

Comments
 (0)