From nobody@FreeBSD.org  Fri Jun  5 14:37:06 2009
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 34CB41065670
	for <freebsd-gnats-submit@FreeBSD.org>; Fri,  5 Jun 2009 14:37:06 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (www.freebsd.org [IPv6:2001:4f8:fff6::21])
	by mx1.freebsd.org (Postfix) with ESMTP id 180798FC16
	for <freebsd-gnats-submit@FreeBSD.org>; Fri,  5 Jun 2009 14:37:06 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (localhost [127.0.0.1])
	by www.freebsd.org (8.14.3/8.14.3) with ESMTP id n55Eb5YT024066
	for <freebsd-gnats-submit@FreeBSD.org>; Fri, 5 Jun 2009 14:37:05 GMT
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.14.3/8.14.3/Submit) id n55Eb5Pm024065;
	Fri, 5 Jun 2009 14:37:05 GMT
	(envelope-from nobody)
Message-Id: <200906051437.n55Eb5Pm024065@www.freebsd.org>
Date: Fri, 5 Jun 2009 14:37:05 GMT
From: David Naylor <naylor.b.david@gmail.com>
To: freebsd-gnats-submit@FreeBSD.org
Subject: [PATCH] sysutils/fusefs-kmod: Fix build on current
X-Send-Pr-Version: www-3.1
X-GNATS-Notify: amistry@am-productions.biz

>Number:         135285
>Category:       ports
>Synopsis:       [PATCH] sysutils/fusefs-kmod: Fix build on current
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    wxs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Fri Jun 05 14:40:00 UTC 2009
>Closed-Date:    Mon Jul 13 13:53:18 UTC 2009
>Last-Modified:  Mon Jul 13 13:53:18 UTC 2009
>Originator:     David Naylor
>Release:        FreeBSD 8.0-CURRENT
>Organization:
Private
>Environment:
FreeBSD dragon.dg 8.0-CURRENT FreeBSD 8.0-CURRENT #0: Fri Jun 5 10:09:06 SAST 2009 root@dragon.dg:/tmp/usr/src/sys/GENERIC i386
>Description:
r193187 removes vfs_bio_set_validclean in favour of vfs_bio_set_valid.  The two appear to be functionally the same.  
>How-To-Repeat:
make -C/usr/ports/sysutils/fusefs-kmod all
>Fix:
See attached for the patches that use vfs_bio_set_validclean as an alias for vfs_bio_set_valid if vfs_bio_set_validclean is not defined.  

(Compile tested only)

Patch attached with submission follows:

