Skip to content

Commit 55ba0fe

Browse files
committed
Merge tag 'for-5.13-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux
Pull btrfs updates from David Sterba: "The updates this time are mostly stabilization, preparation and minor improvements. User visible improvements: - readahead for send, improving run time of full send by 10% and for incremental by 25% - make reflinks respect O_SYNC, O_DSYNC and S_SYNC flags - export supported sectorsize values in sysfs (currently only page size, more once full subpage support lands) - more graceful errors and warnings on 32bit systems when logical addresses for metadata reach the limit posed by unsigned long in page::index - error: fail mount if there's a metadata block beyond the limit - error: new metadata block would be at unreachable address - warn when 5/8th of the limit is reached, for 4K page systems it's 10T, for 64K page it's 160T - zoned mode - relocated zones get reset at the end instead of discard - automatic background reclaim of zones that have 75%+ of unusable space, the threshold is tunable in sysfs Fixes: - fsync and tree mod log fixes - fix inefficient preemptive reclaim calculations - fix exhaustion of the system chunk array due to concurrent allocations - fix fallback to no compression when racing with remount - preemptive fix for dm-crypt on zoned device that does not properly advertise zoned support Core changes: - add inode lock to synchronize mmap and other block updates (eg. deduplication, fallocate, fsync) - kmap conversions to new kmap_local API - subpage support (continued) - new helpers for page state/extent buffer tracking - metadata changes now support read and write - error handling through out relocation call paths - many other cleanups and code simplifications" * tag 'for-5.13-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux: (112 commits) btrfs: zoned: automatically reclaim zones btrfs: rename delete_unused_bgs_mutex to reclaim_bgs_lock btrfs: zoned: reset zones of relocated block groups btrfs: more graceful errors/warnings on 32bit systems when reaching limits btrfs: zoned: fix unpaired block group unfreeze during device replace btrfs: fix race when picking most recent mod log operation for an old root btrfs: fix metadata extent leak after failure to create subvolume btrfs: handle remount to no compress during compression btrfs: zoned: fail mount if the device does not support zone append btrfs: fix race between transaction aborts and fsyncs leading to use-after-free btrfs: introduce submit_eb_subpage() to submit a subpage metadata page btrfs: make lock_extent_buffer_for_io() to be subpage compatible btrfs: introduce write_one_subpage_eb() function btrfs: introduce end_bio_subpage_eb_writepage() function btrfs: check return value of btrfs_commit_transaction in relocation btrfs: do proper error handling in merge_reloc_roots btrfs: handle extent corruption with select_one_root properly btrfs: cleanup error handling in prepare_to_merge btrfs: do not panic in __add_reloc_root btrfs: handle __add_reloc_root failures in btrfs_recover_relocation ...
2 parents 2a19866 + 18bb8bb commit 55ba0fe

46 files changed

Lines changed: 2964 additions & 1582 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/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ btrfs-y += super.o ctree.o extent-tree.o print-tree.o root-tree.o dir-item.o \
3030
reada.o backref.o ulist.o qgroup.o send.o dev-replace.o raid56.o \
3131
uuid-tree.o props.o free-space-tree.o tree-checker.o space-info.o \
3232
block-rsv.o delalloc-space.o block-group.o discard.o reflink.o \
33-
subpage.o
33+
subpage.o tree-mod-log.o
3434

3535
btrfs-$(CONFIG_BTRFS_FS_POSIX_ACL) += acl.o
3636
btrfs-$(CONFIG_BTRFS_FS_CHECK_INTEGRITY) += check-integrity.o

fs/btrfs/backref.c

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
#include "delayed-ref.h"
1515
#include "locking.h"
1616
#include "misc.h"
17+
#include "tree-mod-log.h"
1718

