From c4eaaa7e10688e59c181ea0c6cc6aaf742107e68 Mon Sep 17 00:00:00 2001 From: Keith M Wesolowski Date: Wed, 11 Jun 2014 18:35:26 +0000 Subject: OS-3033 panic when mounting a lofi device from a ro filesystem Reviewed by: Robert Mustacchi --- usr/src/uts/common/fs/hsfs/hsfs_vnops.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/usr/src/uts/common/fs/hsfs/hsfs_vnops.c b/usr/src/uts/common/fs/hsfs/hsfs_vnops.c index 66d4b6cfef..5375f883ae 100644 --- a/usr/src/uts/common/fs/hsfs/hsfs_vnops.c +++ b/usr/src/uts/common/fs/hsfs/hsfs_vnops.c @@ -1585,8 +1585,7 @@ hsfs_getpage( /* does not support write */ if (rw == S_WRITE) { - panic("write attempt on READ ONLY HSFS"); - /*NOTREACHED*/ + return (EROFS); } if (vp->v_flag & VNOMAP) { @@ -1798,6 +1797,9 @@ hsfs_map( if (vp->v_flag & VNOMAP) return (ENOSYS); + if (prot & PROT_WRITE) + return (ENOSYS); + if (off > HS_MAXFILEOFF || off < 0 || (off + len) < 0 || (off + len) > HS_MAXFILEOFF) return (ENXIO); -- cgit v1.2.3