FreeBSD Bugzilla – Attachment 183775 Details for
Bug 220185
>> operator does not append in Fuse mounts
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Completely untested patch for the issue
pr-220185.patch (text/plain), 3.33 KB, created by
Conrad Meyer
on 2017-06-25 02:05:13 UTC
(
hide
)
Description:
Completely untested patch for the issue
Filename:
MIME Type:
Creator:
Conrad Meyer
Created:
2017-06-25 02:05:13 UTC
Size:
3.33 KB
patch
obsolete
>diff --git a/sys/fs/fuse/fuse_io.c b/sys/fs/fuse/fuse_io.c >index 5ffeb88779fb..1497220e7225 100644 >--- a/sys/fs/fuse/fuse_io.c >+++ b/sys/fs/fuse/fuse_io.c >@@ -101,21 +101,21 @@ __FBSDID("$FreeBSD$"); > > > static int > fuse_read_directbackend(struct vnode *vp, struct uio *uio, > struct ucred *cred, struct fuse_filehandle *fufh); > static int > fuse_read_biobackend(struct vnode *vp, struct uio *uio, > struct ucred *cred, struct fuse_filehandle *fufh); > static int > fuse_write_directbackend(struct vnode *vp, struct uio *uio, >- struct ucred *cred, struct fuse_filehandle *fufh); >+ struct ucred *cred, struct fuse_filehandle *fufh, int ioflag); > static int > fuse_write_biobackend(struct vnode *vp, struct uio *uio, > struct ucred *cred, struct fuse_filehandle *fufh, int ioflag); > > int > fuse_io_dispatch(struct vnode *vp, struct uio *uio, int ioflag, > struct ucred *cred) > { > struct fuse_filehandle *fufh; > int err, directio; >@@ -149,21 +149,21 @@ fuse_io_dispatch(struct vnode *vp, struct uio *uio, int ioflag, > } else { > FS_DEBUG("buffered read of vnode %ju\n", > (uintmax_t)VTOILLU(vp)); > err = fuse_read_biobackend(vp, uio, cred, fufh); > } > break; > case UIO_WRITE: > if (directio) { > FS_DEBUG("direct write of vnode %ju via file handle %ju\n", > (uintmax_t)VTOILLU(vp), (uintmax_t)fufh->fh_id); >- err = fuse_write_directbackend(vp, uio, cred, fufh); >+ err = fuse_write_directbackend(vp, uio, cred, fufh, ioflag); > } else { > FS_DEBUG("buffered write of vnode %ju\n", > (uintmax_t)VTOILLU(vp)); > err = fuse_write_biobackend(vp, uio, cred, fufh, ioflag); > } > break; > default: > panic("uninterpreted mode passed to fuse_io_dispatch"); > } > >@@ -311,31 +311,33 @@ fuse_read_directbackend(struct vnode *vp, struct uio *uio, > break; > } > > out: > fdisp_destroy(&fdi); > return (err); > } > > static int > fuse_write_directbackend(struct vnode *vp, struct uio *uio, >- struct ucred *cred, struct fuse_filehandle *fufh) >+ struct ucred *cred, struct fuse_filehandle *fufh, int ioflag) > { > struct fuse_vnode_data *fvdat = VTOFUD(vp); > struct fuse_write_in *fwi; > struct fuse_dispatcher fdi; > size_t chunksize; > int diff; > int err = 0; > >- if (!uio->uio_resid) >+ if (uio->uio_resid == 0) > return (0); >+ if (ioflag & IO_APPEND) >+ uio_setoffset(uio, fvdat->filesize); > > fdisp_init(&fdi, 0); > > while (uio->uio_resid > 0) { > chunksize = MIN(uio->uio_resid, > fuse_get_mpdata(vp->v_mount)->max_write); > > fdi.iosize = sizeof(*fwi) + chunksize; > fdisp_make_vp(&fdi, FUSE_WRITE, vp, uio->uio_td, cred); > >@@ -698,21 +700,21 @@ fuse_io_strategy(struct vnode *vp, struct buf *bp) > (off_t)bp->b_blkno * biosize; > > if (bp->b_dirtyend > bp->b_dirtyoff) { > io.iov_len = uiop->uio_resid = bp->b_dirtyend > - bp->b_dirtyoff; > uiop->uio_offset = (off_t)bp->b_blkno * biosize > + bp->b_dirtyoff; > io.iov_base = (char *)bp->b_data + bp->b_dirtyoff; > uiop->uio_rw = UIO_WRITE; > >- error = fuse_write_directbackend(vp, uiop, cred, fufh); >+ error = fuse_write_directbackend(vp, uiop, cred, fufh, 0); > > if (error == EINTR || error == ETIMEDOUT > || (!error && (bp->b_flags & B_NEEDCOMMIT))) { > > bp->b_flags &= ~(B_INVAL | B_NOCACHE); > if ((bp->b_flags & B_PAGING) == 0) { > bdirty(bp); > bp->b_flags &= ~B_DONE; > } > if ((error == EINTR || error == ETIMEDOUT) &&
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 220185
: 183775