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. As for spa_async_thread(), I think we can ignore all tasks when the
pool is read-only. 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().

Thanks,
George

On Tue, Oct 17, 2017 at 1:40 PM Andriy Gapon <a...@freebsd.org> 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

Reply via email to