Skip to content

Commit c922b01

Browse files
Stefan Roeschkdave
authored andcommitted
btrfs: assert nowait mode is not used for some btree search functions
Adds nowait asserts to btree search functions which are not used by buffered IO and direct IO paths. Reviewed-by: Filipe Manana <[email protected]> Signed-off-by: Stefan Roesch <[email protected]> Reviewed-by: David Sterba <[email protected]> Signed-off-by: David Sterba <[email protected]>
1 parent 965f47a commit c922b01

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

fs/btrfs/ctree.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2164,6 +2164,7 @@ int btrfs_search_old_slot(struct btrfs_root *root, const struct btrfs_key *key,
21642164

21652165
lowest_level = p->lowest_level;
21662166
WARN_ON(p->nodes[0] != NULL);
2167+
ASSERT(!p->nowait);
21672168

21682169
if (p->search_commit_root) {
21692170
BUG_ON(time_seq);
@@ -4465,6 +4466,7 @@ int btrfs_search_forward(struct btrfs_root *root, struct btrfs_key *min_key,
44654466
int ret = 1;
44664467
int keep_locks = path->keep_locks;
44674468

4469+
ASSERT(!path->nowait);
44684470
path->keep_locks = 1;
44694471
again:
44704472
cur = btrfs_read_lock_root_node(root);
@@ -4645,6 +4647,8 @@ int btrfs_next_old_leaf(struct btrfs_root *root, struct btrfs_path *path,
46454647
int ret;
46464648
int i;
46474649

4650+
ASSERT(!path->nowait);
4651+
46484652
nritems = btrfs_header_nritems(path->nodes[0]);
46494653
if (nritems == 0)
46504654
return 1;

0 commit comments

Comments
 (0)