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>
This commit is contained in:
Kirk McKusick 2002-01-16 04:59:09 +00:00
parent c056a3ab57
commit 8af31e7b46

View File

@ -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)