On 17/10/2017 19:05, George Wilson wrote: > Andriy, > > I'm not familiar with spa_async_thread_vd() (I don't believe that is > upstreamed > yet) so I can't comment on what is the correct thing to do there.
Oh, I didn't realize that that part of the code was FreeBSD only. Alexander made the change in this commit: https://github.com/freebsd/freebsd/commit/07b58a38cf6664708546a9f4cd18fb8cc3a3bb1f So, this is a FreeBSD specific issue then. Thank you! > As for > spa_async_thread(), I think we can ignore all tasks when the pool is > read-only. I think that it would be nice to handle SPA_ASYNC_REMOVE even for read-only pools. But if that complicates things too much, then we can survive without that. > You'll probably need to update the call to vdev_probe() in zio_vdev_io_done() > so > that we only call it if spa_writeable(). vdev_probe_done() already checks spa_writeable() before issuing a write request. Not sure if that's enough. > On Tue, Oct 17, 2017 at 1:40 PM Andriy Gapon <[email protected] > <mailto:[email protected]>> wrote: > > 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-M4666ec33d56c533e901ac0d4> > | Powered by Topicbox <https://topicbox.com> -- Andriy Gapon ------------------------------------------ openzfs-developer Archives: https://openzfs.topicbox.com/groups/developer/discussions/Tbc5170d4f71ec486-Mcdd2b81e7a5ea5d565a5a74e Powered by Topicbox: https://topicbox.com
