diff options
Diffstat (limited to 'sys/gnu/fs/ext2fs/ext2_readwrite.c')
-rw-r--r-- | sys/gnu/fs/ext2fs/ext2_readwrite.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/sys/gnu/fs/ext2fs/ext2_readwrite.c b/sys/gnu/fs/ext2fs/ext2_readwrite.c index ba79835..c40ae98 100644 --- a/sys/gnu/fs/ext2fs/ext2_readwrite.c +++ b/sys/gnu/fs/ext2fs/ext2_readwrite.c @@ -217,15 +217,15 @@ WRITE(ap) * file servers have no limits, I don't think it matters. */ td = uio->uio_td; - /* For p_rlimit. */ - mtx_assert(&Giant, MA_OWNED); - if (vp->v_type == VREG && td && - uio->uio_offset + uio->uio_resid > - td->td_proc->p_rlimit[RLIMIT_FSIZE].rlim_cur) { + if (vp->v_type == VREG && td != NULL) { PROC_LOCK(td->td_proc); - psignal(td->td_proc, SIGXFSZ); + if (uio->uio_offset + uio->uio_resid > + lim_cur(td->td_proc, RLIMIT_FSIZE)) { + psignal(td->td_proc, SIGXFSZ); + PROC_UNLOCK(td->td_proc); + return (EFBIG); + } PROC_UNLOCK(td->td_proc); - return (EFBIG); } resid = uio->uio_resid; |