# This is a shell archive.  Save it in a file, remove anything before
# this line, and then unpack it by entering "sh file".  Note, it may
# create directories; files and directories will be owned by you and
# have default permissions.
#
# This archive contains:
#
#	fusefs_kmod
#	fusefs_kmod/files
#	fusefs_kmod/files/patch-fuse_module__fuse_io.c
#	fusefs_kmod/files/patch-fuse_module__fuse_vnops.c
#
echo c - fusefs_kmod
mkdir -p fusefs_kmod > /dev/null 2>&1
echo c - fusefs_kmod/files
mkdir -p fusefs_kmod/files > /dev/null 2>&1
echo x - fusefs_kmod/files/patch-fuse_module__fuse_io.c
sed 's/^X//' >fusefs_kmod/files/patch-fuse_module__fuse_io.c << '1475d536a980aa9335991ed7208f7f6a'
X--- fuse_module/fuse_io.c.orig	2008-02-05 07:25:57.000000000 +0200
X+++ fuse_module/fuse_io.c	2009-06-05 16:25:32.000000000 +0200
X@@ -35,6 +35,10 @@
X #include <vm/vnode_pager.h>
X #include <vm/vm_object.h>
X 
X+#ifndef vfs_bio_set_validclean
X+#define vfs_bio_set_validclean vfs_bio_set_valid
X+#endif
X+
X #include "fuse.h"
X #include "fuse_session.h"
X #include "fuse_vnode.h"
X@@ -157,7 +161,11 @@
X 		goto out;
X 
X 	if (uio->uio_rw == UIO_WRITE && fp->f_flag & O_APPEND) {
X-		if ((err = VOP_GETATTR(vp, &va, cred, td)))
X+		if ((err = VOP_GETATTR(vp, &va, cred
X+#if VOP_GETATTR_TAKES_THREAD
X+		    , td
X+#endif
X+		    )))
X 			goto out;
X 		uio->uio_offset = va.va_size;
X 	} else if ((flags & FOF_OFFSET) == 0)
X@@ -823,7 +831,11 @@
X #if FUSELIB_CONFORM_BIOREAD
X 		struct vattr va;
X 
X-		if ((err = VOP_GETATTR(vp, &va, cred, curthread)))
X+		if ((err = VOP_GETATTR(vp, &va, cred
X+#if VOP_GETATTR_TAKES_THREAD
X+		    , curthread
X+#endif
X+		    )))
X 			goto out;
X #endif
X 
1475d536a980aa9335991ed7208f7f6a
echo x - fusefs_kmod/files/patch-fuse_module__fuse_vnops.c
sed 's/^X//' >fusefs_kmod/files/patch-fuse_module__fuse_vnops.c << 'c57d47f29b9052dfcb560284ff0fdf77'
X--- fuse_module/fuse_vnops.c.orig	2008-02-05 07:25:57.000000000 +0200
X+++ fuse_module/fuse_vnops.c	2009-06-05 16:26:09.000000000 +0200
X@@ -37,6 +37,10 @@
X #include <vm/vnode_pager.h>
X #include <vm/vm_object.h>
X 
X+#ifndef vfs_bio_set_validclean
X+#define vfs_bio_set_validclean vfs_bio_set_valid
X+#endif
X+
X #include "fuse.h"
X #include "fuse_session.h"
X #include "fuse_vnode.h"
X@@ -799,8 +803,11 @@
X 	struct vnode *vp = ap->a_vp;
X 	struct vattr *vap = ap->a_vap;
X 	struct ucred *cred = ap->a_cred;
X+#if VOP_GETATTR_TAKES_THREAD
X 	struct thread *td = ap->a_td;
X-
X+#else
X+	struct thread *td = curthread;
X+#endif
X 	struct fuse_dispatcher fdi;
X 	struct timespec uptsp;
X 	int err = 0;
X@@ -871,7 +878,11 @@
X fuse_access(ap)
X 	struct vop_access_args /* {
X 		struct vnode *a_vp;
X+#if VOP_ACCESS_TAKES_ACCMODE_T
X+		accmode_t a_accmode;
X+#else
X 		int a_mode;
X+#endif
X 		struct ucred *a_cred;
X 		struct thread *a_td;
X 	} */ *ap;
X@@ -886,7 +897,13 @@
X 	else
X 		facp.facc_flags |= FACCESS_DO_ACCESS;
X 
X-	return fuse_access_i(vp, ap->a_mode, ap->a_cred, ap->a_td, &facp);
X+	return fuse_access_i(vp,
X+#if VOP_ACCESS_TAKES_ACCMODE_T
X+	    ap->a_accmode,
X+#else
X+	    ap->a_mode,
X+#endif
X+	    ap->a_cred, ap->a_td, &facp);
X }
X 
X /*
X@@ -946,7 +963,11 @@
X 		/* We are to do the check in-kernel */
X 
X 		if (! (facp->facc_flags & FACCESS_VA_VALID)) {
X-			err = VOP_GETATTR(vp, VTOVA(vp), cred, td);
X+			err = VOP_GETATTR(vp, VTOVA(vp), cred
X+#if VOP_GETATTR_TAKES_THREAD
X+			    , td
X+#endif
X+			    );
X 			if (err)
X 				return (err);
X 			facp->facc_flags |= FACCESS_VA_VALID;
X@@ -1929,7 +1950,11 @@
X 		 * It will not invalidate pages which are dirty, locked, under
X 		 * writeback or mapped into pagetables.") 
X 		 */
X+#if VOP_GETATTR_TAKES_THREAD
X 		err = vinvalbuf(vp, 0, td, PCATCH, 0);
X+#else
X+		err = vinvalbuf(vp, 0, PCATCH, 0);
X+#endif
X 		fufh->flags |= FOPEN_KEEP_CACHE;
X 	}
X 
X@@ -3005,8 +3030,11 @@
X 	struct vattr *vap = ap->a_vap;
X 	struct vnode *vp = ap->a_vp;
X 	struct ucred *cred = ap->a_cred;
X+#if VOP_GETATTR_TAKES_THREAD
X 	struct thread *td = ap->a_td;
X-
X+#else
X+	struct thread *td = curthread;
X+#endif
X 	int err = 0;
X 	struct fuse_dispatcher fdi;
X 	struct fuse_setattr_in *fsai;
c57d47f29b9052dfcb560284ff0fdf77
exit



>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->feedback 
State-Changed-By: edwin 
State-Changed-When: Fri Jun 5 14:40:16 UTC 2009 
State-Changed-Why:  
Awaiting maintainers feedback (via the GNATS Auto Assign Tool) 

http://www.freebsd.org/cgi/query-pr.cgi?pr=135285 

From: Edwin Groothuis <edwin@FreeBSD.org>
To: amistry@am-productions.biz
Cc: bug-followup@FreeBSD.org
Subject: Re: ports/135285: [PATCH] sysutils/fusefs-kmod: Fix build on current
Date: Fri, 5 Jun 2009 14:40:14 UT

 Maintainer of sysutils/fusefs-kmod,
 
 Please note that PR ports/135285 has just been submitted.
 
 If it contains a patch for an upgrade, an enhancement or a bug fix
 you agree on, reply to this email stating that you approve the patch
 and a committer will take care of it.
 
 The full text of the PR can be found at:
     http://www.freebsd.org/cgi/query-pr.cgi?pr=ports/135285
 
 -- 
 Edwin Groothuis via the GNATS Auto Assign Tool
 edwin@FreeBSD.org
Responsible-Changed-From-To: freebsd-ports-bugs->wxs 
Responsible-Changed-By: wxs 
Responsible-Changed-When: Fri Jun 5 19:06:22 UTC 2009 
Responsible-Changed-Why:  
I'll take it. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=135285 

From: Wesley Shields <wxs@FreeBSD.org>
To: bug-followup@FreeBSD.org, naylor.b.david@gmail.com
Cc:  
Subject: Re: ports/135285: [PATCH] sysutils/fusefs-kmod: Fix build on
	current
