aboutsummaryrefslogtreecommitdiffstats
path: root/module
diff options
context:
space:
mode:
authorBrian Behlendorf <[email protected]>2014-10-20 14:37:47 -0700
committerBrian Behlendorf <[email protected]>2014-11-20 10:38:16 -0800
commitc944be5d7e619ad7259fdb5802f0f9bd90a22488 (patch)
tree1fb3cf9abd4344b22eb8e338577259df94f4774e /module
parent80c50365c21ea98ae78150f32c3f35e075815c44 (diff)
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 <[email protected]> Closes #2812
Diffstat (limited to 'module')
-rw-r--r--module/zfs/zfs_vnops.c3
1 files changed, 3 insertions, 0 deletions
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);