Skip to content

Commit 944746e

Browse files
ukernelchrismason-xx
authored andcommitted
Btrfs: small fixes for find_lock_delalloc_range.
There is a 'finish_wait', but no 'prepare_to_wait' . So I think that the 'prepare_to_wait' is missing. The second change is according to the name of variable. Signed-off-by: Chris Mason <[email protected]>
1 parent b97f920 commit 944746e

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

fs/btrfs/extent_map.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1044,6 +1044,8 @@ u64 find_lock_delalloc_range(struct extent_map_tree *tree,
10441044
if (state->state & EXTENT_LOCKED) {
10451045
DEFINE_WAIT(wait);
10461046
atomic_inc(&state->refs);
1047+
prepare_to_wait(&state->wq, &wait,
1048+
TASK_UNINTERRUPTIBLE);
10471049
write_unlock_irq(&tree->lock);
10481050
schedule();
10491051
write_lock_irq(&tree->lock);
@@ -1059,7 +1061,7 @@ u64 find_lock_delalloc_range(struct extent_map_tree *tree,
10591061
node = rb_next(node);
10601062
if (!node)
10611063
break;
1062-
total_bytes = state->end - state->start + 1;
1064+
total_bytes += state->end - state->start + 1;
10631065
if (total_bytes >= max_bytes)
10641066
break;
10651067
}

0 commit comments

Comments
 (0)