Skip to content

Commit 73beece

Browse files
Liu Bokdave
authored andcommitted
Btrfs: fix lockdep deadlock warning due to dev_replace
Xfstests btrfs/011 complains about a deadlock warning, [ 1226.649039] ========================================================= [ 1226.649039] [ INFO: possible irq lock inversion dependency detected ] [ 1226.649039] 4.1.0+ raspberrypi#270 Not tainted [ 1226.649039] --------------------------------------------------------- [ 1226.652955] kswapd0/46 just changed the state of lock: [ 1226.652955] (&delayed_node->mutex){+.+.-.}, at: [<ffffffff81458735>] __btrfs_release_delayed_node+0x45/0x1d0 [ 1226.652955] but this lock took another, RECLAIM_FS-unsafe lock in the past: [ 1226.652955] (&fs_info->dev_replace.lock){+.+.+.} and interrupts could create inverse lock ordering between them. [ 1226.652955] other info that might help us debug this: [ 1226.652955] Chain exists of: &delayed_node->mutex --> &found->groups_sem --> &fs_info->dev_replace.lock [ 1226.652955] Possible interrupt unsafe locking scenario: [ 1226.652955] CPU0 CPU1 [ 1226.652955] ---- ---- [ 1226.652955] lock(&fs_info->dev_replace.lock); [ 1226.652955] local_irq_disable(); [ 1226.652955] lock(&delayed_node->mutex); [ 1226.652955] lock(&found->groups_sem); [ 1226.652955] <Interrupt> [ 1226.652955] lock(&delayed_node->mutex); [ 1226.652955] *** DEADLOCK *** Commit 084b6e7 ("btrfs: Fix a lockdep warning when running xfstest.") tried to fix a similar one that has the exactly same warning, but with that, we still run to this. The above lock chain comes from btrfs_commit_transaction ->btrfs_run_delayed_items ... ->__btrfs_update_delayed_inode ... ->__btrfs_cow_block ... ->find_free_extent ->cache_block_group ->load_free_space_cache ->btrfs_readpages ->submit_one_bio ... ->__btrfs_map_block ->btrfs_dev_replace_lock However, with high memory pressure, tasks which hold dev_replace.lock can be interrupted by kswapd and then kswapd is intended to release memory occupied by superblock, inodes and dentries, where we may call evict_inode, and it comes to [ 1226.652955] [<ffffffff81458735>] __btrfs_release_delayed_node+0x45/0x1d0 [ 1226.652955] [<ffffffff81459e74>] btrfs_remove_delayed_node+0x24/0x30 [ 1226.652955] [<ffffffff8140c5fe>] btrfs_evict_inode+0x34e/0x700 delayed_node->mutex may be acquired in __btrfs_release_delayed_node(), and it leads to a ABBA deadlock. To fix this, we can use "blocking rwlock" used in the case of extent_buffer, but things are simpler here since we only needs read's spinlock to blocking lock. With this, btrfs/011 no more produces warnings in dmesg. Signed-off-by: Liu Bo <bo.li.liu@oracle.com> Signed-off-by: David Sterba <dsterba@suse.com>
1 parent 18558ca commit 73beece

7 files changed

Lines changed: 105 additions & 84 deletions

File tree

‎fs/btrfs/ctree.h‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1002,8 +1002,10 @@ struct btrfs_dev_replace {
10021002
pid_t lock_owner;
10031003
atomic_t nesting_level;
10041004
struct mutex lock_finishing_cancel_unmount;
1005-
struct mutex lock_management_lock;
1006-
struct mutex lock;
1005+
rwlock_t lock;
1006+
atomic_t read_locks;
1007+
atomic_t blocking_readers;
1008+
wait_queue_head_t read_lock_wq;
10071009

10081010
struct btrfs_scrub_progress scrub_progress;
10091011
};

‎fs/btrfs/dev-replace.c‎

