mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-16 08:44:21 +08:00
bcache: Fix a bug when detaching
After detaching a backing device from a cache set, a bit wasn't getting reset meaning the second detach wouldn't work correctly. Signed-off-by: Kent Overstreet <kmo@daterainc.com>
This commit is contained in:
parent
4c834452aa
commit
5b1016e62f
@ -927,6 +927,7 @@ static void cached_dev_detach_finish(struct work_struct *w)
|
|||||||
list_move(&dc->list, &uncached_devices);
|
list_move(&dc->list, &uncached_devices);
|
||||||
|
|
||||||
clear_bit(BCACHE_DEV_DETACHING, &dc->disk.flags);
|
clear_bit(BCACHE_DEV_DETACHING, &dc->disk.flags);
|
||||||
|
clear_bit(BCACHE_DEV_UNLINK_DONE, &dc->disk.flags);
|
||||||
|
|
||||||
mutex_unlock(&bch_register_lock);
|
mutex_unlock(&bch_register_lock);
|
||||||
|
|
||||||
@ -1405,9 +1406,11 @@ static void cache_set_flush(struct closure *cl)
|
|||||||
if (ca->alloc_thread)
|
if (ca->alloc_thread)
|
||||||
kthread_stop(ca->alloc_thread);
|
kthread_stop(ca->alloc_thread);
|
||||||
|
|
||||||
cancel_delayed_work_sync(&c->journal.work);
|
if (c->journal.cur) {
|
||||||
/* flush last journal entry if needed */
|
cancel_delayed_work_sync(&c->journal.work);
|
||||||
c->journal.work.work.func(&c->journal.work.work);
|
/* flush last journal entry if needed */
|
||||||
|
c->journal.work.work.func(&c->journal.work.work);
|
||||||
|
}
|
||||||
|
|
||||||
closure_return(cl);
|
closure_return(cl);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user