1819
/* Just an arbitrary number so we can be sure this happened */
1920
#define BACKREF_FOUND_SHARED 6
@@ -452,7 +453,7 @@ static int add_all_parents(struct btrfs_root *root, struct btrfs_path *path,
452453
if (path->slots[0] >= btrfs_header_nritems(eb) ||
453454
is_shared_data_backref(preftrees, eb->start) ||
454455
ref->root_id != btrfs_header_owner(eb)) {
455-
if (time_seq == SEQ_LAST)
456+
if (time_seq == BTRFS_SEQ_LAST)
456457
ret = btrfs_next_leaf(root, path);
457458
else
458459
ret = btrfs_next_old_leaf(root, path, time_seq);
@@ -476,7 +477,7 @@ static int add_all_parents(struct btrfs_root *root, struct btrfs_path *path,
476477
if (slot == 0 &&
477478
(is_shared_data_backref(preftrees, eb->start) ||
478479
ref->root_id != btrfs_header_owner(eb))) {
479-
if (time_seq == SEQ_LAST)
480+
if (time_seq == BTRFS_SEQ_LAST)
480481
ret = btrfs_next_leaf(root, path);
481482
else
482483
ret = btrfs_next_old_leaf(root, path, time_seq);
@@ -514,7 +515,7 @@ static int add_all_parents(struct btrfs_root *root, struct btrfs_path *path,
514515
eie = NULL;
515516
}
516517
next:
517-
if (time_seq == SEQ_LAST)
518+
if (time_seq == BTRFS_SEQ_LAST)
518519
ret = btrfs_next_item(root, path);
519520
else
520521
ret = btrfs_next_old_item(root, path, time_seq);
@@ -574,7 +575,7 @@ static int resolve_indirect_ref(struct btrfs_fs_info *fs_info,
574575

575576
if (path->search_commit_root)
576577
root_level = btrfs_header_level(root->commit_root);
577-
else if (time_seq == SEQ_LAST)
578+
else if (time_seq == BTRFS_SEQ_LAST)
578579
root_level = btrfs_header_level(root->node);
579580
else
580581
root_level = btrfs_old_root_level(root, time_seq);
@@ -605,7 +606,7 @@ static int resolve_indirect_ref(struct btrfs_fs_info *fs_info,
605606
search_key.offset >= LLONG_MAX)
606607
search_key.offset = 0;
607608
path->lowest_level = level;
608-
if (time_seq == SEQ_LAST)
609+
if (time_seq == BTRFS_SEQ_LAST)
609610
ret = btrfs_search_slot(NULL, root, &search_key, path, 0, 0);
610611
else
611612
ret = btrfs_search_old_slot(root, &search_key, path, time_seq);
@@ -1147,8 +1148,8 @@ static int add_keyed_refs(struct btrfs_fs_info *fs_info,
11471148
* indirect refs to their parent bytenr.
11481149
* When roots are found, they're added to the roots list
11491150
*
1150-
* If time_seq is set to SEQ_LAST, it will not search delayed_refs, and behave
1151-
* much like trans == NULL case, the difference only lies in it will not
1151+
* If time_seq is set to BTRFS_SEQ_LAST, it will not search delayed_refs, and
1152+
* behave much like trans == NULL case, the difference only lies in it will not
11521153
* commit root.
11531154
* The special case is for qgroup to search roots in commit_transaction().
11541155
*
@@ -1199,7 +1200,7 @@ static int find_parent_nodes(struct btrfs_trans_handle *trans,
11991200
path->skip_locking = 1;
12001201
}
12011202

1202-
if (time_seq == SEQ_LAST)
1203+
if (time_seq == BTRFS_SEQ_LAST)
12031204
path->skip_locking = 1;
12041205

12051206
/*
@@ -1217,9 +1218,9 @@ static int find_parent_nodes(struct btrfs_trans_handle *trans,
12171218

12181219
#ifdef CONFIG_BTRFS_FS_RUN_SANITY_TESTS
12191220
if (trans && likely(trans->type != __TRANS_DUMMY) &&
1220-
time_seq != SEQ_LAST) {
1221+
time_seq != BTRFS_SEQ_LAST) {
12211222
#else
1222-
if (trans && time_seq != SEQ_LAST) {
1223+
if (trans && time_seq != BTRFS_SEQ_LAST) {
12231224
#endif
12241225
/*
12251226
* look if there are updates for this ref queued and lock the
@@ -1527,7 +1528,7 @@ int btrfs_check_shared(struct btrfs_root *root, u64 inum, u64 bytenr,
15271528
struct btrfs_trans_handle *trans;
15281529
struct ulist_iterator uiter;
15291530
struct ulist_node *node;
1530-
struct seq_list elem = SEQ_LIST_INIT(elem);
1531+
struct btrfs_seq_list elem = BTRFS_SEQ_LIST_INIT(elem);
15311532
int ret = 0;
15321533
struct share_check shared = {
15331534
.root_objectid = root->root_key.objectid,
@@ -1953,7 +1954,7 @@ int iterate_extent_inodes(struct btrfs_fs_info *fs_info,
19531954
struct ulist *roots = NULL;
19541955
struct ulist_node *ref_node = NULL;
19551956
struct ulist_node *root_node = NULL;
1956-
struct seq_list tree_mod_seq_elem = SEQ_LIST_INIT(tree_mod_seq_elem);
1957+
struct btrfs_seq_list seq_elem = BTRFS_SEQ_LIST_INIT(seq_elem);
19571958
struct ulist_iterator ref_uiter;
19581959
struct ulist_iterator root_uiter;
19591960

@@ -1971,20 +1972,20 @@ int iterate_extent_inodes(struct btrfs_fs_info *fs_info,
19711972
}
19721973

19731974
if (trans)
1974-
btrfs_get_tree_mod_seq(fs_info, &tree_mod_seq_elem);
1975+
btrfs_get_tree_mod_seq(fs_info, &seq_elem);
19751976
else
19761977
down_read(&fs_info->commit_root_sem);
19771978

19781979
ret = btrfs_find_all_leafs(trans, fs_info, extent_item_objectid,
1979-
tree_mod_seq_elem.seq, &refs,
1980+
seq_elem.seq, &refs,
19801981
&extent_item_pos, ignore_offset);
19811982
if (ret)
19821983
goto out;
19831984

19841985
ULIST_ITER_INIT(&ref_uiter);
19851986
while (!ret && (ref_node = ulist_next(refs, &ref_uiter))) {
19861987
ret = btrfs_find_all_roots_safe(trans, fs_info, ref_node->val,
1987-
tree_mod_seq_elem.seq, &roots,
1988+
seq_elem.seq, &roots,
19881989
ignore_offset);
19891990
if (ret)
19901991
break;
@@ -2007,7 +2008,7 @@ int iterate_extent_inodes(struct btrfs_fs_info *fs_info,
20072008
free_leaf_list(refs);
20082009
out:
20092010
if (trans) {
2010-
btrfs_put_tree_mod_seq(fs_info, &tree_mod_seq_elem);
2011+
btrfs_put_tree_mod_seq(fs_info, &seq_elem);
20112012
btrfs_end_transaction(trans);
20122013
} else {
20132014
up_read(&fs_info->commit_root_sem);

0 commit comments

Comments
 (0)