diff --git a/module/os/linux/zfs/zfs_vnops_os.c b/module/os/linux/zfs/zfs_vnops_os.c index 6ad75ace0b..1ae8023adc 100644 --- a/module/os/linux/zfs/zfs_vnops_os.c +++ b/module/os/linux/zfs/zfs_vnops_os.c @@ -4078,8 +4078,8 @@ zfs_map(struct inode *ip, offset_t off, caddr_t *addrp, size_t len, if ((error = zfs_enter_verify_zp(zfsvfs, zp, FTAG)) != 0) return (error); - if ((vm_flags & VM_WRITE) && (zp->z_pflags & - (ZFS_IMMUTABLE | ZFS_READONLY | ZFS_APPENDONLY))) { + if ((vm_flags & VM_WRITE) && (vm_flags & VM_SHARED) && + (zp->z_pflags & (ZFS_IMMUTABLE | ZFS_READONLY | ZFS_APPENDONLY))) { zfs_exit(zfsvfs, FTAG); return (SET_ERROR(EPERM)); }