From c944be5d7e619ad7259fdb5802f0f9bd90a22488 Mon Sep 17 00:00:00 2001 From: Brian Behlendorf Date: Mon, 20 Oct 2014 14:37:47 -0700 Subject: Fix snapshots with dirty inodes 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 Closes #2812 --- module/zfs/zfs_vnops.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'module/zfs') diff --git a/module/zfs/zfs_vnops.c b/module/zfs/zfs_vnops.c index 2f55e562e..d05ccef39 100644 --- a/module/zfs/zfs_vnops.c +++ b/module/zfs/zfs_vnops.c @@ -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); -- cgit v1.2.3