@@ -1950,7 +1950,7 @@ static void bch2_do_discards_work(struct work_struct *work)
19501950 trace_discard_buckets (c , s .seen , s .open , s .need_journal_commit , s .discarded ,
19511951 bch2_err_str (ret ));
19521952
1953- percpu_ref_put (& ca -> io_ref );
1953+ percpu_ref_put (& ca -> io_ref [ WRITE ] );
19541954 bch2_write_ref_put (c , BCH_WRITE_REF_discard );
19551955}
19561956
@@ -1967,7 +1967,7 @@ void bch2_dev_do_discards(struct bch_dev *ca)
19671967 if (queue_work (c -> write_ref_wq , & ca -> discard_work ))
19681968 return ;
19691969
1970- percpu_ref_put (& ca -> io_ref );
1970+ percpu_ref_put (& ca -> io_ref [ WRITE ] );
19711971put_write_ref :
19721972 bch2_write_ref_put (c , BCH_WRITE_REF_discard );
19731973}
@@ -2045,7 +2045,7 @@ static void bch2_do_discards_fast_work(struct work_struct *work)
20452045 trace_discard_buckets_fast (c , s .seen , s .open , s .need_journal_commit , s .discarded , bch2_err_str (ret ));
20462046
20472047 bch2_trans_put (trans );
2048- percpu_ref_put (& ca -> io_ref );
2048+ percpu_ref_put (& ca -> io_ref [ WRITE ] );
20492049 bch2_write_ref_put (c , BCH_WRITE_REF_discard_fast );
20502050}
20512051
@@ -2065,7 +2065,7 @@ static void bch2_discard_one_bucket_fast(struct bch_dev *ca, u64 bucket)
20652065 if (queue_work (c -> write_ref_wq , & ca -> discard_fast_work ))
20662066 return ;
20672067
2068- percpu_ref_put (& ca -> io_ref );
2068+ percpu_ref_put (& ca -> io_ref [ WRITE ] );
20692069put_ref :
20702070 bch2_write_ref_put (c , BCH_WRITE_REF_discard_fast );
20712071}
@@ -2256,7 +2256,7 @@ static void bch2_do_invalidates_work(struct work_struct *work)
22562256 bch2_trans_iter_exit (trans , & iter );
22572257err :
22582258 bch2_trans_put (trans );
2259- percpu_ref_put (& ca -> io_ref );
2259+ percpu_ref_put (& ca -> io_ref [ WRITE ] );
22602260 bch2_bkey_buf_exit (& last_flushed , c );
22612261 bch2_write_ref_put (c , BCH_WRITE_REF_invalidate );
22622262}
@@ -2274,7 +2274,7 @@ void bch2_dev_do_invalidates(struct bch_dev *ca)
22742274 if (queue_work (c -> write_ref_wq , & ca -> invalidate_work ))
22752275 return ;
22762276
2277- percpu_ref_put (& ca -> io_ref );
2277+ percpu_ref_put (& ca -> io_ref [ WRITE ] );
22782278put_ref :
22792279 bch2_write_ref_put (c , BCH_WRITE_REF_invalidate );
22802280}
@@ -2506,7 +2506,7 @@ void bch2_recalc_capacity(struct bch_fs *c)
25062506
25072507 bch2_set_ra_pages (c , ra_pages );
25082508
2509- for_each_rw_member (c , ca ) {
2509+ __for_each_online_member (c , ca , BIT ( BCH_MEMBER_STATE_rw ), READ ) {
25102510 u64 dev_reserve = 0 ;
25112511
25122512 /*
0 commit comments