Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 13 May 2019 19:31:10 +0000 (UTC)
From:      Alan Somers <asomers@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-projects@freebsd.org
Subject:   svn commit: r347545 - in projects/fuse2: . sys/fs/fuse
Message-ID:  <201905131931.x4DJVAfn079517@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: asomers
Date: Mon May 13 19:31:09 2019
New Revision: 347545
URL: https://svnweb.freebsd.org/changeset/base/347545

Log:
  fusefs: remove the vfs.fusefs.fix_broken_io sysctl
  
  This looks like it may have been a workaround for a specific buggy FUSE
  filesystem.  However, there's no information about what that bug may have
  been, and the workaround is > 6.5 years old, so I consider the sysctl to be
  unmaintainable.
  
  Sponsored by:	The FreeBSD Foundation

Modified:
  projects/fuse2/UPDATING
  projects/fuse2/sys/fs/fuse/fuse_io.c
  projects/fuse2/sys/fs/fuse/fuse_ipc.h
  projects/fuse2/sys/fs/fuse/fuse_node.c
  projects/fuse2/sys/fs/fuse/fuse_vfsops.c

Modified: projects/fuse2/UPDATING
==============================================================================
--- projects/fuse2/UPDATING	Mon May 13 19:03:46 2019	(r347544)
+++ projects/fuse2/UPDATING	Mon May 13 19:31:09 2019	(r347545)
@@ -32,9 +32,14 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 13.x IS SLOW:
 	"ln -s 'abort:false,junk:false' /etc/malloc.conf".)
 
 20190513:
-	The "-o sync_unmount" and "-o init_backgrounded" options have been
-	removed from mount_fusefs(8).  You can safely remove them from your
-	scripts, because they had no effect.
+	The vfs.fusefs.sync_unmount and vfs.fusefs.init_backgrounded sysctls
+	and the "-o sync_unmount" and "-o init_backgrounded" mount options have
+	been removed from mount_fusefs(8).  You can safely remove them from
+	your scripts, because they had no effect.
+
+	The vfs.fusefs.fix_broken_io sysctl has been removed.  If you felt the
+	need to set it to a non-default value, please tell asomers@FreeBSD.org
+	why.
 
 20190507:
 	The IPSEC option has been removed from GENERIC.  Users requiring

Modified: projects/fuse2/sys/fs/fuse/fuse_io.c
==============================================================================
--- projects/fuse2/sys/fs/fuse/fuse_io.c	Mon May 13 19:03:46 2019	(r347544)
+++ projects/fuse2/sys/fs/fuse/fuse_io.c	Mon May 13 19:31:09 2019	(r347545)
@@ -776,11 +776,7 @@ fuse_io_strategy(struct vnode *vp, struct buf *bp)
 		uiop->uio_offset = ((off_t)bp->b_blkno) * biosize;
 		error = fuse_read_directbackend(vp, uiop, cred, fufh);
 
