summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKeith M Wesolowski <wesolows@foobazco.org>2014-06-11 18:35:26 +0000
committerKeith M Wesolowski <wesolows@foobazco.org>2014-06-11 20:32:20 +0000
commitc4eaaa7e10688e59c181ea0c6cc6aaf742107e68 (patch)
tree493bd7012fdf8f58cd847b2f1123dea3bb2f49bc
parentc500bd9d9ae9d89503ceae50d323c9b76c6dbefc (diff)
downloadillumos-joyent-c4eaaa7e10688e59c181ea0c6cc6aaf742107e68.tar.gz
OS-3033 panic when mounting a lofi device from a ro filesystem
Reviewed by: Robert Mustacchi <rm@joyent.com>
-rw-r--r--usr/src/uts/common/fs/hsfs/hsfs_vnops.c6
1 files 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);