Date: Mon, 15 Jun 2009 10:19:04 -0400

 This patch causes the port to fail on -current and 6-STABLE with the
 following (sorry for the line wrap):
 
 cc -O2 -pipe -fno-strict-aliasing -Werror -D_KERNEL -DKLD_MODULE
 -nostdinc  -I../include -I. -I@ -I@/contrib/altq -finline-limit=8000
 --param inline-unit-growth=100 --param large-function-growth=1000
 -fno-common  -mno-align-long-strings -mpreferred-stack-boundary=2
 -mno-mmx -mno-3dnow -mno-sse -mno-sse2 -mno-sse3 -ffreestanding
 -fstack-protector -std=iso9899:1999 -fstack-protector -Wall
 -Wredundant-decls -Wnested-externs -Wstrict-prototypes
 -Wmissing-prototypes -Wpointer-arith -Winline -Wcast-qual  -Wundef
 -Wno-pointer-sign -fformat-extensions -c fuse_io.c
 cc1: warnings being treated as errors
 fuse_io.c: In function 'fuse_write_biobackend':
 fuse_io.c:756: warning: implicit declaration of function
 'vfs_bio_set_valid'
 fuse_io.c:756: warning: nested extern declaration of 'vfs_bio_set_valid'
 *** Error code 1
 
 Stop in
 /work/a/ports/sysutils/fusefs-kmod/work/fuse4bsd-498acaef33b0/fuse_module.
 *** Error code 1
 
 Can you please look into solving this issue. I'll be happy to test any
 patches you want. Thanks!
 
 -- WXS

From: David Naylor <naylor.b.david@gmail.com>
To: Wesley Shields <wxs@freebsd.org>
Cc: bug-followup@freebsd.org
Subject: Re: ports/135285: [PATCH] sysutils/fusefs-kmod: Fix build on current
Date: Tue, 16 Jun 2009 11:16:40 +0200

 --nextPart2870453.ha306DsXiS
 Content-Type: multipart/mixed;
   boundary="Boundary-01=_4L2NKpvW615p8qv"
 Content-Transfer-Encoding: 7bit
 Content-Disposition: inline
 
 --Boundary-01=_4L2NKpvW615p8qv
 Content-Type: text/plain;
   charset="iso-8859-1"
 Content-Transfer-Encoding: quoted-printable
 Content-Disposition: inline
 
 On Monday 15 June 2009 16:19:04 Wesley Shields wrote:
 > This patch causes the port to fail on -current and 6-STABLE with the
 > following (sorry for the line wrap):
 >
 > cc -O2 -pipe -fno-strict-aliasing -Werror -D_KERNEL -DKLD_MODULE
 > -nostdinc  -I../include -I. -I@ -I@/contrib/altq -finline-limit=3D8000
 > --param inline-unit-growth=3D100 --param large-function-growth=3D1000
 > -fno-common  -mno-align-long-strings -mpreferred-stack-boundary=3D2
 > -mno-mmx -mno-3dnow -mno-sse -mno-sse2 -mno-sse3 -ffreestanding
 > -fstack-protector -std=3Diso9899:1999 -fstack-protector -Wall
 > -Wredundant-decls -Wnested-externs -Wstrict-prototypes
 > -Wmissing-prototypes -Wpointer-arith -Winline -Wcast-qual  -Wundef
 > -Wno-pointer-sign -fformat-extensions -c fuse_io.c
 > cc1: warnings being treated as errors
 > fuse_io.c: In function 'fuse_write_biobackend':
 > fuse_io.c:756: warning: implicit declaration of function
 > 'vfs_bio_set_valid'
 > fuse_io.c:756: warning: nested extern declaration of 'vfs_bio_set_valid'
 > *** Error code 1
 >
 > Stop in
 > /work/a/ports/sysutils/fusefs-kmod/work/fuse4bsd-498acaef33b0/fuse_module.
 > *** Error code 1
 >
 > Can you please look into solving this issue. I'll be happy to test any
 > patches you want. Thanks!
 
 Good news: used wrong approach to fix it, should be fixed in attached patch=
 es.
 
 Bad news: with the very recent changes in VFS trying to use sshfs core dump=
 s=20
 my system so the code will compile but probably kill the computer. =20
 
 Unfortunately this fix works with a kernel a few weeks old...  But now only=
 =20
 allows the code to compile.
 
 --Boundary-01=_4L2NKpvW615p8qv
 Content-Type: text/x-csrc;
   charset="iso 8859-15";
   name="patch-fuse_module__fuse_io.c"
 Content-Transfer-Encoding: quoted-printable
 Content-Disposition: attachment;
 	filename="patch-fuse_module__fuse_io.c"
 
 =2D-- fuse_module/fuse_io.c.orig	2008-02-05 07:25:57.000000000 +0200
 +++ fuse_module/fuse_io.c	2009-06-05 16:25:32.000000000 +0200
 @@ -35,6 +35,11 @@
  #include <vm/vnode_pager.h>
  #include <vm/vm_object.h>
 +#include <sys/param.h>
 =20
 +#if __FreeBSD_version >=3D 800095
 +#define vfs_bio_set_validclean vfs_bio_set_valid
 +#endif
 +
  #include "fuse.h"
  #include "fuse_session.h"
  #include "fuse_vnode.h"
 @@ -157,7 +161,11 @@
  		goto out;
 =20
  	if (uio->uio_rw =3D=3D UIO_WRITE && fp->f_flag & O_APPEND) {
 =2D		if ((err =3D VOP_GETATTR(vp, &va, cred, td)))
 +		if ((err =3D VOP_GETATTR(vp, &va, cred
 +#if VOP_GETATTR_TAKES_THREAD
 +		    , td
 +#endif
 +		    )))
  			goto out;
  		uio->uio_offset =3D va.va_size;
  	} else if ((flags & FOF_OFFSET) =3D=3D 0)
 @@ -823,7 +831,11 @@
  #if FUSELIB_CONFORM_BIOREAD
  		struct vattr va;
 =20
 =2D		if ((err =3D VOP_GETATTR(vp, &va, cred, curthread)))
 +		if ((err =3D VOP_GETATTR(vp, &va, cred
 +#if VOP_GETATTR_TAKES_THREAD
 +		    , curthread
 +#endif
 +		    )))
  			goto out;
  #endif
 =20
 
 --Boundary-01=_4L2NKpvW615p8qv
 Content-Type: text/x-csrc;
   charset="iso 8859-15";
   name="patch-fuse_module__fuse_vnops.c"
 Content-Transfer-Encoding: quoted-printable
 Content-Disposition: attachment;
 	filename="patch-fuse_module__fuse_vnops.c"
 
 =2D-- fuse_module/fuse_vnops.c.orig	2008-02-05 07:25:57.000000000 +0200
 +++ fuse_module/fuse_vnops.c	2009-06-05 16:26:09.000000000 +0200
 @@ -37,6 +37,11 @@
  #include <vm/vnode_pager.h>
  #include <vm/vm_object.h>
 +#include <sys/param.h>
 =20
 +#if __FreeBSD_version >=3D 800095
 +#define vfs_bio_set_validclean vfs_bio_set_valid
 +#endif
 +
  #include "fuse.h"
  #include "fuse_session.h"
  #include "fuse_vnode.h"
 @@ -799,8 +803,11 @@
  	struct vnode *vp =3D ap->a_vp;
  	struct vattr *vap =3D ap->a_vap;
  	struct ucred *cred =3D ap->a_cred;
 +#if VOP_GETATTR_TAKES_THREAD
  	struct thread *td =3D ap->a_td;
 =2D
 +#else
 +	struct thread *td =3D curthread;
 +#endif
  	struct fuse_dispatcher fdi;
  	struct timespec uptsp;
  	int err =3D 0;
 @@ -871,7 +878,11 @@
  fuse_access(ap)
  	struct vop_access_args /* {
  		struct vnode *a_vp;
 +#if VOP_ACCESS_TAKES_ACCMODE_T
 +		accmode_t a_accmode;
 +#else
  		int a_mode;
 +#endif
  		struct ucred *a_cred;
  		struct thread *a_td;
  	} */ *ap;
 @@ -886,7 +897,13 @@
  	else
  		facp.facc_flags |=3D FACCESS_DO_ACCESS;
 =20
 =2D	return fuse_access_i(vp, ap->a_mode, ap->a_cred, ap->a_td, &facp);
 +	return fuse_access_i(vp,
 +#if VOP_ACCESS_TAKES_ACCMODE_T
 +	    ap->a_accmode,
 +#else
 +	    ap->a_mode,
 +#endif
 +	    ap->a_cred, ap->a_td, &facp);
  }
 =20
  /*
 @@ -946,7 +963,11 @@
  		/* We are to do the check in-kernel */
 =20
  		if (! (facp->facc_flags & FACCESS_VA_VALID)) {
 =2D			err =3D VOP_GETATTR(vp, VTOVA(vp), cred, td);
 +			err =3D VOP_GETATTR(vp, VTOVA(vp), cred
 +#if VOP_GETATTR_TAKES_THREAD
 +			    , td
 +#endif
 +			    );
  			if (err)
  				return (err);
  			facp->facc_flags |=3D FACCESS_VA_VALID;
 @@ -1929,7 +1950,11 @@
  		 * It will not invalidate pages which are dirty, locked, under
  		 * writeback or mapped into pagetables.")=20
  		 */
 +#if VOP_GETATTR_TAKES_THREAD
  		err =3D vinvalbuf(vp, 0, td, PCATCH, 0);
 +#else
 +		err =3D vinvalbuf(vp, 0, PCATCH, 0);
 +#endif
  		fufh->flags |=3D FOPEN_KEEP_CACHE;
  	}
 =20
 @@ -3005,8 +3030,11 @@
  	struct vattr *vap =3D ap->a_vap;
  	struct vnode *vp =3D ap->a_vp;
  	struct ucred *cred =3D ap->a_cred;
 +#if VOP_GETATTR_TAKES_THREAD
  	struct thread *td =3D ap->a_td;
 =2D
 +#else
 +	struct thread *td =3D curthread;
 +#endif
  	int err =3D 0;
  	struct fuse_dispatcher fdi;
  	struct fuse_setattr_in *fsai;
 
 --Boundary-01=_4L2NKpvW615p8qv--
 
 --nextPart2870453.ha306DsXiS
 Content-Type: application/pgp-signature; name=signature.asc 
 Content-Description: This is a digitally signed message part.
 
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v2.0.9 (FreeBSD)
 
 iEYEABECAAYFAko3Yv0ACgkQUaaFgP9pFrJyxwCffZsNQGbELBV3NgLVkrUtkKTF
 0CsAoIXoSCxgfWXGq/dBUlRIs53VhDI5
 =w3tx
 -----END PGP SIGNATURE-----
 
 --nextPart2870453.ha306DsXiS--

