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 <behlendorf1@llnl.gov>
Closes #2812
This commit is contained in:
Brian Behlendorf 2014-10-20 14:37:47 -07:00
parent 80c50365c2
commit c944be5d7e
1 changed files with 3 additions and 0 deletions

View 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);