-		/* XXXCEM: Potentially invalid access to cached_attrs here */
-		if ((!error && uiop->uio_resid) ||
-		    (fsess_opt_brokenio(vnode_mount(vp)) && error == EIO &&
-		    uiop->uio_offset < fvdat->filesize && fvdat->filesize > 0 &&
-		    uiop->uio_offset >= fvdat->cached_attrs.va_size)) {
+		if (!error && uiop->uio_resid) {
 			/*
 	                 * If we had a short read with no error, we must have
 	                 * hit a file hole.  We should zero-fill the remainder.
@@ -792,14 +788,6 @@ fuse_io_strategy(struct vnode *vp, struct buf *bp)
 			int nread = bp->b_bcount - uiop->uio_resid;
 			int left = uiop->uio_resid;
 
-			if (error != 0) {
-				printf("FUSE: Fix broken io: offset %ju, "
-				       " resid %zd, file size %ju/%ju\n", 
-				       (uintmax_t)uiop->uio_offset,
-				    uiop->uio_resid, fvdat->filesize,
-				    fvdat->cached_attrs.va_size);
-				error = 0;
-			}
 			if (left > 0)
 				bzero((char *)bp->b_data + nread, left);
 			uiop->uio_resid = 0;

Modified: projects/fuse2/sys/fs/fuse/fuse_ipc.h
==============================================================================
--- projects/fuse2/sys/fs/fuse/fuse_ipc.h	Mon May 13 19:03:46 2019	(r347544)
+++ projects/fuse2/sys/fs/fuse/fuse_ipc.h	Mon May 13 19:31:09 2019	(r347545)
@@ -220,7 +220,6 @@ struct fuse_data {
 #define FSESS_NO_DATACACHE        0x0200 /* disable buffer cache */
 #define FSESS_NO_NAMECACHE        0x0400 /* disable name cache */
 #define FSESS_NO_MMAP             0x0800 /* disable mmap */
-#define FSESS_BROKENIO            0x1000 /* fix broken io */
 #define FSESS_POSIX_LOCKS         0x2000 /* daemon supports POSIX locks */
 
 enum fuse_data_cache_mode {
@@ -233,7 +232,6 @@ extern int fuse_data_cache_mode;
 extern int fuse_data_cache_invalidate;
 extern int fuse_mmap_enable;
 extern int fuse_sync_resize;
-extern int fuse_fix_broken_io;
 
 static inline struct fuse_data *
 fuse_get_mpdata(struct mount *mp)
@@ -274,14 +272,6 @@ fsess_opt_mmap(struct mount *mp)
 	if (!fuse_mmap_enable || fuse_data_cache_mode == FUSE_CACHE_UC)
 		return (false);
 	return ((data->dataflags & (FSESS_NO_DATACACHE | FSESS_NO_MMAP)) == 0);
-}
-
-static inline bool
-fsess_opt_brokenio(struct mount *mp)
-{
-	struct fuse_data *data = fuse_get_mpdata(mp);
-
-	return (fuse_fix_broken_io || (data->dataflags & FSESS_BROKENIO));
 }
 
 /* Insert a new upgoing message */

Modified: projects/fuse2/sys/fs/fuse/fuse_node.c
==============================================================================
--- projects/fuse2/sys/fs/fuse/fuse_node.c	Mon May 13 19:03:46 2019	(r347544)
+++ projects/fuse2/sys/fs/fuse/fuse_node.c	Mon May 13 19:31:09 2019	(r347545)
@@ -142,13 +142,6 @@ SYSCTL_INT(_vfs_fusefs, OID_AUTO, sync_resize, CTLFLAG
     "If a cached write extended a file, inform FUSE filesystem of the changed"
     "size immediately subsequent to the issued writes");
 
-int	fuse_fix_broken_io = 0;
-
-SYSCTL_INT(_vfs_fusefs, OID_AUTO, fix_broken_io, CTLFLAG_RW,
-    &fuse_fix_broken_io, 0,
-    "If non-zero, print a diagnostic warning if a userspace filesystem returns"
-    " EIO on reads of recently extended portions of files");
-
 static int
 sysctl_fuse_cache_mode(SYSCTL_HANDLER_ARGS)
 {

Modified: projects/fuse2/sys/fs/fuse/fuse_vfsops.c
==============================================================================
--- projects/fuse2/sys/fs/fuse/fuse_vfsops.c	Mon May 13 19:03:46 2019	(r347544)
+++ projects/fuse2/sys/fs/fuse/fuse_vfsops.c	Mon May 13 19:31:09 2019	(r347545)
@@ -273,7 +273,6 @@ fuse_vfsop_mount(struct mount *mp)
 	FUSE_FLAGOPT(no_datacache, FSESS_NO_DATACACHE);
 	FUSE_FLAGOPT(no_namecache, FSESS_NO_NAMECACHE);
 	FUSE_FLAGOPT(no_mmap, FSESS_NO_MMAP);
-	FUSE_FLAGOPT(brokenio, FSESS_BROKENIO);
 
 	(void)vfs_scanopt(opts, "max_read=", "%u", &max_read);
 	if (vfs_scanopt(opts, "timeout=", "%u", &daemon_timeout) == 1) {



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