mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2024-12-26 03:09:34 +03:00
Fix zfs_sb_teardown/zfs_resume_fs NULL dereference
Fix a pair of conditions in which a concurrent umount can cause NULL pointer dereferences: * zfs_sb_teardown - prevent a NULL dereference by not calling dmu_objset_pool with a null z_os. * zfs_resume_fs - don't try to unmount with a null z_os. This change makes the ZoL code more consistent with both Illumos and FreeBSD. Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov> Closes #1543
This commit is contained in:
parent
64d7b6cf75
commit
ab68b6e5db
@ -1056,9 +1056,11 @@ zfs_sb_teardown(zfs_sb_t *zsb, boolean_t unmounting)
|
||||
}
|
||||
|
||||
/*
|
||||
* Drain the iput_taskq to ensure all active references to the
|
||||
* If someone has not already unmounted this file system,
|
||||
* drain the iput_taskq to ensure all active references to the
|
||||
* zfs_sb_t have been handled only then can it be safely destroyed.
|
||||
*/
|
||||
if (zsb->z_os)
|
||||
taskq_wait(dsl_pool_iput_taskq(dmu_objset_pool(zsb->z_os)));
|
||||
|
||||
/*
|
||||
@ -1480,9 +1482,10 @@ bail:
|
||||
|
||||
if (err) {
|
||||
/*
|
||||
* Since we couldn't reopen zfs_sb_t, force
|
||||
* unmount this file system.
|
||||
* Since we couldn't reopen zfs_sb_t or, setup the
|
||||
* sa framework, force unmount this file system.
|
||||
*/
|
||||
if (zsb->z_os)
|
||||
(void) zfs_umount(zsb->z_sb);
|
||||
}
|
||||
return (err);
|
||||
|
Loading…
Reference in New Issue
Block a user