Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 20 Aug 2012 14:40:11 GMT
From:      Jan Henrik Sylvester <me@janh.de>
To:        freebsd-ports-bugs@FreeBSD.org
Subject:   Re: ports/169165: sysutils/fusefs-kmod: calling fchown(2) on sshfs filesystem causes panic
Message-ID:  <201208201440.q7KEeBe6023450@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help
The following reply was made to PR ports/169165; it has been noted by GNATS.

From: Jan Henrik Sylvester <me@janh.de>
To: bug-followup@FreeBSD.org, dh@bsd.ee, mirror176@cox.net
Cc:  
Subject: Re: ports/169165: sysutils/fusefs-kmod: calling fchown(2) on sshfs
 filesystem causes panic
Date: Mon, 20 Aug 2012 16:35:02 +0200

 This is a multi-part message in MIME format.
 --------------040504060902000602000602
 Content-Type: text/plain; charset=ISO-8859-1; format=flowed
 Content-Transfer-Encoding: 7bit
 
 I got the same panic on 9.1-RC1/amd64, trying to "cp -p" to a ntfs-3g fs.
 
 I managed to manually apply the patch from freebsd-users-jp mentioned by 
 Henry Hu. I solved the panic, too.
 
 I have integrated the patch into the already existing one in ports. A 
 patch to the port is attached.
 
 Cheers,
 Jan Henrik
 
 --------------040504060902000602000602
 Content-Type: text/plain; charset=UTF-8;
  name="fusefs-kmod-panic.txt"
 Content-Transfer-Encoding: 7bit
 Content-Disposition: attachment;
  filename="fusefs-kmod-panic.txt"
 
 --- sysutils/fusefs-kmod/files/patch-fuse_module__fuse_vnops.c.orig	2008-10-30 16:36:35.000000000 +0100
 +++ sysutils/fusefs-kmod/files/patch-fuse_module__fuse_vnops.c	2012-08-20 15:52:17.000000000 +0200
 @@ -1,6 +1,29 @@
 ---- fuse_module/fuse_vnops.c.orig	2008-02-05 00:25:57.000000000 -0500
 -+++ fuse_module/fuse_vnops.c	2008-10-29 19:21:51.000000000 -0400
 -@@ -799,8 +799,11 @@
 +--- fuse_module/fuse_vnops.c.orig	2008-02-05 06:25:57.000000000 +0100
 ++++ fuse_module/fuse_vnops.c	2012-08-20 15:49:57.000000000 +0200
 +@@ -175,6 +175,11 @@
 + /* file ops */
 + static fo_close_t fuse_close_f;
 + 
 ++#if __FreeBSD_version > 900040
 ++static fo_chmod_t fuse_chmod_dummy;
 ++static fo_chown_t fuse_chown_dummy;
 ++#endif
 ++
 + /* vnode ops */
 + static vop_getattr_t  fuse_getattr;
 + static vop_reclaim_t  fuse_reclaim;
 +@@ -219,6 +224,10 @@
 + 	.fo_kqfilter = NULL,
 + 	.fo_stat     = NULL,
 + 	.fo_close    = fuse_close_f,
 ++#if __FreeBSD_version > 900040
 ++	.fo_chmod     = fuse_chmod_dummy,
 ++	.fo_chown     = fuse_chown_dummy,
 ++#endif
 + 	.fo_flags    = DFLAG_PASSABLE | DFLAG_SEEKABLE
 + };
 + 
 +@@ -799,8 +808,11 @@
   	struct vnode *vp = ap->a_vp;
   	struct vattr *vap = ap->a_vap;
   	struct ucred *cred = ap->a_cred;
 @@ -13,7 +36,7 @@
   	struct fuse_dispatcher fdi;
   	struct timespec uptsp;
   	int err = 0;
 -@@ -871,7 +874,11 @@
 +@@ -871,7 +883,11 @@
   fuse_access(ap)
   	struct vop_access_args /* {
   		struct vnode *a_vp;
 @@ -25,7 +48,7 @@
   		struct ucred *a_cred;
   		struct thread *a_td;
   	} */ *ap;
 -@@ -886,7 +893,13 @@
 +@@ -886,7 +902,13 @@
   	else
   		facp.facc_flags |= FACCESS_DO_ACCESS;
   
 @@ -40,7 +63,7 @@
   }
   
   /*
 -@@ -946,7 +959,11 @@
 +@@ -946,7 +968,11 @@
   		/* We are to do the check in-kernel */
   
   		if (! (facp->facc_flags & FACCESS_VA_VALID)) {
 @@ -53,7 +76,7 @@
   			if (err)
   				return (err);
   			facp->facc_flags |= FACCESS_VA_VALID;
 -@@ -1929,7 +1946,11 @@
 +@@ -1929,7 +1955,11 @@
   		 * It will not invalidate pages which are dirty, locked, under
   		 * writeback or mapped into pagetables.") 
   		 */
 @@ -65,7 +88,7 @@
   		fufh->flags |= FOPEN_KEEP_CACHE;
   	}
   
 -@@ -3005,8 +3026,11 @@
 +@@ -3005,8 +3035,11 @@
   	struct vattr *vap = ap->a_vap;
   	struct vnode *vp = ap->a_vp;
   	struct ucred *cred = ap->a_cred;
 @@ -78,3 +101,21 @@
   	int err = 0;
   	struct fuse_dispatcher fdi;
   	struct fuse_setattr_in *fsai;
 +@@ -3635,3 +3668,17 @@
 + 	return (0);
 + }
 + #endif
 ++
 ++#if __FreeBSD_version > 900040
 ++static int
 ++fuse_chmod_dummy(struct file *fp, mode_t mode,
 ++		 struct ucred *active_cred, struct thread *td) {
 ++  return (ENOSYS);
 ++}
 ++
 ++static int
 ++fuse_chown_dummy(struct file *fp, uid_t uid, gid_t gid,
 ++		 struct ucred *active_cred, struct thread *td) {
 ++  return (ENOSYS);
 ++}
 ++#endif
 
 --------------040504060902000602000602--



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