Lines changed: 70 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -202,13 +202,13 @@ int btrfs_run_dev_replace(struct btrfs_trans_handle *trans,
202202
struct btrfs_dev_replace_item *ptr;
203203
struct btrfs_dev_replace *dev_replace = &fs_info->dev_replace;
204204

205-
btrfs_dev_replace_lock(dev_replace);
205+
btrfs_dev_replace_lock(dev_replace, 0);
206206
if (!dev_replace->is_valid ||
207207
!dev_replace->item_needs_writeback) {
208-
btrfs_dev_replace_unlock(dev_replace);
208+
btrfs_dev_replace_unlock(dev_replace, 0);
209209
return 0;
210210
}
211-
btrfs_dev_replace_unlock(dev_replace);
211+
btrfs_dev_replace_unlock(dev_replace, 0);
212212

213213
key.objectid = 0;
214214
key.type = BTRFS_DEV_REPLACE_KEY;
@@ -264,7 +264,7 @@ int btrfs_run_dev_replace(struct btrfs_trans_handle *trans,
264264
ptr = btrfs_item_ptr(eb, path->slots[0],
265265
struct btrfs_dev_replace_item);
266266

267-
btrfs_dev_replace_lock(dev_replace);
267+
btrfs_dev_replace_lock(dev_replace, 1);
268268
if (dev_replace->srcdev)
269269
btrfs_set_dev_replace_src_devid(eb, ptr,
270270
dev_replace->srcdev->devid);
@@ -287,7 +287,7 @@ int btrfs_run_dev_replace(struct btrfs_trans_handle *trans,
287287
btrfs_set_dev_replace_cursor_right(eb, ptr,
288288
dev_replace->cursor_right);
289289
dev_replace->item_needs_writeback = 0;
290-
btrfs_dev_replace_unlock(dev_replace);
290+
btrfs_dev_replace_unlock(dev_replace, 1);
291291

292292
btrfs_mark_buffer_dirty(eb);
293293

@@ -356,7 +356,7 @@ int btrfs_dev_replace_start(struct btrfs_root *root,
356356
return PTR_ERR(trans);
357357
}
358358

359-
btrfs_dev_replace_lock(dev_replace);
359+
btrfs_dev_replace_lock(dev_replace, 1);
360360
switch (dev_replace->replace_state) {
361361
case BTRFS_IOCTL_DEV_REPLACE_STATE_NEVER_STARTED:
362362
case BTRFS_IOCTL_DEV_REPLACE_STATE_FINISHED:
@@ -395,7 +395,7 @@ int btrfs_dev_replace_start(struct btrfs_root *root,
395395
dev_replace->is_valid = 1;
396396
dev_replace->item_needs_writeback = 1;
397397
args->result = BTRFS_IOCTL_DEV_REPLACE_RESULT_NO_ERROR;
398-
btrfs_dev_replace_unlock(dev_replace);
398+
btrfs_dev_replace_unlock(dev_replace, 1);
399399

400400
ret = btrfs_sysfs_add_device_link(tgt_device->fs_devices, tgt_device);
401401
if (ret)
@@ -407,7 +407,7 @@ int btrfs_dev_replace_start(struct btrfs_root *root,
407407
trans = btrfs_start_transaction(root, 0);
408408
if (IS_ERR(trans)) {
409409
ret = PTR_ERR(trans);
410-
btrfs_dev_replace_lock(dev_replace);
410+
btrfs_dev_replace_lock(dev_replace, 1);
411411
goto leave;
412412
}
413413

@@ -433,7 +433,7 @@ int btrfs_dev_replace_start(struct btrfs_root *root,
433433
leave:
434434
dev_replace->srcdev = NULL;
435435
dev_replace->tgtdev = NULL;
436-
btrfs_dev_replace_unlock(dev_replace);
436+
btrfs_dev_replace_unlock(dev_replace, 1);
437437
btrfs_destroy_dev_replace_tgtdev(fs_info, tgt_device);
438438
return ret;
439439
}
@@ -471,18 +471,18 @@ static int btrfs_dev_replace_finishing(struct btrfs_fs_info *fs_info,
471471
/* don't allow cancel or unmount to disturb the finishing procedure */
472472
mutex_lock(&dev_replace->lock_finishing_cancel_unmount);
473473

474-
btrfs_dev_replace_lock(dev_replace);
474+
btrfs_dev_replace_lock(dev_replace, 0);
475475
/* was the operation canceled, or is it finished? */
476476
if (dev_replace->replace_state !=
477477
BTRFS_IOCTL_DEV_REPLACE_STATE_STARTED) {
478-
btrfs_dev_replace_unlock(dev_replace);
478+
btrfs_dev_replace_unlock(dev_replace, 0);
479479
mutex_unlock(&dev_replace->lock_finishing_cancel_unmount);
480480
return 0;
481481
}
482482

483483
tgt_device = dev_replace->tgtdev;
484484
src_device = dev_replace->srcdev;
485-
btrfs_dev_replace_unlock(dev_replace);
485+
btrfs_dev_replace_unlock(dev_replace, 0);
486486

487487
/*
488488
* flush all outstanding I/O and inode extent mappings before the
@@ -507,7 +507,7 @@ static int btrfs_dev_replace_finishing(struct btrfs_fs_info *fs_info,
507507
/* keep away write_all_supers() during the finishing procedure */
508508
mutex_lock(&root->fs_info->fs_devices->device_list_mutex);
509509
mutex_lock(&root->fs_info->chunk_mutex);
510-
btrfs_dev_replace_lock(dev_replace);
510+
btrfs_dev_replace_lock(dev_replace, 1);
511511
dev_replace->replace_state =
512512
scrub_ret ? BTRFS_IOCTL_DEV_REPLACE_STATE_CANCELED
513513
: BTRFS_IOCTL_DEV_REPLACE_STATE_FINISHED;
@@ -528,7 +528,7 @@ static int btrfs_dev_replace_finishing(struct btrfs_fs_info *fs_info,
528528
rcu_str_deref(src_device->name),
529529
src_device->devid,
530530
rcu_str_deref(tgt_device->name), scrub_ret);
531-
btrfs_dev_replace_unlock(dev_replace);
531+
btrfs_dev_replace_unlock(dev_replace, 1);
532532
mutex_unlock(&root->fs_info->chunk_mutex);
533533
mutex_unlock(&root->fs_info->fs_devices->device_list_mutex);
534534
mutex_unlock(&uuid_mutex);
@@ -565,7 +565,7 @@ static int btrfs_dev_replace_finishing(struct btrfs_fs_info *fs_info,
565565
list_add(&tgt_device->dev_alloc_list, &fs_info->fs_devices->alloc_list);
566566
fs_info->fs_devices->rw_devices++;
567567

568-
btrfs_dev_replace_unlock(dev_replace);
568+
btrfs_dev_replace_unlock(dev_replace, 1);
569569

570570
btrfs_rm_dev_replace_blocked(fs_info);
571571

@@ -649,7 +649,7 @@ void btrfs_dev_replace_status(struct btrfs_fs_info *fs_info,
649649
struct btrfs_dev_replace *dev_replace = &fs_info->dev_replace;
650650
struct btrfs_device *srcdev;
651651

652-
btrfs_dev_replace_lock(dev_replace);
652+
btrfs_dev_replace_lock(dev_replace, 0);
653653
/* even if !dev_replace_is_valid, the values are good enough for
654654
* the replace_status ioctl */
655655
args->result = BTRFS_IOCTL_DEV_REPLACE_RESULT_NO_ERROR;
@@ -675,7 +675,7 @@ void btrfs_dev_replace_status(struct btrfs_fs_info *fs_info,
675675
div_u64(btrfs_device_get_total_bytes(srcdev), 1000));
676676
break;
677677
}
678-
btrfs_dev_replace_unlock(dev_replace);
678+
btrfs_dev_replace_unlock(dev_replace, 0);
679679
}
680680

681681
int btrfs_dev_replace_cancel(struct btrfs_fs_info *fs_info,
@@ -698,13 +698,13 @@ static u64 __btrfs_dev_replace_cancel(struct btrfs_fs_info *fs_info)
698698
return -EROFS;
699699

700700
mutex_lock(&dev_replace->lock_finishing_cancel_unmount);
701-
btrfs_dev_replace_lock(dev_replace);
701+
btrfs_dev_replace_lock(dev_replace, 1);
702702
switch (dev_replace->replace_state) {
703703
case BTRFS_IOCTL_DEV_REPLACE_STATE_NEVER_STARTED:
704704
case BTRFS_IOCTL_DEV_REPLACE_STATE_FINISHED:
705705
case BTRFS_IOCTL_DEV_REPLACE_STATE_CANCELED:
706706
result = BTRFS_IOCTL_DEV_REPLACE_RESULT_NOT_STARTED;
707-
btrfs_dev_replace_unlock(dev_replace);
707+
btrfs_dev_replace_unlock(dev_replace, 1);
708708
goto leave;
709709
case BTRFS_IOCTL_DEV_REPLACE_STATE_STARTED:
710710
case BTRFS_IOCTL_DEV_REPLACE_STATE_SUSPENDED:
@@ -717,7 +717,7 @@ static u64 __btrfs_dev_replace_cancel(struct btrfs_fs_info *fs_info)
717717
dev_replace->replace_state = BTRFS_IOCTL_DEV_REPLACE_STATE_CANCELED;
718718
dev_replace->time_stopped = get_seconds();
719719
dev_replace->item_needs_writeback = 1;
720-
btrfs_dev_replace_unlock(dev_replace);
720+
btrfs_dev_replace_unlock(dev_replace, 1);
721721
btrfs_scrub_cancel(fs_info);
722722

723723
trans = btrfs_start_transaction(root, 0);
@@ -740,7 +740,7 @@ void btrfs_dev_replace_suspend_for_unmount(struct btrfs_fs_info *fs_info)
740740
struct btrfs_dev_replace *dev_replace = &fs_info->dev_replace;
741741

742742
mutex_lock(&dev_replace->lock_finishing_cancel_unmount);
743-
btrfs_dev_replace_lock(dev_replace);
743+
btrfs_dev_replace_lock(dev_replace, 1);
744744
switch (dev_replace->replace_state) {
745745
case BTRFS_IOCTL_DEV_REPLACE_STATE_NEVER_STARTED:
746746
case BTRFS_IOCTL_DEV_REPLACE_STATE_FINISHED:
@@ -756,7 +756,7 @@ void btrfs_dev_replace_suspend_for_unmount(struct btrfs_fs_info *fs_info)
756756
break;
757757
}
758758

759-
btrfs_dev_replace_unlock(dev_replace);
759+
btrfs_dev_replace_unlock(dev_replace, 1);
760760
mutex_unlock(&dev_replace->lock_finishing_cancel_unmount);
761761
}
762762

@@ -766,12 +766,12 @@ int btrfs_resume_dev_replace_async(struct btrfs_fs_info *fs_info)
766766
struct task_struct *task;
767767
struct btrfs_dev_replace *dev_replace = &fs_info->dev_replace;
768768

769-
btrfs_dev_replace_lock(dev_replace);
769+
btrfs_dev_replace_lock(dev_replace, 1);
770770
switch (dev_replace->replace_state) {
771771
case BTRFS_IOCTL_DEV_REPLACE_STATE_NEVER_STARTED:
772772
case BTRFS_IOCTL_DEV_REPLACE_STATE_FINISHED:
773773
case BTRFS_IOCTL_DEV_REPLACE_STATE_CANCELED:
774-
btrfs_dev_replace_unlock(dev_replace);
774+
btrfs_dev_replace_unlock(dev_replace, 1);
775775
return 0;
776776
case BTRFS_IOCTL_DEV_REPLACE_STATE_STARTED:
777777
break;
@@ -784,10 +784,10 @@ int btrfs_resume_dev_replace_async(struct btrfs_fs_info *fs_info)
784784
btrfs_info(fs_info, "cannot continue dev_replace, tgtdev is missing");
785785
btrfs_info(fs_info,
786786
"you may cancel the operation after 'mount -o degraded'");
787-
btrfs_dev_replace_unlock(dev_replace);
787+
btrfs_dev_replace_unlock(dev_replace, 1);
788788
return 0;
789789
}
790-
btrfs_dev_replace_unlock(dev_replace);
790+
btrfs_dev_replace_unlock(dev_replace, 1);
791791

792792
WARN_ON(atomic_xchg(
793793
&fs_info->mutually_exclusive_operation_running, 1));
@@ -865,48 +865,58 @@ int btrfs_dev_replace_is_ongoing(struct btrfs_dev_replace *dev_replace)
865865
return 1;
866866
}
867867

868-
void btrfs_dev_replace_lock(struct btrfs_dev_replace *dev_replace)
868+
void btrfs_dev_replace_lock(struct btrfs_dev_replace *dev_replace, int rw)
869869
{
870-
/* the beginning is just an optimization for the typical case */
871-
if (atomic_read(&dev_replace->nesting_level) == 0) {
872-
acquire_lock:
873-
/* this is not a nested case where the same thread
874-
* is trying to acqurire the same lock twice */
875-
mutex_lock(&dev_replace->lock);
876-
mutex_lock(&dev_replace->lock_management_lock);
877-
dev_replace->lock_owner = current->pid;
878-
atomic_inc(&dev_replace->nesting_level);
879-
mutex_unlock(&dev_replace->lock_management_lock);
880-
return;
870+
if (rw == 1) {
871+
/* write */
872+
again:
873+
wait_event(dev_replace->read_lock_wq,
874+
atomic_read(&dev_replace->blocking_readers) == 0);
875+
write_lock(&dev_replace->lock);
876+
if (atomic_read(&dev_replace->blocking_readers)) {
877+
write_unlock(&dev_replace->lock);
878+
goto again;
879+
}
880+
} else {
881+
read_lock(&dev_replace->lock);
882+
atomic_inc(&dev_replace->read_locks);
881883
}
884+
}
882885

883-
mutex_lock(&dev_replace->lock_management_lock);
884-
if (atomic_read(&dev_replace->nesting_level) > 0 &&
885-
dev_replace->lock_owner == current->pid) {
886-
WARN_ON(!mutex_is_locked(&dev_replace->lock));
887-
atomic_inc(&dev_replace->nesting_level);
888-
mutex_unlock(&dev_replace->lock_management_lock);
889-
return;
886+
void btrfs_dev_replace_unlock(struct btrfs_dev_replace *dev_replace, int rw)
887+
{
888+
if (rw == 1) {
889+
/* write */
890+
ASSERT(atomic_read(&dev_replace->blocking_readers) == 0);
891+
write_unlock(&dev_replace->lock);
892+
} else {
893+
ASSERT(atomic_read(&dev_replace->read_locks) > 0);
894+
atomic_dec(&dev_replace->read_locks);
895+
read_unlock(&dev_replace->lock);
890896
}
897+
}
891898

892-
mutex_unlock(&dev_replace->lock_management_lock);
893-
goto acquire_lock;
899+
/* inc blocking cnt and release read lock */
900+
void btrfs_dev_replace_set_lock_blocking(
901+
struct btrfs_dev_replace *dev_replace)
902+
{
903+
/* only set blocking for read lock */
904+
ASSERT(atomic_read(&dev_replace->read_locks) > 0);
905+
atomic_inc(&dev_replace->blocking_readers);
906+
read_unlock(&dev_replace->lock);
894907
}
895908

896-
void btrfs_dev_replace_unlock(struct btrfs_dev_replace *dev_replace)
909+
/* acquire read lock and dec blocking cnt */
910+
void btrfs_dev_replace_clear_lock_blocking(
911+
struct btrfs_dev_replace *dev_replace)
897912
{
898-
WARN_ON(!mutex_is_locked(&dev_replace->lock));
899-
mutex_lock(&dev_replace->lock_management_lock);
900-
WARN_ON(atomic_read(&dev_replace->nesting_level) < 1);
901-
WARN_ON(dev_replace->lock_owner != current->pid);
902-
atomic_dec(&dev_replace->nesting_level);
903-
if (atomic_read(&dev_replace->nesting_level) == 0) {
904-
dev_replace->lock_owner = 0;
905-
mutex_unlock(&dev_replace->lock_management_lock);
906-
mutex_unlock(&dev_replace->lock);
907-
} else {
908-
mutex_unlock(&dev_replace->lock_management_lock);
909-
}
913+
/* only set blocking for read lock */
914+
ASSERT(atomic_read(&dev_replace->read_locks) > 0);
915+
ASSERT(atomic_read(&dev_replace->blocking_readers) > 0);
916+
read_lock(&dev_replace->lock);
917+
if (atomic_dec_and_test(&dev_replace->blocking_readers) &&
918+
waitqueue_active(&dev_replace->read_lock_wq))
919+
wake_up(&dev_replace->read_lock_wq);
910920
}
911921

912922
void btrfs_bio_counter_inc_noblocked(struct btrfs_fs_info *fs_info)

‎fs/btrfs/dev-replace.h‎

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,11 @@ int btrfs_dev_replace_cancel(struct btrfs_fs_info *fs_info,
3434
void btrfs_dev_replace_suspend_for_unmount(struct btrfs_fs_info *fs_info);
3535
int btrfs_resume_dev_replace_async(struct btrfs_fs_info *fs_info);
3636
int btrfs_dev_replace_is_ongoing(struct btrfs_dev_replace *dev_replace);
37-
void btrfs_dev_replace_lock(struct btrfs_dev_replace *dev_replace);
38-
void btrfs_dev_replace_unlock(struct btrfs_dev_replace *dev_replace);
37+
void btrfs_dev_replace_lock(struct btrfs_dev_replace *dev_replace, int rw);
38+
void btrfs_dev_replace_unlock(struct btrfs_dev_replace *dev_replace, int rw);
39+
void btrfs_dev_replace_set_lock_blocking(struct btrfs_dev_replace *dev_replace);
40+
void btrfs_dev_replace_clear_lock_blocking(
41+
struct btrfs_dev_replace *dev_replace);
3942

4043
static inline void btrfs_dev_replace_stats_inc(atomic64_t *stat_value)
4144
{

‎fs/btrfs/disk-io.c‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2272,9 +2272,11 @@ static void btrfs_init_dev_replace_locks(struct btrfs_fs_info *fs_info)
22722272
fs_info->dev_replace.lock_owner = 0;
22732273
atomic_set(&fs_info->dev_replace.nesting_level, 0);
22742274
mutex_init(&fs_info->dev_replace.lock_finishing_cancel_unmount);
2275-
mutex_init(&fs_info->dev_replace.lock_management_lock);
2276-
mutex_init(&fs_info->dev_replace.lock);
2275+
rwlock_init(&fs_info->dev_replace.lock);
2276+
atomic_set(&fs_info->dev_replace.read_locks, 0);
2277+
atomic_set(&fs_info->dev_replace.blocking_readers, 0);
22772278
init_waitqueue_head(&fs_info->replace_wait);
2279+
init_waitqueue_head(&fs_info->dev_replace.read_lock_wq);
22782280
}
22792281

22802282
static void btrfs_init_qgroup(struct btrfs_fs_info *fs_info)

‎fs/btrfs/reada.c‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -396,20 +396,20 @@ static struct reada_extent *reada_find_extent(struct btrfs_root *root,
396396
}
397397

398398
/* insert extent in reada_tree + all per-device trees, all or nothing */
399-
btrfs_dev_replace_lock(&fs_info->dev_replace);
399+
btrfs_dev_replace_lock(&fs_info->dev_replace, 0);
400400
spin_lock(&fs_info->reada_lock);
401401
ret = radix_tree_insert(&fs_info->reada_tree, index, re);
402402
if (ret == -EEXIST) {
403403
re_exist = radix_tree_lookup(&fs_info->reada_tree, index);
404404
BUG_ON(!re_exist);
405405
re_exist->refcnt++;
406406
spin_unlock(&fs_info->reada_lock);
407-
btrfs_dev_replace_unlock(&fs_info->dev_replace);
407+
btrfs_dev_replace_unlock(&fs_info->dev_replace, 0);
408408
goto error;
409409
}
410410
if (ret) {
411411
spin_unlock(&fs_info->reada_lock);
412-
btrfs_dev_replace_unlock(&fs_info->dev_replace);
412+
btrfs_dev_replace_unlock(&fs_info->dev_replace, 0);
413413
goto error;
414414
}
415415
prev_dev = NULL;
@@ -456,12 +456,12 @@ static struct reada_extent *reada_find_extent(struct btrfs_root *root,
456456
BUG_ON(fs_info == NULL);
457457
radix_tree_delete(&fs_info->reada_tree, index);
458458
spin_unlock(&fs_info->reada_lock);
459-
btrfs_dev_replace_unlock(&fs_info->dev_replace);
459+
btrfs_dev_replace_unlock(&fs_info->dev_replace, 0);
460460
goto error;
461461
}
462462
}
463463
spin_unlock(&fs_info->reada_lock);
464-
btrfs_dev_replace_unlock(&fs_info->dev_replace);
464+
btrfs_dev_replace_unlock(&fs_info->dev_replace, 0);
465465

466466
btrfs_put_bbio(bbio);
467467
return re;

0 commit comments

Comments
 (0)