From: Wesley Shields <wxs@FreeBSD.org>
To: David Naylor <naylor.b.david@gmail.com>
Cc: bug-followup@freebsd.org
Subject: Re: ports/135285: [PATCH] sysutils/fusefs-kmod: Fix build on
	current
Date: Tue, 16 Jun 2009 10:45:24 -0400

 On Tue, Jun 16, 2009 at 11:16:40AM +0200, David Naylor wrote:
 > On Monday 15 June 2009 16:19:04 Wesley Shields wrote:
 > > This patch causes the port to fail on -current and 6-STABLE with the
 > > following (sorry for the line wrap):
 > >
 > > cc -O2 -pipe -fno-strict-aliasing -Werror -D_KERNEL -DKLD_MODULE
 > > -nostdinc  -I../include -I. -I@ -I@/contrib/altq -finline-limit=8000
 > > --param inline-unit-growth=100 --param large-function-growth=1000
 > > -fno-common  -mno-align-long-strings -mpreferred-stack-boundary=2
 > > -mno-mmx -mno-3dnow -mno-sse -mno-sse2 -mno-sse3 -ffreestanding
 > > -fstack-protector -std=iso9899:1999 -fstack-protector -Wall
 > > -Wredundant-decls -Wnested-externs -Wstrict-prototypes
 > > -Wmissing-prototypes -Wpointer-arith -Winline -Wcast-qual  -Wundef
 > > -Wno-pointer-sign -fformat-extensions -c fuse_io.c
 > > cc1: warnings being treated as errors
 > > fuse_io.c: In function 'fuse_write_biobackend':
 > > fuse_io.c:756: warning: implicit declaration of function
 > > 'vfs_bio_set_valid'
 > > fuse_io.c:756: warning: nested extern declaration of 'vfs_bio_set_valid'
 > > *** Error code 1
 > >
 > > Stop in
 > > /work/a/ports/sysutils/fusefs-kmod/work/fuse4bsd-498acaef33b0/fuse_module.
 > > *** Error code 1
 > >
 > > Can you please look into solving this issue. I'll be happy to test any
 > > patches you want. Thanks!
 > 
 > Good news: used wrong approach to fix it, should be fixed in attached patches.
 > 
 > Bad news: with the very recent changes in VFS trying to use sshfs core dumps 
 > my system so the code will compile but probably kill the computer.  
 > 
 > Unfortunately this fix works with a kernel a few weeks old...  But now only 
 > allows the code to compile.
 
 Thank you for following up but as you said if the code breaks at runtime
 that's just as bad as it not compiling. I will go ahead and mark this
 port broken on current and hopefully you can come up with a proper fix.
 
 Thanks!
 
 -- WXS

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: ports/135285: commit references a PR
Date: Tue, 16 Jun 2009 14:55:46 +0000 (UTC)

 wxs         2009-06-16 14:55:36 UTC
 
   FreeBSD ports repository
 
   Modified files:
     sysutils/fusefs-kmod Makefile 
   Log:
   - Mark as broken on 8.x. There are two PRs about this. The first (ports/135285)
     has a patch but that causes coredumps. The second (ports/135621) has not
     been tested yet but the port should still be marked as broken until a
     proper fix is put in place.
   
   PR:             ports/135285
   Submitted by:   David Naylor <naylor.b.david@gmail.com>
   Approved by:    maintainer timeout
   
   Revision  Changes    Path
   1.28      +4 -0      ports/sysutils/fusefs-kmod/Makefile
 _______________________________________________
 cvs-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/cvs-all
 To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"
 

