enable Enable fstrans on all file systems. diff -r 159e0355c051 -r 17e4a2fb28e7 sys/fs/msdosfs/msdosfs_vfsops.c --- a/sys/fs/msdosfs/msdosfs_vfsops.c Fri Feb 17 14:58:35 2017 +0100 +++ b/sys/fs/msdosfs/msdosfs_vfsops.c Fri Feb 17 14:58:35 2017 +0100 @@ -478,10 +478,6 @@ bp = NULL; /* both used in error_exit */ pmp = NULL; - error = fstrans_mount(mp); - if (error) - goto error_exit; - error = getdisksize(devvp, &psize, &secsize); if (error) { if (argp->flags & MSDOSFSMNT_GEMDOSFS) @@ -858,7 +854,6 @@ return (0); error_exit: - fstrans_unmount(mp); if (bp) brelse(bp, BC_AGE); if (pmp) { @@ -923,7 +918,6 @@ free(pmp, M_MSDOSFSMNT); mp->mnt_data = NULL; mp->mnt_flag &= ~MNT_LOCAL; - fstrans_unmount(mp); return (0); } diff -r 159e0355c051 -r 17e4a2fb28e7 sys/kern/vfs_mount.c --- a/sys/kern/vfs_mount.c Fri Feb 17 14:58:35 2017 +0100 +++ b/sys/kern/vfs_mount.c Fri Feb 17 14:58:35 2017 +0100 @@ -82,6 +82,7 @@ #include #include #include +#include #include #include #include @@ -710,6 +711,12 @@ return ENOMEM; } + if ((error = fstrans_mount(mp)) != 0) { + vfs_unbusy(mp, false, NULL); + vfs_destroy(mp); + return error; + } + mp->mnt_stat.f_owner = kauth_cred_geteuid(l->l_cred); /* @@ -794,6 +801,7 @@ err_unmounted: vp->v_mountedhere = NULL; mutex_exit(&mp->mnt_updating); + fstrans_unmount(mp); vfs_unbusy(mp, false, NULL); vfs_destroy(mp); @@ -919,6 +927,7 @@ mutex_exit(&syncer_mutex); vfs_hooks_unmount(mp); + fstrans_unmount(mp); vfs_destroy(mp); /* reference from mount() */ if (coveredvp != NULLVP) { vrele(coveredvp); @@ -1200,6 +1209,8 @@ mp = TAILQ_FIRST(&mountlist); mp->mnt_flag |= MNT_ROOTFS; mp->mnt_op->vfs_refcount++; + error = fstrans_mount(mp); + KASSERT(error == 0); /* * Get the vnode for '/'. Set cwdi0.cwdi_cdir to diff -r 159e0355c051 -r 17e4a2fb28e7 sys/ufs/ffs/ffs_vfsops.c --- a/sys/ufs/ffs/ffs_vfsops.c Fri Feb 17 14:58:35 2017 +0100 +++ b/sys/ufs/ffs/ffs_vfsops.c Fri Feb 17 14:58:35 2017 +0100 @@ -1115,12 +1115,6 @@ ronly = (mp->mnt_flag & MNT_RDONLY) != 0; - error = fstrans_mount(mp); - if (error) { - DPRINTF("fstrans_mount returned %d", error); - return error; - } - ump = kmem_zalloc(sizeof(*ump), KM_SLEEP); mutex_init(&ump->um_lock, MUTEX_DEFAULT, IPL_NONE); error = ffs_snapshot_init(ump); @@ -1536,7 +1530,6 @@ } #endif - fstrans_unmount(mp); if (fs) kmem_free(fs, fs->fs_sbsize); spec_node_setmountedfs(devvp, NULL); @@ -1739,7 +1732,6 @@ kmem_free(ump, sizeof(*ump)); mp->mnt_data = NULL; mp->mnt_flag &= ~MNT_LOCAL; - fstrans_unmount(mp); return (0); }