mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2024-11-17 18:11:00 +03:00
8a02d01e85
When restructuring the zvol_open() logic for the Linux 5.13 kernel a lock inversion was accidentally introduced. In the updated code the spa_namespace_lock is now taken before the zv_suspend_lock allowing the following scenario to occur: down_read <=== waiting for zv_suspend_lock zvol_open <=== holds spa_namespace_lock __blkdev_get blkdev_get_by_dev blkdev_open ... mutex_lock <== waiting for spa_namespace_lock spa_open_common spa_open dsl_pool_hold dmu_objset_hold_flags dmu_objset_hold dsl_prop_get dsl_prop_get_integer zvol_create_minor dmu_recv_end zfs_ioc_recv_impl <=== holds zv_suspend_lock via zvol_suspend() zfs_ioc_recv ... This commit resolves the issue by moving the acquisition of the spa_namespace_lock back to after the zv_suspend_lock which restores the original ordering. Additionally, as part of this change the error exit paths were simplified where possible. Reviewed-by: Tony Hutter <hutter2@llnl.gov> Reviewed-by: Rich Ercolani <rincebrain@gmail.com> Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov> Closes #12863 |
||
---|---|---|
.. | ||
abd_os.c | ||
arc_os.c | ||
Makefile.in | ||
mmp_os.c | ||
policy.c | ||
qat_compress.c | ||
qat_crypt.c | ||
qat.c | ||
spa_misc_os.c | ||
trace.c | ||
vdev_disk.c | ||
vdev_file.c | ||
zfs_acl.c | ||
zfs_ctldir.c | ||
zfs_debug.c | ||
zfs_dir.c | ||
zfs_file_os.c | ||
zfs_ioctl_os.c | ||
zfs_racct.c | ||
zfs_sysfs.c | ||
zfs_uio.c | ||
zfs_vfsops.c | ||
zfs_vnops_os.c | ||
zfs_znode.c | ||
zio_crypt.c | ||
zpl_ctldir.c | ||
zpl_export.c | ||
zpl_file.c | ||
zpl_inode.c | ||
zpl_super.c | ||
zpl_xattr.c | ||
zvol_os.c |