mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2026-09-22 09:34:56 +02:00
bcachefs: fix device remove error path
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
This commit is contained in:
committed by
Kent Overstreet
parent
19b505a934
commit
d3bb629d04
+2
-1
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user