Skip to content

Commit fd71def

Browse files
committed
Merge tag 'for-6.15-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux
Pull btrfs updates from David Sterba: "User visible changes: - fall back to buffered write if direct io is done on a file that requires checksums - this avoids a problem with checksum mismatch errors, observed e.g. on virtual images when writes to pages under writeback cause the checksum mismatch reports - this may lead to some performance degradation but currently the recommended setup for VM images is to use the NOCOW file attribute that also disables checksums - fast/realtime zstd levels -15 to -1 - supported by mount options (compress=zstd:-5) and defrag ioctl - improved speed, reduced compression ratio, check the commit for sample measurements - defrag ioctl extended to accept negative compression levels - subpage mode - remove warning when subpage mode is used, the feature is now reasonably complete and tested - in debug mode allow to create 2K b-tree nodes to allow testing subpage on x86_64 with 4K pages too Performance improvements: - in send, better file path caching improves runtime (on sample load by -30%) - on s390x with hardware zlib support prepare the input buffer in a better way to get the best results from the acceleration - minor speed improvement in encoded read, avoid memory allocation in synchronous mode Core: - enable stable writes on inodes, replacing manually waiting for writeback and allowing to skip that on inodes without checksums - add last checks and warnings for out-of-band dirty writes to pages, requiring a fixup ("fixup worker"), this should not be necessary since 5.8 where get_user_page() and pin_user_pages*() prevent this - long history behind that, we'll be happy to remove the whole infrastructure in the near future - more folio API conversions and preparations for large folio support - subpage cleanups and refactoring, split handling of data and metadata to allow future support for large folios - readpage works as block-by-block, no change for normal mode, this is preparation for future subpage updates - block group refcount fixes and hardening - delayed iput fixes - in zoned mode, fix zone activation on filesystem with missing devices Cleanups: - inode parameter cleanups - path auto-freeing updates - code flow simplifications in send - redundant parameter cleanups" * tag 'for-6.15-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux: (164 commits) btrfs: zoned: fix zone finishing with missing devices btrfs: zoned: fix zone activation with missing devices btrfs: remove end_no_trans label from btrfs_log_inode_parent() btrfs: simplify condition for logging new dentries at btrfs_log_inode_parent() btrfs: remove redundant else statement from btrfs_log_inode_parent() btrfs: use memcmp_extent_buffer() at replay_one_extent() btrfs: update outdated comment for overwrite_item() btrfs: use variables to store extent buffer and slot at overwrite_item() btrfs: avoid unnecessary memory allocation and copy at overwrite_item() btrfs: don't clobber ret in btrfs_validate_super() btrfs: prepare btrfs_page_mkwrite() for large folios btrfs: prepare extent_io.c for future large folio support btrfs: prepare btrfs_launcher_folio() for large folios support btrfs: replace PAGE_SIZE with folio_size for subpage.[ch] btrfs: add a size parameter to btrfs_alloc_subpage() btrfs: subpage: make btrfs_is_subpage() check against a folio btrfs: add extra warning if delayed iput is added when it's not allowed btrfs: avoid redundant path slot assignment in btrfs_search_forward() btrfs: remove unnecessary btrfs_key local variable in btrfs_search_forward() btrfs: simplify the return value handling in search_ioctl() ...
2 parents b2e7b0f + 35fec10 commit fd71def

Some content is hidden

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

74 files changed

+2264
-1915
lines changed

fs/btrfs/accessors.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
#include <linux/string.h>
1313
#include <linux/mm.h>
1414
#include <uapi/linux/btrfs_tree.h>
15+
#include "extent_io.h"
1516

1617
struct extent_buffer;
1718

fs/btrfs/acl.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
#ifndef BTRFS_ACL_H
44
#define BTRFS_ACL_H
55

6+
#include <linux/types.h>
7+
68
struct posix_acl;
79
struct inode;
810
struct btrfs_trans_handle;

fs/btrfs/async-thread.c

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ static inline void thresh_exec_hook(struct btrfs_workqueue *wq)
168168
{
169169
int new_current_active;
170170
long pending;
171-
int need_change = 0;
171+
bool need_change = false;
172172

173173
if (wq->thresh == NO_THRESHOLD)
174174
return;
@@ -196,15 +196,14 @@ static inline void thresh_exec_hook(struct btrfs_workqueue *wq)
196196
new_current_active--;
197197
new_current_active = clamp_val(new_current_active, 1, wq->limit_active);
198198
if (new_current_active != wq->current_active) {
199-
need_change = 1;
199+
need_change = true;
200200
wq->current_active = new_current_active;
201201
}
202202
out:
203203
spin_unlock(&wq->thres_lock);
204204

205-
if (need_change) {
205+
if (need_change)
206206
workqueue_set_max_active(wq->normal_wq, wq->current_active);
207-
}
208207
}
209208

