mirror of
https://github.com/torvalds/linux.git
synced 2026-06-05 04:56:13 +02:00
bcachefs: fix device remove error path
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
This commit is contained in:
parent
19b505a934
commit
d3bb629d04
|
|
@ -1306,7 +1306,8 @@ int bch2_dev_remove(struct bch_fs *c, struct bch_dev *ca, int flags)
|
|||
mutex_unlock(&c->state_lock);
|
||||
return 0;
|
||||
err:
|
||||
if (ca->mi.state == BCH_MEMBER_STATE_RW)
|
||||
if (ca->mi.state == BCH_MEMBER_STATE_RW &&
|
||||
!percpu_ref_is_zero(&ca->io_ref))
|
||||
__bch2_dev_read_write(c, ca);
|
||||
mutex_unlock(&c->state_lock);
|
||||
return ret;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user