diff options
author | Kent Overstreet <kent.overstreet@gmail.com> | 2019-07-10 23:04:58 +0300 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@linux.dev> | 2023-10-23 00:08:24 +0300 |
commit | 97fd13ad769c24260ce0e05f05a51df132b980bd (patch) | |
tree | 3b356c352e70f68130aa9a8a959d1cdef7e8f289 /fs/bcachefs/ec.c | |
parent | f57a6a5d41d66c527f8683b5cc6a069fe59e1fdf (diff) | |
download | linux-97fd13ad769c24260ce0e05f05a51df132b980bd.tar.xz |
bcachefs: Don't try to delete stripes when RO
We weren't checking for errors when trying to delet stripes, which meant
ec_stripe_delete_work() would spin trying to delete the same stripe over
and over.
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/ec.c')
-rw-r--r-- | fs/bcachefs/ec.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/fs/bcachefs/ec.c b/fs/bcachefs/ec.c index 40acd1ec4645..6d59631b8259 100644 --- a/fs/bcachefs/ec.c +++ b/fs/bcachefs/ec.c @@ -626,7 +626,8 @@ void bch2_stripes_heap_update(struct bch_fs *c, bch2_stripes_heap_insert(c, m, idx); } - if (stripe_idx_to_delete(c) >= 0) + if (stripe_idx_to_delete(c) >= 0 && + !percpu_ref_is_dying(&c->writes)) schedule_work(&c->ec_stripe_delete_work); } @@ -684,7 +685,8 @@ static void ec_stripe_delete_work(struct work_struct *work) if (idx < 0) break; - ec_stripe_delete(c, idx); + if (ec_stripe_delete(c, idx)) + break; } mutex_unlock(&c->ec_stripe_create_lock); |