summaryrefslogtreecommitdiffstats
path: root/sys/fs/smbfs/smbfs_io.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/fs/smbfs/smbfs_io.c')
-rw-r--r--sys/fs/smbfs/smbfs_io.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/sys/fs/smbfs/smbfs_io.c b/sys/fs/smbfs/smbfs_io.c
index 99f7c7d..5a0606c 100644
--- a/sys/fs/smbfs/smbfs_io.c
+++ b/sys/fs/smbfs/smbfs_io.c
@@ -277,11 +277,15 @@ smbfs_writevnode(struct vnode *vp, struct uio *uiop,
}
if (uiop->uio_resid == 0)
return 0;
- if (p && uiop->uio_offset + uiop->uio_resid > p->p_rlimit[RLIMIT_FSIZE].rlim_cur) {
- PROC_LOCK(td->td_proc);
- psignal(td->td_proc, SIGXFSZ);
- PROC_UNLOCK(td->td_proc);
- return EFBIG;
+ if (p != NULL) {
+ PROC_LOCK(p);
+ if (uiop->uio_offset + uiop->uio_resid >
+ lim_cur(p, RLIMIT_FSIZE)) {
+ psignal(p, SIGXFSZ);
+ PROC_UNLOCK(p);
+ return EFBIG;
+ }
+ PROC_UNLOCK(p);
}
smb_makescred(&scred, td, cred);
error = smb_write(smp->sm_share, np->n_fid, uiop, &scred);
OpenPOWER on IntegriCloud