summaryrefslogtreecommitdiff
path: root/libbcachefs/super.c
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@gmail.com>2018-12-19 15:20:44 -0500
committerKent Overstreet <kent.overstreet@gmail.com>2018-12-19 15:21:54 -0500
commit99ccaf73a8b92d6cb5d6892142a12468081a2b0d (patch)
tree33485dc8938ec4ff92fd653fae58355a85e861cc /libbcachefs/super.c
parentf9ba96e16535a653b97f7f1f953fabf477737a96 (diff)
Update bcachefs sources to 2724e115d2 bcachefs: Lots of option handling improvements
Diffstat (limited to 'libbcachefs/super.c')
-rw-r--r--libbcachefs/super.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/libbcachefs/super.c b/libbcachefs/super.c
index 0212832a..82a0bf07 100644
--- a/libbcachefs/super.c
+++ b/libbcachefs/super.c
@@ -1344,7 +1344,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;