Both spa_async_thread() and spa_async_thread_vd() assert that spa_sync_on is
true.  I think that the logic to ensure that is sound except for one case.
Specifically, if a pool is imported read-only, then spa_sync_on is never set to
true (which is correct), but spa_async_suspended is not incremented either.
So, spa_async_request() ==> spa_async_dispatch_vd() does not bail out and
spa_async_thread_vd gets executed.

I am actually not sure what's the best thing to do here for a read-only pool.
On the one hand, we should not touch its on-disk configuration, on the other
hand it seems that we should update the in-memory state of vdevs.

Maybe the assertion simply can be dropped?
I am not sure if spa_async_thread_vd() really depends on spa_sync being active.
What do you think?

-- 
Andriy Gapon

------------------------------------------
openzfs-developer
Archives: 
https://openzfs.topicbox.com/groups/developer/discussions/Tbc5170d4f71ec486-M2da2a935fc77cf9438b27731
Powered by Topicbox: https://topicbox.com

Reply via email to