]> git.proxmox.com Git - mirror_zfs.git/commit - module/zfs/vdev_queue.c
Fix self-healing IO prior to dsl_pool_init() completion
authorGeLiXin <47034221@qq.com>
Sat, 21 May 2016 03:34:06 +0000 (11:34 +0800)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Fri, 27 May 2016 21:11:25 +0000 (14:11 -0700)
commitb7faa7aabd420b056c9b9cbf6ab8849130385dca
tree0042fccd77f71a23e81a6abf5fc632551f406cff
parent92547bc45ca9a2114662d9343ae53e5098acb627
Fix self-healing IO prior to dsl_pool_init() completion

Async writes triggered by a self-healing IO may be issued before the
pool finishes the process of initialization.  This results in a NULL
dereference of `spa->spa_dsl_pool` in vdev_queue_max_async_writes().

George Wilson recommended addressing this issue by initializing the
passed `dsl_pool_t **` prior to dmu_objset_open_impl().  Since the
caller is passing the `spa->spa_dsl_pool` this has the effect of
ensuring it's initialized.

However, since this depends on the caller knowing they must pass
the `spa->spa_dsl_pool` an additional NULL check was added to
vdev_queue_max_async_writes().  This guards against any future
restructuring of the code which might result in dsl_pool_init()
being called differently.

Signed-off-by: GeLiXin <47034221@qq.com>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #4652
module/zfs/dsl_pool.c [changed mode: 0644->0755]
module/zfs/vdev_queue.c