Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 30 Jan 2006 22:41:19 +0100 (CET)
From:      Csaba Henk <csaba.henk@creo.hu>
To:        FreeBSD-gnats-submit@FreeBSD.org
Subject:   ports/92568: [PATCH] ntfsprogs FUSE interface upgrade
Message-ID:  <200601302141.k0ULfJKu008870@beastie.creo.hu>
Resent-Message-ID: <200601302150.k0ULo5An096851@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         92568
>Category:       ports
>Synopsis:       [PATCH] ntfsprogs FUSE interface upgrade
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Mon Jan 30 21:50:05 GMT 2006
>Closed-Date:
>Last-Modified:
>Originator:     Csaba Henk
>Release:        FreeBSD 6.0-STABLE i386
>Organization:
creo.hu
>Environment:
System: FreeBSD beastie.creo.hu 6.0-STABLE FreeBSD 6.0-STABLE #0: Sun Jan 29 09:29:13 CET 2006 toor@beastie.creo.hu:/usr/obj/usr/src/sys/HCS i386
>Description:
	sysutils/fusefs-libs has been upgraded and ntfsprogs' FUSE based
	fs driver (ntfsmount) doesn't compile against the new version.
	The attached patch will make it compile against recent
	sysutils/fusefs-libs versions (2.5.0, 2.5.1)
>How-To-Repeat:
>Fix:




diff -ruN ntfsprogs.orig/Makefile ntfsprogs/Makefile
--- ntfsprogs.orig/Makefile	Wed Nov 23 12:43:13 2005
+++ ntfsprogs/Makefile	Sun Jan 29 16:23:39 2006
@@ -61,6 +61,7 @@
 PLIST_SUB+=	FUSE=""
 LIB_DEPENDS+=	fuse.2:${PORTSDIR}/sysutils/fusefs-libs
 MLINKS+=	ntfsmount.8 mount.ntfs-fuse.8
+CONFLICTS=      fusefs-kmod-0.2.19*
 .else
 CONFIGURE_ARGS+=--disable-fuse-module
 PLIST_SUB+=	FUSE="@comment "
