X-Git-Url: https://git.camperquake.de/gitweb.cgi?a=blobdiff_plain;f=module%2Fzfs%2Fzfs_vfsops.c;h=14411b8c4cfa95bce4501e95cb1f35a03f4437fd;hb=b516a07b997a8c3006788963f6b6128e505cf56c;hp=8016766d1463c4c84eaef62fa43f55727ef8b3f8;hpb=e15c02301489477c9201a80afac46791d20bd070;p=zfs.git diff --git a/module/zfs/zfs_vfsops.c b/module/zfs/zfs_vfsops.c index 8016766..14411b8 100644 --- a/module/zfs/zfs_vfsops.c +++ b/module/zfs/zfs_vfsops.c @@ -66,7 +66,6 @@ #include "zfs_comutil.h" #ifdef HAVE_ZPL -extern int sys_shutdown; /*ARGSUSED*/ int @@ -76,16 +75,7 @@ zfs_sync(vfs_t *vfsp, short flag, cred_t *cr) * Data integrity is job one. We don't want a compromised kernel * writing to the storage pool, so we never sync during panic. */ - if (panicstr) - return (0); - - /* - * SYNC_ATTR is used by fsflush() to force old filesystems like UFS - * to sync metadata, which they would otherwise cache indefinitely. - * Semantically, the only requirement is that the sync be initiated. - * The DMU syncs out txgs frequently, so there's nothing to do. - */ - if (flag & SYNC_ATTR) + if (unlikely(oops_in_progress)) return (0); if (vfsp != NULL) { @@ -98,14 +88,19 @@ zfs_sync(vfs_t *vfsp, short flag, cred_t *cr) ZFS_ENTER(zfsvfs); dp = dmu_objset_pool(zfsvfs->z_os); +#ifdef HAVE_SHUTDOWN /* * If the system is shutting down, then skip any * filesystems which may exist on a suspended pool. + * + * XXX: This can be implemented using the Linux reboot + * notifiers: {un}register_reboot_notifier(). */ if (sys_shutdown && spa_suspended(dp->dp_spa)) { ZFS_EXIT(zfsvfs); return (0); } +#endif /* HAVE_SHUTDOWN */ if (zfsvfs->z_log != NULL) zil_commit(zfsvfs->z_log, 0); @@ -983,6 +978,7 @@ zfsvfs_free(zfsvfs_t *zfsvfs) kmem_free(zfsvfs, sizeof (zfsvfs_t)); } +#ifdef HAVE_FUID_FEATURES static void zfs_set_fuid_feature(zfsvfs_t *zfsvfs) { @@ -997,6 +993,7 @@ zfs_set_fuid_feature(zfsvfs_t *zfsvfs) } zfsvfs->z_use_sa = USE_SA(zfsvfs->z_version, zfsvfs->z_os); } +#endif /* HAVE_FUID_FEATURES */ int zfs_domount(vfs_t *vfsp, char *osname) @@ -1038,6 +1035,7 @@ zfs_domount(vfs_t *vfsp, char *osname) vfsp->vfs_fsid.val[0] = fsid_guid; vfsp->vfs_fsid.val[1] = ((fsid_guid>>32) << 8); +#ifdef HAVE_FUID_FEATURES /* * Set features for file system. */ @@ -1051,6 +1049,7 @@ zfs_domount(vfs_t *vfsp, char *osname) vfs_set_feature(vfsp, VFSFT_CASEINSENSITIVE); } vfs_set_feature(vfsp, VFSFT_ZEROCOPY_SUPPORTED); +#endif /* HAVE_FUID_FEATURES */ if (dmu_objset_is_snapshot(zfsvfs->z_os)) { uint64_t pval; @@ -1682,8 +1681,10 @@ zfs_set_version(zfsvfs_t *zfsvfs, uint64_t newvers) zfsvfs->z_version = newvers; +#ifdef HAVE_FUID_FEATURES if (zfsvfs->z_version >= ZPL_VERSION_FUID) zfs_set_fuid_feature(zfsvfs); +#endif /* HAVE_FUID_FEATURES */ return (0); }