210209
static void run_ordered_work(struct btrfs_workqueue *wq,
@@ -296,7 +295,7 @@ static void btrfs_work_helper(struct work_struct *normal_work)
296295
struct btrfs_work *work = container_of(normal_work, struct btrfs_work,
297296
normal_work);
298297
struct btrfs_workqueue *wq = work->wq;
299-
int need_order = 0;
298+
bool need_order = false;
300299

301300
/*
302301
* We should not touch things inside work in the following cases:
@@ -307,7 +306,7 @@ static void btrfs_work_helper(struct work_struct *normal_work)
307306
* So we save the needed things here.
308307
*/
309308
if (work->ordered_func)
310-
need_order = 1;
309+
need_order = true;
311310

312311
trace_btrfs_work_sched(work);
313312
thresh_exec_hook(wq);

fs/btrfs/backref.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1399,11 +1399,11 @@ static int find_parent_nodes(struct btrfs_backref_walk_ctx *ctx,
13991399
ASSERT(ctx->roots == NULL);
14001400

14011401
key.objectid = ctx->bytenr;
1402-
key.offset = (u64)-1;
14031402
if (btrfs_fs_incompat(ctx->fs_info, SKINNY_METADATA))
14041403
key.type = BTRFS_METADATA_ITEM_KEY;
14051404
else
14061405
key.type = BTRFS_EXTENT_ITEM_KEY;
1406+
key.offset = (u64)-1;
14071407

14081408
path = btrfs_alloc_path();
14091409
if (!path)
@@ -2206,11 +2206,11 @@ int extent_from_logical(struct btrfs_fs_info *fs_info, u64 logical,
22062206
struct btrfs_extent_item *ei;
22072207
struct btrfs_key key;
22082208

2209+
key.objectid = logical;
22092210
if (btrfs_fs_incompat(fs_info, SKINNY_METADATA))
22102211
key.type = BTRFS_METADATA_ITEM_KEY;
22112212
else
22122213
key.type = BTRFS_EXTENT_ITEM_KEY;
2213-
key.objectid = logical;
22142214
key.offset = (u64)-1;
22152215

22162216
ret = btrfs_search_slot(NULL, extent_root, &key, path, 0, 0);

fs/btrfs/bio.c

Lines changed: 15 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -97,33 +97,17 @@ static struct btrfs_bio *btrfs_split_bio(struct btrfs_fs_info *fs_info,
9797
return bbio;
9898
}
9999

100-
/* Free a bio that was never submitted to the underlying device. */
101-
static void btrfs_cleanup_bio(struct btrfs_bio *bbio)
102-
{
103-
if (bbio_has_ordered_extent(bbio))
104-
btrfs_put_ordered_extent(bbio->ordered);
105-
bio_put(&bbio->bio);
106-
}
107-
108-
static void __btrfs_bio_end_io(struct btrfs_bio *bbio)
109-
{
110-
if (bbio_has_ordered_extent(bbio)) {
111-
struct btrfs_ordered_extent *ordered = bbio->ordered;
112-
113-
bbio->end_io(bbio);
114-
btrfs_put_ordered_extent(ordered);
115-
} else {
116-
bbio->end_io(bbio);
117-
}
118-
}
119-
120100
void btrfs_bio_end_io(struct btrfs_bio *bbio, blk_status_t status)
121101
{
122102
bbio->bio.bi_status = status;
123103
if (bbio->bio.bi_pool == &btrfs_clone_bioset) {
124104
struct btrfs_bio *orig_bbio = bbio->private;
125105

126-
btrfs_cleanup_bio(bbio);
106+
/* Free bio that was never submitted to the underlying device. */
107+
if (bbio_has_ordered_extent(bbio))
108+
btrfs_put_ordered_extent(bbio->ordered);
109+
bio_put(&bbio->bio);
110+
127111
bbio = orig_bbio;
128112
}
129113

@@ -138,7 +122,15 @@ void btrfs_bio_end_io(struct btrfs_bio *bbio, blk_status_t status)
138122
/* Load split bio's error which might be set above. */
139123
if (status == BLK_STS_OK)
140124
bbio->bio.bi_status = READ_ONCE(bbio->status);
141-
__btrfs_bio_end_io(bbio);
125+
126+
if (bbio_has_ordered_extent(bbio)) {
127+
struct btrfs_ordered_extent *ordered = bbio->ordered;
128+
129+
bbio->end_io(bbio);
130+
btrfs_put_ordered_extent(ordered);
131+
} else {
132+
bbio->end_io(bbio);
133+
}
142134
}
143135
}
144136

@@ -581,7 +573,7 @@ static void run_one_async_done(struct btrfs_work *work, bool do_free)
581573

582574
/* If an error occurred we just want to clean up the bio and move on. */
583575
if (bio->bi_status) {
584-
btrfs_bio_end_io(async->bbio, async->bbio->bio.bi_status);
576+
btrfs_bio_end_io(async->bbio, bio->bi_status);
585577
return;
586578
}
587579

0 commit comments

Comments
 (0)