]> granicus.if.org Git - zfs/commitdiff
Disable zfs_sync during oops/panic
authorBrian Behlendorf <behlendorf1@llnl.gov>
Thu, 6 Jan 2011 22:07:41 +0000 (14:07 -0800)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Thu, 10 Feb 2011 17:27:20 +0000 (09:27 -0800)
Minor update to ensure zfs_sync() is disabled if a kernel oops/panic
is triggered.  As the comment says 'data integrity is job one'.  This
change could have been done by defining panicstr to oops_in_progress
in the SPL.  But I felt it was better to use the native Linux API
here since to be clear.

module/zfs/zfs_vfsops.c

index a602c5d624899b0e623e39df95573bd26edf7355..f5b78aec1beb88582ec2f9741bc7606856e7de29 100644 (file)
@@ -75,7 +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)
+       if (unlikely(oops_in_progress))
                return (0);
 
        if (vfsp != NULL) {