Commit 97fd13ad authored by Kent Overstreet's avatar Kent Overstreet Committed by Kent Overstreet

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: default avatarKent Overstreet <kent.overstreet@linux.dev>
parent f57a6a5d
...@@ -626,7 +626,8 @@ void bch2_stripes_heap_update(struct bch_fs *c, ...@@ -626,7 +626,8 @@ void bch2_stripes_heap_update(struct bch_fs *c,
bch2_stripes_heap_insert(c, m, idx); 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); schedule_work(&c->ec_stripe_delete_work);
} }
...@@ -684,7 +685,8 @@ static void ec_stripe_delete_work(struct work_struct *work) ...@@ -684,7 +685,8 @@ static void ec_stripe_delete_work(struct work_struct *work)
if (idx < 0) if (idx < 0)
break; break;
ec_stripe_delete(c, idx); if (ec_stripe_delete(c, idx))
break;
} }
mutex_unlock(&c->ec_stripe_create_lock); mutex_unlock(&c->ec_stripe_create_lock);
......
...@@ -366,6 +366,8 @@ static int bch2_fs_read_write_late(struct bch_fs *c) ...@@ -366,6 +366,8 @@ static int bch2_fs_read_write_late(struct bch_fs *c)
schedule_delayed_work(&c->pd_controllers_update, 5 * HZ); schedule_delayed_work(&c->pd_controllers_update, 5 * HZ);
schedule_work(&c->ec_stripe_delete_work);
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment