Date: Wed, 1 Jul 2009 07:09:50 GMT From: Takeshi Taguchi <taguchi@iij.ad.jp> To: freebsd-gnats-submit@FreeBSD.org Subject: ports/136211: fix bug: sysutils/fusefs-kmod Message-ID: <200907010709.n6179oM7082280@www.freebsd.org> Resent-Message-ID: <200907010710.n617A2xW032788@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
>Number: 136211 >Category: ports >Synopsis: fix bug: sysutils/fusefs-kmod >Confidential: no >Severity: critical >Priority: medium >Responsible: freebsd-ports-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Wed Jul 01 07:10:02 UTC 2009 >Closed-Date: >Last-Modified: >Originator: Takeshi Taguchi >Release: 7.2-RELEASE-p2 >Organization: IIJ >Environment: FreeBSD fbsd-amd64-72 7.2-RELEASE-p2 FreeBSD 7.2-RELEASE-p2 #0: Tru Jun 30 14:54:41 JST 2009 root#fbsd-amd64-72:/usr/obj/usr/src/sys/GENERIC amd64 >Description: fusefs-kmod has a bug. This bug is described in: http://fuse4bsd.creo.hu/darcsweb/darcsweb.cgi?r=fuse4bsd;a=commit;h=20090226212158-29619-f5fbe1f545c85669c0e8e9047b76756a82960803.gz but FreeBSD port one does not fix yet. >How-To-Repeat: >Fix: would you like to check and commit this patch. thanks. Patch attached with submission follows: diff -ur fusefs-kmod.orig/Makefile fusefs-kmod/Makefile --- fusefs-kmod.orig/Makefile 2009-07-01 15:58:09.000000000 +0900 +++ fusefs-kmod/Makefile 2009-07-01 15:58:40.000000000 +0900 @@ -7,7 +7,7 @@ PORTNAME= fusefs DISTVERSION= 0.3.9-pre1.20080208 -PORTREVISION= 5 +PORTREVISION= 6 CATEGORIES= sysutils kld MASTER_SITES= http://mercurial.creo.hu/repos/fuse4bsd-hg/index.cgi/archive/ PKGNAMESUFFIX= -kmod diff -ur fusefs-kmod.orig/files/patch-fuse_module__fuse_io.c fusefs-kmod/files/patch-fuse_module__fuse_io.c --- fusefs-kmod.orig/files/patch-fuse_module__fuse_io.c 2009-07-01 15:58:09.000000000 +0900 +++ fusefs-kmod/files/patch-fuse_module__fuse_io.c 2009-07-01 15:58:25.000000000 +0900 @@ -1,5 +1,5 @@ ---- fuse_module/fuse_io.c.orig 2008-02-05 00:25:57.000000000 -0500 -+++ fuse_module/fuse_io.c 2008-09-26 13:15:56.000000000 -0400 +--- fuse_module/fuse_io.c.orig 2008-02-05 14:25:57.000000000 +0900 ++++ fuse_module/fuse_io.c 2009-07-01 15:45:23.000000000 +0900 @@ -157,7 +157,11 @@ goto out; @@ -13,6 +13,71 @@ goto out; uio->uio_offset = va.va_size; } else if ((flags & FOF_OFFSET) == 0) +@@ -227,7 +231,7 @@ + return (0); + + biosize = vp->v_mount->mnt_stat.f_iosize; +- bcount = min(MAXBSIZE, biosize); ++ bcount = MIN(MAXBSIZE, biosize); + + DEBUG2G("entering loop\n"); + do { +@@ -352,7 +356,7 @@ + fri = fdi.indata; + fri->fh = fufh->fh_id; + fri->offset = uio->uio_offset; +- fri->size = min(uio->uio_resid, ++ fri->size = MIN(uio->uio_resid, + fusefs_get_data(vp->v_mount)->max_read); + + DEBUG2G("fri->fh %llu, fri->offset %d, fri->size %d\n", +@@ -399,7 +403,7 @@ + while (uio->uio_resid > 0) { + int transfersize; + +- chunksize = min(iov->iov_len, nmax); ++ chunksize = MIN(iov->iov_len, nmax); + + if (uio->uio_rw == UIO_READ) { + struct fuse_read_in *fri; +@@ -464,7 +468,7 @@ + { + int err; + +- if ((err = uiomove(buf, min(reqsize, bufsize), uio))) ++ if ((err = uiomove(buf, MIN(reqsize, bufsize), uio))) + return (err); + + if (bufsize < reqsize) +@@ -502,7 +506,7 @@ + } + + while (uio->uio_resid > 0) { +- chunksize = min(uio->uio_resid, ++ chunksize = MIN(uio->uio_resid, + fusefs_get_data(vp->v_mount)->max_write); + + fdi.iosize = sizeof(*fwi) + chunksize; +@@ -569,7 +573,7 @@ + do { + lbn = uio->uio_offset / biosize; + on = uio->uio_offset & (biosize-1); +- n = min((unsigned)(biosize - on), uio->uio_resid); ++ n = MIN((unsigned)(biosize - on), uio->uio_resid); + + 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 +743,8 @@ + */ + if (n) { + if (bp->b_dirtyend > 0) { +- bp->b_dirtyoff = min(on, bp->b_dirtyoff); +- bp->b_dirtyend = max((on + n), bp->b_dirtyend); ++ bp->b_dirtyoff = MIN(on, bp->b_dirtyoff); ++ bp->b_dirtyend = MAX((on + n), bp->b_dirtyend); + } else { + bp->b_dirtyoff = on; + bp->b_dirtyend = on + n; @@ -823,7 +827,11 @@ #if FUSELIB_CONFORM_BIOREAD struct vattr va; @@ -26,3 +91,32 @@ goto out; #endif +@@ -831,7 +839,7 @@ + bp->b_resid = bp->b_bcount; + while (bp->b_resid > 0) { + DEBUG2G("starting bio with resid %ld\n", bp->b_resid); +- chunksize = min(bp->b_resid, ++ chunksize = MIN(bp->b_resid, + fusefs_get_data(vp->v_mount)->max_read); + fdi.iosize = sizeof(*fri); + if (! op) +@@ -842,8 +850,8 @@ + fri->fh = fufh->fh_id; + fri->offset = ((off_t)bp->b_blkno) * biosize + ioff; + #if FUSELIB_CONFORM_BIOREAD +- chunksize = min(chunksize, +- min(fri->offset + bp->b_resid, ++ chunksize = MIN(chunksize, ++ MIN(fri->offset + bp->b_resid, + va.va_size) - fri->offset); + if (chunksize == 0) { + respsize = -1; +@@ -901,7 +909,7 @@ + + bufdat = bp->b_data + bp->b_dirtyoff; + while (bp->b_dirtyend > bp->b_dirtyoff) { +- chunksize = min(bp->b_dirtyend - bp->b_dirtyoff, ++ chunksize = MIN(bp->b_dirtyend - bp->b_dirtyoff, + fusefs_get_data(vp->v_mount)->max_write); + + fdi.iosize = sizeof(*fwi); >Release-Note: >Audit-Trail: >Unformatted:
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200907010709.n6179oM7082280>