]> granicus.if.org Git - zfs/commitdiff
Fix snapshots with dirty inodes
authorBrian Behlendorf <behlendorf1@llnl.gov>
Mon, 20 Oct 2014 21:37:47 +0000 (14:37 -0700)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Thu, 20 Nov 2014 18:38:16 +0000 (10:38 -0800)
Filesystems which are mounted read-only or are immutable because
they are snapshots must not be allowed to dirty and inode.  This
will result in a write which will correctly cause a kernel panic
because these filesystem are (and must be) immutable.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #2812

module/zfs/zfs_vnops.c

index 2f55e562eaaee9ce66b12e541d1f1f06087d6bd3..d05ccef39506e0bdd9d8f792c102e51b5c4d7a41 100644 (file)
@@ -3975,6 +3975,9 @@ zfs_dirty_inode(struct inode *ip, int flags)
        int             error;
        int             cnt = 0;
 
+       if (zfs_is_readonly(zsb) || dmu_objset_is_snapshot(zsb->z_os))
+               return (0);
+
        ZFS_ENTER(zsb);
        ZFS_VERIFY_ZP(zp);