mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-12-05 01:54:09 +08:00
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>
This commit is contained in:
parent
f57a6a5d41
commit
97fd13ad76
@ -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)
|
|||||||
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)
|
|||||||
|
|
||||||
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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user