summaryrefslogtreecommitdiffstats
path: root/sys/ufs
diff options
context:
space:
mode:
authormckusick <mckusick@FreeBSD.org>2002-01-16 04:59:09 +0000
committermckusick <mckusick@FreeBSD.org>2002-01-16 04:59:09 +0000
commit0ed7ba2c7402bdcb1b7ec738e669b00eefaed2b0 (patch)
tree8eb67e2a93efd1826128e6602354431dc032198c /sys/ufs
parenteeaba9a1cca40643f53cfa3a3ec39a1717e957cd (diff)
downloadFreeBSD-src-0ed7ba2c7402bdcb1b7ec738e669b00eefaed2b0.zip
FreeBSD-src-0ed7ba2c7402bdcb1b7ec738e669b00eefaed2b0.tar.gz
Put write on read-only filesystem panic after we have weeded out
block and character devices, fifo's, etc. Submitted by: Bruce Evans <bde@zeta.org.au>
Diffstat (limited to 'sys/ufs')
-rw-r--r--sys/ufs/ffs/ffs_inode.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/ufs/ffs/ffs_inode.c b/sys/ufs/ffs/ffs_inode.c
index 6dcf2cc..43dfec6 100644
--- a/sys/ufs/ffs/ffs_inode.c
+++ b/sys/ufs/ffs/ffs_inode.c
@@ -152,8 +152,6 @@ ffs_truncate(vp, length, flags, cred, td)
oip = VTOI(ovp);
fs = oip->i_fs;
- if (fs->fs_ronly)
- panic("ffs_truncate: read-only filesystem");
if (length < 0)
return (EINVAL);
if (length > fs->fs_maxfilesize)
@@ -173,6 +171,8 @@ ffs_truncate(vp, length, flags, cred, td)
oip->i_flag |= IN_CHANGE | IN_UPDATE;
return (UFS_UPDATE(ovp, 0));
}
+ if (fs->fs_ronly)
+ panic("ffs_truncate: read-only filesystem");
#ifdef QUOTA
error = getinoquota(oip);
if (error)
OpenPOWER on IntegriCloud