diff options
author | avg <avg@FreeBSD.org> | 2015-09-11 12:41:59 +0000 |
---|---|---|
committer | avg <avg@FreeBSD.org> | 2015-09-11 12:41:59 +0000 |
commit | 423decf41a80e322c84f16ed8e771e031cfc2652 (patch) | |
tree | b98c92039fe723432e48a353e8a2308bd035c469 | |
parent | c26752881eb1f52599525dab13d8562da2ef8e5d (diff) | |
download | FreeBSD-src-423decf41a80e322c84f16ed8e771e031cfc2652.zip FreeBSD-src-423decf41a80e322c84f16ed8e771e031cfc2652.tar.gz |
MFC r285021: zfs_mount(MS_REMOUNT): protect zfs_(un)register_callbacks calls
-rw-r--r-- | sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c index 4d310d7..b690b69 100644 --- a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c +++ b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c @@ -1706,9 +1706,19 @@ zfs_mount(vfs_t *vfsp) * according to those options set in the current VFS options. */ if (vfsp->vfs_flag & MS_REMOUNT) { - /* refresh mount options */ - zfs_unregister_callbacks(vfsp->vfs_data); + zfsvfs_t *zfsvfs = vfsp->vfs_data; + + /* + * Refresh mount options with z_teardown_lock blocking I/O while + * the filesystem is in an inconsistent state. + * The lock also serializes this code with filesystem + * manipulations between entry to zfs_suspend_fs() and return + * from zfs_resume_fs(). + */ + rrm_enter(&zfsvfs->z_teardown_lock, RW_WRITER, FTAG); + zfs_unregister_callbacks(zfsvfs); error = zfs_register_callbacks(vfsp); + rrm_exit(&zfsvfs->z_teardown_lock, FTAG); goto out; } |