diff -ruN ntfsprogs.orig/files/patch-ntfsprogs_ntfsmount.c ntfsprogs/files/patch-ntfsprogs_ntfsmount.c
--- ntfsprogs.orig/files/patch-ntfsprogs_ntfsmount.c	Wed Nov 23 12:43:13 2005
+++ ntfsprogs/files/patch-ntfsprogs_ntfsmount.c	Sun Jan 29 16:22:10 2006
@@ -1,14 +1,103 @@
---- ntfsprogs/ntfsmount.c.orig	Wed Nov 23 12:33:56 2005
-+++ ntfsprogs/ntfsmount.c	Wed Nov 23 12:32:15 2005
-@@ -228,7 +228,11 @@
+--- ntfsprogs/Makefile.am.orig	Sat Oct  8 00:35:40 2005
++++ ntfsprogs/Makefile.am	Fri Jan 20 11:26:37 2006
+@@ -88,7 +88,7 @@
+ ntfsmount_SOURCES	= ntfsmount.c utils.c utils.h
+ ntfsmount_LDADD		= $(AM_LIBS) $(FUSE_MODULE_LIBS)
+ ntfsmount_LDFLAGS	= $(AM_LFLAGS)
+-ntfsmount_CFLAGS	= $(FUSE_MODULE_CFLAGS) -DFUSE_USE_VERSION=22
++ntfsmount_CFLAGS	= $(FUSE_MODULE_CFLAGS) -DFUSE_USE_VERSION=25
+ endif
+ 
+ # We don't distribute these
+--- ntfsprogs/Makefile.in.orig	Fri Jan 20 11:24:48 2006
++++ ntfsprogs/Makefile.in	Fri Jan 20 11:26:40 2006
+@@ -366,7 +366,7 @@
+ @ENABLE_FUSE_MODULE_TRUE@ntfsmount_SOURCES = ntfsmount.c utils.c utils.h
+ @ENABLE_FUSE_MODULE_TRUE@ntfsmount_LDADD = $(AM_LIBS) $(FUSE_MODULE_LIBS)
+ @ENABLE_FUSE_MODULE_TRUE@ntfsmount_LDFLAGS = $(AM_LFLAGS)
+-@ENABLE_FUSE_MODULE_TRUE@ntfsmount_CFLAGS = $(FUSE_MODULE_CFLAGS) -DFUSE_USE_VERSION=22
++@ENABLE_FUSE_MODULE_TRUE@ntfsmount_CFLAGS = $(FUSE_MODULE_CFLAGS) -DFUSE_USE_VERSION=25
+ 
+ # We don't distribute these
+ ntfsrm_SOURCES = ntfsrm.c ntfsrm.h utils.c utils.h
+--- ntfsprogs/ntfsmount.c.orig	Mon Oct 10 14:47:38 2005
++++ ntfsprogs/ntfsmount.c	Fri Jan 20 11:42:09 2006
+@@ -81,10 +81,10 @@
+ 	int state;
+ 	long free_clusters;
+ 	long free_mft;
+-	uid_t uid;
+-	gid_t gid;
+-	mode_t fmask;
+-	mode_t dmask;
++	unsigned int uid;
++	unsigned int gid;
++	unsigned int fmask;
++	unsigned int dmask;
+ 	BOOL ro;
+ 	BOOL show_sys_files;
+ 	BOOL succeed_chmod;
+@@ -196,7 +196,7 @@
+  * Return 0 on success or -errno on error.
+  */
+ static int ntfs_fuse_statfs(const char *path __attribute__((unused)),
+-		struct statfs *sfs)
++		struct statvfs *sfs)
+ {
+ 	long size;
+ 	ntfs_volume *vol;
+@@ -204,10 +204,10 @@
+ 	vol = ctx->vol;
+ 	if (!vol)
+ 		return -ENODEV;
+-	/* Type of filesystem. */
+-	sfs->f_type = NTFS_SB_MAGIC;
+ 	/* Optimal transfer block size. */
+ 	sfs->f_bsize = vol->cluster_size;
++	/* XXX This field needs to be filled, I guess it's fine this way... */
++	sfs->f_frsize = vol->cluster_size;
+ 	/*
+ 	 * Total data blocks in file system in units of f_bsize and since
+ 	 * inodes are also stored in data blocs ($MFT is a file) this is just
+@@ -228,7 +228,7 @@
  		size = 0;
  	sfs->f_ffree = size;
  	/* Maximum length of filenames. */
-+#ifdef __FreeBSD__
+-	sfs->f_namelen = NTFS_MAX_NAME_LEN;
 +	sfs->f_namemax = NTFS_MAX_NAME_LEN;
-+#else
- 	sfs->f_namelen = NTFS_MAX_NAME_LEN;
-+#endif
  	return 0;
  }
  
+@@ -1462,8 +1462,9 @@
+ int main(int argc, char *argv[])
+ {
+ 	char *parsed_options;
++	struct fuse_args margs = FUSE_ARGS_INIT(0, NULL);
+ 	struct fuse *fh;
+-	int ffd;
++	int ffd = 0;
+ 
+ 	utils_set_locale();
+ 	signal(SIGINT, signal_handler);
+@@ -1491,7 +1492,20 @@
+ 	}
+ 	free(opts.device);
+ 	/* Create filesystem. */
+-	ffd = fuse_mount(opts.mnt_point, parsed_options);
++	/*
++	 * XXX Eventually, ntfsmount should drop it's homebrew option parsing
++	 * routines and use stock ones. Here we don't go that far, we just use the
++	 * FUSE opt parsing API to dummily create the structure which satisfies
++	 * fuse_mount's current signature (that is, revert all the work which
++	 * has been accomplished by the homebrew routine... silly, eh?).
++	 */
++	if ((fuse_opt_add_arg(&margs, "") == -1 ||
++	     fuse_opt_add_arg(&margs, "-o") == -1 ||
++	     fuse_opt_add_arg(&margs, parsed_options) == -1))
++		ffd = -1;
++	if (ffd != -1)
++		ffd = fuse_mount(opts.mnt_point, &margs);
++	fuse_opt_free_args(&margs);
+ 	if (ffd == -1) {
+ 		Eprintf("fuse_mount failed.\n");
+ 		ntfs_fuse_destroy();
>Release-Note:
>Audit-Trail:
>Unformatted:



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