Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 20 Feb 2004 16:40:54 +0300
From:      Yar Tikhiy <yar@FreeBSD.org>
To:        Norikatsu Shigemura <nork@FreeBSD.org>
Cc:        fs@FreeBSD.org
Subject:   Re: Cannot build hfs-freebsd-03p1 on 5-current
Message-ID:  <20040220134054.GD91603@comp.chem.msu.su>
In-Reply-To: <200402201211.i1KCBbXh087403@sakura.ninth-nine.com>
References:  <200402201211.i1KCBbXh087403@sakura.ninth-nine.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Fri, Feb 20, 2004 at 09:11:37PM +0900, Norikatsu Shigemura wrote:
> 	Hum.. I can't compile hfs-freebsd-03p1 on 5-current.
> 	Anyone, do you know this fix?
[...]
> /tmp/hfs-freebsd-03p1/darwin/xnu/bsd/hfs/hfs_readwrite.c: In function `hfs_write':
> /tmp/hfs-freebsd-03p1/darwin/xnu/bsd/hfs/hfs_readwrite.c:341: error: structure has no member named `p_rlimit'

I believe that was due to a recent change in the per-process rlimit structure.
Would you mind trying the patch attached below?

-- 
Yar

--- hfs_readwrite.c	7 Feb 2004 17:27:43 -0000	1.40.2.2
+++ hfs_readwrite.c	20 Feb 2004 13:07:14 -0000
@@ -337,12 +337,14 @@ hfs_write(ap)
 	 * file servers have no limits, I don't think it matters.
 	 */
 	p = uio->uio_td;
-	if (vp->v_type == VREG && p &&
-	    writelimit > p->td_proc->p_rlimit[RLIMIT_FSIZE].rlim_cur) {
+	if (vp->v_type == VREG && p != NULL) {
 		PROC_LOCK(p->td_proc);
-		psignal(p->td_proc, SIGXFSZ);
+		if (writelimit > lim_cur(p->td_proc, RLIMIT_FSIZE)) {
+			psignal(p->td_proc, SIGXFSZ);
+			PROC_UNLOCK(p->td_proc);
+			return (EFBIG);
+		}
 		PROC_UNLOCK(p->td_proc);
-		return (EFBIG);
 	}
 	p = current_proc();
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20040220134054.GD91603>