If we fail to queue the work item because it's already in process, we
need to drop the ref we just took.
Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
 
 void bch2_do_invalidates(struct bch_fs *c)
 {
-       if (percpu_ref_tryget_live(&c->writes))
-               queue_work(system_long_wq, &c->invalidate_work);
+       if (percpu_ref_tryget_live(&c->writes) &&
+           !queue_work(system_long_wq, &c->invalidate_work))
+               percpu_ref_put(&c->writes);
 }
 
 static int bucket_freespace_init(struct btree_trans *trans, struct btree_iter *iter)