Skip to content

Commit c92b4d3

Browse files
committed
Merge tag 'for-7.1-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux
Pull btrfs updates from David Sterba: "User visible changes: - move shutdown ioctl support out of experimental features, a forced stop of filesystem operation until the next unmount; additionally there's a super block operation to forcibly remove a device from under the filesystem that could lead to a shutdown or not if the redundancy allows that - report filesystem shutdown using fserror mechanism - tree-checker updates: - verify free space info, extent and bitmap items - verify remap-tree items and related data in block group items Performance improvements: - speed up clearing first extent in the tracked range (+10% throughput on sample workload) - reduce COW rewrites of extent buffers during the same transaction - avoid taking big device lock to update device stats during transaction commit - fix unnecessary flush on close when truncating empty files (observed in practice on a backup application) - prevent direct reclaim during compressed readahead to avoid stalls under memory pressure Notable fixes: - fix chunk allocation strategy on RAID1-like block groups with disproportionate device sizes, this could lead to ENOSPC due to skewed reservation estimates - adjust metadata reservation overcommit ratio to be less aggressive and also try to flush if possible, this avoids ENOSPC and potential transaction aborts in some edge cases (that are otherwise hard to reproduce) - fix silent IO error in encoded writes and ordered extent split in zoned mode, the error was not correctly propagated to the address space and could lead to zeroed ranges - don't mark inline files NOCOMPRESS unexpectedly, the intent was to do that for single block writes of regular files - fix deadlock between reflink and transaction commit when using flushoncommit - fix overly strict item check of a running dev-replace operation Core: - zoned mode space reservation fixes: - cap delayed refs metadata reservation to avoid overcommit - update logic to reclaim partially unusable zones - add another state to flush and reclaim partially used zone - limit number of zones reclaimed in one go to avoid blocking other operations - don't let log trees consume global reserve on overcommit and fall back to transaction commit - revalidate extent buffer when checking its up-to-date status - add self tests for zoned mode block group specifics - reduce atomic allocations in some qgroup paths - avoid unnecessary root node COW during snapshotting - start new transaction in block group relocation conditionally - faster check of NOCOW files on currently snapshotted root - change how compressed bio size is tracked from bio and reduce the structure size - new tracepoint for search slot restart tracking - checksum list manipulation improvements - type, parameter cleanups, refactoring - error handling improvements, transaction abort call adjustments" * tag 'for-7.1-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux: (116 commits) btrfs: btrfs_log_dev_io_error() on all bio errors btrfs: fix silent IO error loss in encoded writes and zoned split btrfs: skip clearing EXTENT_DEFRAG for NOCOW ordered extents btrfs: use BTRFS_FS_UPDATE_UUID_TREE_GEN flag for UUID tree rescan check btrfs: remove duplicate journal_info reset on failure to commit transaction btrfs: tag as unlikely if statements that check for fs in error state btrfs: fix double free in create_space_info() error path btrfs: fix double free in create_space_info_sub_group() error path btrfs: do not reject a valid running dev-replace btrfs: only invalidate btree inode pages after all ebs are released btrfs: prevent direct reclaim during compressed readahead btrfs: replace BUG_ON() with error return in cache_save_setup() btrfs: zstd: don't cache sectorsize in a local variable btrfs: zlib: don't cache sectorsize in a local variable btrfs: zlib: drop redundant folio address variable btrfs: lzo: inline read/write length helpers btrfs: use common eb range validation in read_extent_buffer_to_user_nofault() btrfs: read eb folio index right before loops btrfs: rename local variable for offset in folio btrfs: unify types for binary search variables ...
2 parents 23acda7 + fc3d532 commit c92b4d3

63 files changed

Lines changed: 2558 additions & 1078 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

fs/btrfs/Kconfig

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,8 +112,6 @@ config BTRFS_EXPERIMENTAL
112112

113113
- large folio and block size (> page size) support
114114

115-
- shutdown ioctl and auto-degradation support
116-
117115
- asynchronous checksum generation for data writes
118116

119117
- remap-tree - logical address remapping tree

fs/btrfs/Makefile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,3 +45,7 @@ btrfs-$(CONFIG_BTRFS_FS_RUN_SANITY_TESTS) += tests/free-space-tests.o \
4545
tests/free-space-tree-tests.o tests/extent-map-tests.o \
4646
tests/raid-stripe-tree-tests.o tests/delayed-refs-tests.o \
4747
tests/chunk-allocation-tests.o
48+
49+
ifeq ($(CONFIG_BLK_DEV_ZONED),y)
50+
btrfs-$(CONFIG_BTRFS_FS_RUN_SANITY_TESTS) += tests/zoned-tests.o
51+
endif

fs/btrfs/backref.c

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -858,11 +858,6 @@ static int add_missing_keys(struct btrfs_fs_info *fs_info,
858858
free_pref(ref);
859859
return PTR_ERR(eb);
860860
}
861-
if (unlikely(!extent_buffer_uptodate(eb))) {
862-
free_pref(ref);
863-
free_extent_buffer(eb);
864-
return -EIO;
865-
}
866861

867862
if (lock)
868863
btrfs_tree_read_lock(eb);
@@ -1620,11 +1615,6 @@ static int find_parent_nodes(struct btrfs_backref_walk_ctx *ctx,
16201615
ret = PTR_ERR(eb);
16211616
goto out;
16221617
}
1623-
if (unlikely(!extent_buffer_uptodate(eb))) {
1624-
free_extent_buffer(eb);
1625-
ret = -EIO;
1626-
goto out;
1627-
}
16281618

16291619
if (!path->skip_locking)
16301620
btrfs_tree_read_lock(eb);

fs/btrfs/bio.c

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
* Copyright (C) 2022 Christoph Hellwig.
55
*/
66

7+
#include <linux/blk_types.h>
78
#include <linux/bio.h>
89
#include "bio.h"
910
#include "ctree.h"
@@ -350,11 +351,18 @@ static void btrfs_check_read_bio(struct btrfs_bio *bbio, struct btrfs_device *de
350351

351352
static void btrfs_log_dev_io_error(const struct bio *bio, struct btrfs_device *dev)
352353
{
354+
blk_status_t sts = bio->bi_status;
355+
353356
if (!dev || !dev->bdev)
354357
return;
355-
if (bio->bi_status != BLK_STS_IOERR && bio->bi_status != BLK_STS_TARGET)
358+
if (unlikely(sts == BLK_STS_OK))
356359
return;
357-
360+
if (unlikely(sts != BLK_STS_IOERR && sts != BLK_STS_TARGET &&
361+
sts != BLK_STS_MEDIUM && sts != BLK_STS_PROTECTION)) {
362+
btrfs_warn_rl(dev->fs_info, "bdev %s unexpected block io error: %d",
363+
btrfs_dev_name(dev), sts);
364+
return;
365+
}
358366
if (btrfs_op(bio) == BTRFS_MAP_WRITE)
359367
btrfs_dev_stat_inc_and_print(dev, BTRFS_DEV_STAT_WRITE_ERRS);
360368
else if (!(bio->bi_opf & REQ_RAHEAD))

0 commit comments

Comments
 (0)