From d5e53f9d06d149fbb62920bb5af766059dc35341 Mon Sep 17 00:00:00 2001 From: Brian Behlendorf Date: Thu, 6 Jan 2011 14:07:41 -0800 Subject: Disable zfs_sync during oops/panic 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 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/module/zfs/zfs_vfsops.c b/module/zfs/zfs_vfsops.c index a602c5d62..f5b78aec1 100644 --- a/module/zfs/zfs_vfsops.c +++ b/module/zfs/zfs_vfsops.c @@ -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) { -- cgit v1.2.3