From: Anish Mistry <amistry@unitedware.com>
To: bug-followup@freebsd.org, naylor.b.david@gmail.com
Cc:  
Subject: Re: ports/135285: [PATCH] sysutils/fusefs-kmod: Fix build on current
Date: Thu, 9 Jul 2009 10:47:52 -0400

 --nextPart6486785.pt4Ek0tgFp
 Content-Type: multipart/mixed;
   boundary="Boundary-01=_YMgVKrXU8PNBXJp"
 Content-Transfer-Encoding: 7bit
 Content-Disposition: inline
 
 --Boundary-01=_YMgVKrXU8PNBXJp
 Content-Type: text/plain;
   charset="us-ascii"
 Content-Transfer-Encoding: quoted-printable
 Content-Disposition: inline
 
 The attached patch fixes build and:
 ports/136211
 ports/135621
 =2D-=20
 Anish Mistry
 UnitedWare, LLC
 amistry@unitedware.com
 
 UnitedWare, creators of ConsultantTree
 The marketplace for project based student
 computer consulting.
 https://www.consultanttree.com/
 
 --Boundary-01=_YMgVKrXU8PNBXJp
 Content-Type: text/x-diff;
   charset="us-ascii";
   name="fusefs-kmod-buildfix.patch"
 Content-Transfer-Encoding: quoted-printable
 Content-Disposition: attachment;
 	filename="fusefs-kmod-buildfix.patch"
 
 diff -ruN fusefs-kmod.orig/Makefile fusefs-kmod/Makefile
 =2D-- fusefs-kmod.orig/Makefile	2009-07-08 08:48:10.000000000 -0400
 +++ fusefs-kmod/Makefile	2009-07-08 10:01:32.000000000 -0400
 @@ -7,7 +7,7 @@
 =20
  PORTNAME=3D	fusefs
  DISTVERSION=3D	0.3.9-pre1.20080208
 =2DPORTREVISION=3D	5
 +PORTREVISION=3D	6
  CATEGORIES=3D	sysutils kld
  MASTER_SITES=3D	http://mercurial.creo.hu/repos/fuse4bsd-hg/index.cgi/archi=
 ve/
  PKGNAMESUFFIX=3D	-kmod
 @@ -58,10 +58,6 @@
 =20
  .include <bsd.port.pre.mk>
 =20
 =2D.if (${OSVERSION} >=3D 800000)
 =2DBROKEN=3D	does not build on 8.x
 =2D.endif
 =2D
  .if !exists(${SRC_BASE}/sys/Makefile)
  IGNORE=3D		requires the Kernel source to be installed. Set SRC_BASE if it =
 is not in /usr/src
  .endif
 diff -ruN fusefs-kmod.orig/files/patch-fuse_module__fuse.h.orig fusefs-kmod=
 /files/patch-fuse_module__fuse.h.orig
 =2D-- fusefs-kmod.orig/files/patch-fuse_module__fuse.h.orig	2009-07-08 08:4=
 8:10.000000000 -0400
 +++ fusefs-kmod/files/patch-fuse_module__fuse.h.orig	1969-12-31 19:00:00.00=
 0000000 -0500
 @@ -1,32 +0,0 @@
 =2D--- fuse_module/fuse.h.orig	2008-02-05 00:25:57.000000000 -0500
 =2D+++ fuse_module/fuse.h	2008-10-29 19:18:43.000000000 -0400
 =2D@@ -25,6 +25,14 @@
 =2D #endif
 =2D #endif
 =2D=20
 =2D+#ifndef VOP_ACCESS_TAKES_ACCMODE_T
 =2D+#if __FreeBSD_version >=3D 800052
 =2D+#define VOP_ACCESS_TAKES_ACCMODE_T 1
 =2D+#else
 =2D+#define VOP_ACCESS_TAKES_ACCMODE_T 0
 =2D+#endif
 =2D+#endif
 =2D+
 =2D #ifndef VOP_OPEN_TAKES_FP
 =2D #if __FreeBSD_version >=3D 700044
 =2D #define VOP_OPEN_TAKES_FP 1
 =2D@@ -49,6 +57,14 @@
 =2D #endif
 =2D #endif
 =2D=20
 =2D+#ifndef VOP_GETATTR_TAKES_THREAD
 =2D+#if __FreeBSD_version >=3D 800046
 =2D+#define VOP_GETATTR_TAKES_THREAD 0
 =2D+#else
 =2D+#define VOP_GETATTR_TAKES_THREAD 1
 =2D+#endif
 =2D+#endif
 =2D+
 =2D #ifndef USE_PRIVILEGE_API
 =2D /*
 =2D  * __FreeBSD_version bump was omitted for introduction of
 diff -ruN fusefs-kmod.orig/files/patch-fuse_module__fuse_io.c fusefs-kmod/f=
 iles/patch-fuse_module__fuse_io.c
 =2D-- fusefs-kmod.orig/files/patch-fuse_module__fuse_io.c	2009-07-08 08:48:=
 10.000000000 -0400
 +++ fusefs-kmod/files/patch-fuse_module__fuse_io.c	2009-07-08 09:53:45.0000=
 00000 -0400
 @@ -1,6 +1,17 @@
  --- fuse_module/fuse_io.c.orig	2008-02-05 00:25:57.000000000 -0500
 =2D+++ fuse_module/fuse_io.c	2008-09-26 13:15:56.000000000 -0400
 =2D@@ -157,7 +157,11 @@
 ++++ fuse_module/fuse_io.c	2009-07-08 09:53:15.000000000 -0400
 +@@ -35,6 +35,10 @@
 + #include <vm/vnode_pager.h>
 + #include <vm/vm_object.h>
 +=20
 ++#ifndef vfs_bio_set_validclean
 ++#define vfs_bio_set_validclean vfs_bio_set_valid
 ++#endif
 ++
 + #include "fuse.h"
 + #include "fuse_session.h"
 + #include "fuse_vnode.h"
 +@@ -157,7 +161,11 @@
   		goto out;
  =20
   	if (uio->uio_rw =3D=3D UIO_WRITE && fp->f_flag & O_APPEND) {
 @@ -13,7 +24,72 @@
   			goto out;
   		uio->uio_offset =3D va.va_size;
   	} else if ((flags & FOF_OFFSET) =3D=3D 0)
 =2D@@ -823,7 +827,11 @@
 +@@ -227,7 +235,7 @@
 + 		return (0);
 +=20
 + 	biosize =3D vp->v_mount->mnt_stat.f_iosize;
 +-	bcount =3D min(MAXBSIZE, biosize);
 ++	bcount =3D MIN(MAXBSIZE, biosize);
 +=20
 + 	DEBUG2G("entering loop\n");
 + 	do {
 +@@ -352,7 +360,7 @@
 + 		fri =3D fdi.indata;
 + 		fri->fh =3D fufh->fh_id;
 + 		fri->offset =3D uio->uio_offset;
 +-		fri->size =3D min(uio->uio_resid,
 ++		fri->size =3D MIN(uio->uio_resid,
 + 		                fusefs_get_data(vp->v_mount)->max_read);
 + =09
 + 		DEBUG2G("fri->fh %llu, fri->offset %d, fri->size %d\n",
 +@@ -399,7 +407,7 @@
 + 	while (uio->uio_resid > 0) {
 + 		int transfersize;
 +=20
 +-		chunksize =3D min(iov->iov_len, nmax);
 ++		chunksize =3D MIN(iov->iov_len, nmax);
 +=20
 + 		if (uio->uio_rw =3D=3D UIO_READ) {
 + 			struct fuse_read_in *fri;
 +@@ -464,7 +472,7 @@
 + {
 + 		int err;
 +=20
 +-		if ((err =3D uiomove(buf, min(reqsize, bufsize), uio)))
 ++		if ((err =3D uiomove(buf, MIN(reqsize, bufsize), uio)))
 + 			return (err);
 +=20
 + 		if (bufsize < reqsize)
 +@@ -502,7 +510,7 @@
 + 	}
 +=20
 + 	while (uio->uio_resid > 0) {
 +-		chunksize =3D min(uio->uio_resid,
 ++		chunksize =3D MIN(uio->uio_resid,
 + 		                fusefs_get_data(vp->v_mount)->max_write);
 +=20
 + 		fdi.iosize =3D sizeof(*fwi) + chunksize;
 +@@ -569,7 +577,7 @@
 + 	do {
 + 		lbn =3D uio->uio_offset / biosize;
 + 		on =3D uio->uio_offset & (biosize-1);
 +-		n =3D min((unsigned)(biosize - on), uio->uio_resid);
 ++		n =3D MIN((unsigned)(biosize - on), uio->uio_resid);
 + 	=09
 + 		DEBUG2G("lbn %d, on %d, n %d, uio offset %d, uio resid %d\n",
 + 		        (int)lbn, on, n, (int)uio->uio_offset, uio->uio_resid);
 +@@ -739,8 +747,8 @@
 + 		 */
 + 		if (n) {
 + 			if (bp->b_dirtyend > 0) {
 +-				bp->b_dirtyoff =3D min(on, bp->b_dirtyoff);
 +-				bp->b_dirtyend =3D max((on + n), bp->b_dirtyend);
 ++				bp->b_dirtyoff =3D MIN(on, bp->b_dirtyoff);
 ++				bp->b_dirtyend =3D MAX((on + n), bp->b_dirtyend);
 + 			} else {
 + 				bp->b_dirtyoff =3D on;
 + 				bp->b_dirtyend =3D on + n;
 +@@ -823,7 +831,11 @@
   #if FUSELIB_CONFORM_BIOREAD
   		struct vattr va;
  =20
 @@ -26,3 +102,32 @@
   			goto out;
   #endif
  =20
 +@@ -831,7 +843,7 @@
 + 		bp->b_resid =3D bp->b_bcount;
 + 		while (bp->b_resid > 0) {
 + 			DEBUG2G("starting bio with resid %ld\n", bp->b_resid);=09
 +-			chunksize =3D min(bp->b_resid,
 ++			chunksize =3D MIN(bp->b_resid,
 + 			                fusefs_get_data(vp->v_mount)->max_read);
 + 			fdi.iosize =3D sizeof(*fri);
 + 			if (! op)
 +@@ -842,8 +854,8 @@
 + 			fri->fh =3D fufh->fh_id;
 + 			fri->offset =3D ((off_t)bp->b_blkno) * biosize + ioff;
 + #if FUSELIB_CONFORM_BIOREAD
 +-			chunksize =3D min(chunksize,
 +-			                min(fri->offset + bp->b_resid,
 ++			chunksize =3D MIN(chunksize,
 ++			                MIN(fri->offset + bp->b_resid,
 + 			                    va.va_size) - fri->offset);
 + 			if (chunksize =3D=3D 0) {
 + 				respsize =3D -1;
 +@@ -901,7 +913,7 @@
 +=20
 + 		bufdat =3D bp->b_data + bp->b_dirtyoff;
 + 		while (bp->b_dirtyend > bp->b_dirtyoff) {
 +-			chunksize =3D min(bp->b_dirtyend - bp->b_dirtyoff,
 ++			chunksize =3D MIN(bp->b_dirtyend - bp->b_dirtyoff,
 + 			                fusefs_get_data(vp->v_mount)->max_write);
 + =09
 + 			fdi.iosize =3D sizeof(*fwi);
 diff -ruN fusefs-kmod.orig/files/patch-fuse_module__fuse_vfsops.c.orig fuse=
 fs-kmod/files/patch-fuse_module__fuse_vfsops.c.orig
 =2D-- fusefs-kmod.orig/files/patch-fuse_module__fuse_vfsops.c.orig	2009-07-=
 08 08:48:10.000000000 -0400
 +++ fusefs-kmod/files/patch-fuse_module__fuse_vfsops.c.orig	1969-12-31 19:0=
 0:00.000000000 -0500
 @@ -1,23 +0,0 @@
 =2D--- fuse_module/fuse_vfsops.c.orig	2008-02-05 00:25:57.000000000 -0500
 =2D+++ fuse_module/fuse_vfsops.c	2008-09-26 12:53:33.000000000 -0400
 =2D@@ -18,6 +18,7 @@
 =2D #include <sys/namei.h>
 =2D #include <sys/mount.h>
 =2D #include <sys/sysctl.h>
 =2D+#include <sys/fcntl.h>
 =2D=20
 =2D #include "fuse.h"
 =2D #include "fuse_session.h"
 =2D@@ -667,7 +668,11 @@
 =2D 	if (vp->v_type =3D=3D VNON) {
 =2D 		struct vattr va;
 =2D=20
 =2D-		(void)VOP_GETATTR(vp, &va, td->td_ucred, td);
 =2D+		(void)VOP_GETATTR(vp, &va, td->td_ucred
 =2D+#if VOP_GETATTR_TAKES_THREAD
 =2D+		    , td
 =2D+#endif
 =2D+		);
 =2D 	}
 =2D 	*vpp =3D vp;
 =2D #if _DEBUG2G
 diff -ruN fusefs-kmod.orig/files/patch-fuse_module__fuse_vnops.c.orig fusef=
 s-kmod/files/patch-fuse_module__fuse_vnops.c.orig
 =2D-- fusefs-kmod.orig/files/patch-fuse_module__fuse_vnops.c.orig	2009-07-0=
 8 08:48:10.000000000 -0400
 +++ fusefs-kmod/files/patch-fuse_module__fuse_vnops.c.orig	1969-12-31 19:00=
 :00.000000000 -0500
 @@ -1,53 +0,0 @@
 =2D--- fuse_module/fuse_vnops.c.orig	2008-02-05 13:25:57.000000000 +0800
 =2D+++ fuse_module/fuse_vnops.c	2008-10-19 13:31:53.000000000 +0800
 =2D@@ -799,8 +799,11 @@
 =2D 	struct vnode *vp =3D ap->a_vp;
 =2D 	struct vattr *vap =3D ap->a_vap;
 =2D 	struct ucred *cred =3D ap->a_cred;
 =2D+#if VOP_GETATTR_TAKES_THREAD
 =2D 	struct thread *td =3D ap->a_td;
 =2D-
 =2D+#else
 =2D+	struct thread *td =3D curthread;
 =2D+#endif
 =2D 	struct fuse_dispatcher fdi;
 =2D 	struct timespec uptsp;
 =2D 	int err =3D 0;
 =2D@@ -946,7 +949,11 @@
 =2D 		/* We are to do the check in-kernel */
 =2D=20
 =2D 		if (! (facp->facc_flags & FACCESS_VA_VALID)) {
 =2D-			err =3D VOP_GETATTR(vp, VTOVA(vp), cred, td);
 =2D+			err =3D VOP_GETATTR(vp, VTOVA(vp), cred
 =2D+#if VOP_GETATTR_TAKES_THREAD
 =2D+			    , td
 =2D+#endif
 =2D+			    );
 =2D 			if (err)
 =2D 				return (err);
 =2D 			facp->facc_flags |=3D FACCESS_VA_VALID;
 =2D@@ -1929,7 +1936,11 @@
 =2D 		 * It will not invalidate pages which are dirty, locked, under
 =2D 		 * writeback or mapped into pagetables.")=20
 =2D 		 */
 =2D+#if VOP_GETATTR_TAKES_THREAD
 =2D 		err =3D vinvalbuf(vp, 0, td, PCATCH, 0);
 =2D+#else
 =2D+		err =3D vinvalbuf(vp, 0, PCATCH, 0);
 =2D+#endif
 =2D 		fufh->flags |=3D FOPEN_KEEP_CACHE;
 =2D 	}
 =2D=20
 =2D@@ -3005,8 +3016,11 @@
 =2D 	struct vattr *vap =3D ap->a_vap;
 =2D 	struct vnode *vp =3D ap->a_vp;
 =2D 	struct ucred *cred =3D ap->a_cred;
 =2D+#if VOP_GETATTR_TAKES_THREAD
 =2D 	struct thread *td =3D ap->a_td;
 =2D-
 =2D+#else
 =2D+	struct thread *td =3D curthread;
 =2D+#endif
 =2D 	int err =3D 0;
 =2D 	struct fuse_dispatcher fdi;
 =2D 	struct fuse_setattr_in *fsai;
 
 --Boundary-01=_YMgVKrXU8PNBXJp--
 
 --nextPart6486785.pt4Ek0tgFp
 Content-Type: application/pgp-signature; name=signature.asc 
 Content-Description: This is a digitally signed message part.
 
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v2.0.11 (FreeBSD)
 
 iEYEABECAAYFAkpWAyUACgkQxqA5ziudZT2jzwCfW1Jgr4XVATahurndhfRTVKcL
 jY4AoJlHO41gUQEKw4TY22JBjFfFiVPn
 =lIPt
 -----END PGP SIGNATURE-----
 
 --nextPart6486785.pt4Ek0tgFp--

From: Anish Mistry <amistry@am-productions.biz>
To: bug-followup@freebsd.org, naylor.b.david@gmail.com
Cc:  
Subject: Re: ports/135285: [PATCH] sysutils/fusefs-kmod: Fix build on current
Date: Sun, 12 Jul 2009 18:13:08 -0400

 --nextPart5671351.VapoIJ3jA2
 Content-Type: text/plain;
   charset="us-ascii"
 Content-Transfer-Encoding: quoted-printable
 Content-Disposition: inline
 
 Same as previous patch, just not mangled by kmail.
 
 http://am-productions.biz/docs/fusefs-kmod-buildfix.patch
 
 =2D-=20
 Anish Mistry
 amistry@am-productions.biz
 AM Productions http://am-productions.biz/
 
 --nextPart5671351.VapoIJ3jA2
 Content-Type: application/pgp-signature; name=signature.asc 
 Content-Description: This is a digitally signed message part.
 
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v2.0.11 (FreeBSD)
 
 iEYEABECAAYFAkpaYAMACgkQxqA5ziudZT2VrQCfT5lPtEMi2l3/KxLVthSGNynC
 b1MAnRY+fuh6c1V6sXOIexD1rCum2hiB
 =QBnA
 -----END PGP SIGNATURE-----
 
 --nextPart5671351.VapoIJ3jA2--

From: David Naylor <naylor.b.david@gmail.com>
To: Anish Mistry <amistry@unitedware.com>
Cc: bug-followup@freebsd.org
Subject: Re: ports/135285: [PATCH] sysutils/fusefs-kmod: Fix build on current
Date: Mon, 13 Jul 2009 14:23:14 +0200

 --nextPart1401655.mlmGn3Psbq
 Content-Type: text/plain;
   charset="iso-8859-1"
 Content-Transfer-Encoding: quoted-printable
 Content-Disposition: inline
 
 On Thursday 09 July 2009 16:47:52 Anish Mistry wrote:
 > The attached patch fixes build and:
 > ports/136211
 > ports/135621
 
 It works fine here for me.  Stress tested with sshfs.
 
 There is no need for your patch to remove the three *.orig files (since the=
 y=20
 do not exist).
 
 Thanks
 
 --nextPart1401655.mlmGn3Psbq
 Content-Type: application/pgp-signature; name=signature.asc 
 Content-Description: This is a digitally signed message part.
 
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v2.0.9 (FreeBSD)
 
 iEYEABECAAYFAkpbJzUACgkQUaaFgP9pFrI6jwCeObmoR5YtfjbQy422A/pephzk
 dzcAoIZQ7t8YW83nx+htv/yvUIJOVC45
 =cJJt
 -----END PGP SIGNATURE-----
 
 --nextPart1401655.mlmGn3Psbq--
State-Changed-From-To: feedback->closed 
State-Changed-By: wxs 
State-Changed-When: Mon Jul 13 13:53:18 UTC 2009 
State-Changed-Why:  
Committed, with minor changes. Thanks! 

http://www.freebsd.org/cgi/query-pr.cgi?pr=135285 
>Unformatted:
