diff options
-rw-r--r-- | kernel/fuse_dev.c | 10 | ||||
-rw-r--r-- | kernel/fuse_vnops.c | 23 |
2 files changed, 18 insertions, 15 deletions
diff --git a/kernel/fuse_dev.c b/kernel/fuse_dev.c index 6ed55ef..e5f963c 100644 --- a/kernel/fuse_dev.c +++ b/kernel/fuse_dev.c @@ -317,7 +317,7 @@ fuse_dev_read(dev_t dev, struct uio *uiop, cred_t *credp) * Check if there is enough room to copy all data from this * iovbuf */ - if (uiop->uio_resid < msgp->ipdata.iovbuf[i].len) { + if ((size_t)uiop->uio_resid < msgp->ipdata.iovbuf[i].len) { DTRACE_PROBE2(fuse_dev_read_err_no_space, char *, "Buffer too small for request data", fuse_session_t *, sep); @@ -341,7 +341,8 @@ fuse_dev_read(dev_t dev, struct uio *uiop, cred_t *credp) static int fuse_ohead_audit(struct fuse_out_header *ohead, struct uio *uio) { - if (uio->uio_resid + sizeof (struct fuse_out_header) != ohead->len) { + if ((size_t)uio->uio_resid + sizeof (struct fuse_out_header) + != ohead->len) { DTRACE_PROBE3(fuse_ohead_audit_err_header, char *, "Invalid length in header", struct uio *, uio, @@ -462,7 +463,7 @@ fuse_dev_write(dev_t dev, struct uio *uiop, cred_t *cred_p) iovbuf = &msg_p->opdata.iovbuf; if (iovbuf->memsize && - iovbuf->memsize < uiop->uio_resid && + iovbuf->memsize < (size_t)uiop->uio_resid && iovbuf->memflag == MEM_TYPE_KMEM) { kmem_free(iovbuf->base, iovbuf->memsize); iovbuf->memsize = 0; @@ -472,7 +473,8 @@ fuse_dev_write(dev_t dev, struct uio *uiop, cred_t *cred_p) fuse_buf_alloc(iovbuf, uiop->uio_resid); } - iovbuf->len = min(iovbuf->memsize, uiop->uio_resid); + iovbuf->len = min(iovbuf->memsize, + (size_t)uiop->uio_resid); /* Save the start and length of arguments */ msg_p->opdata.outdata = iovbuf->base; diff --git a/kernel/fuse_vnops.c b/kernel/fuse_vnops.c index bd7ad9e..83dad20 100644 --- a/kernel/fuse_vnops.c +++ b/kernel/fuse_vnops.c @@ -1026,7 +1026,7 @@ rdfuse(struct vnode *vp, struct uio *uiop, struct cred *credp) /* Calculate offset within a page that must be read */ off = uiop->uio_loffset; pageoffset = off & PAGEOFFSET; - len = MIN(PAGESIZE - pageoffset, uiop->uio_resid); + len = MIN(PAGESIZE - pageoffset, (size_t)uiop->uio_resid); /* Check if we are crossing end of file */ diff = fsize - off; @@ -1058,7 +1058,7 @@ rdfuse(struct vnode *vp, struct uio *uiop, struct cred *credp) (void) segmap_release(segkmap, base, 0); } while (err == 0 && uiop->uio_resid > 0); - if (uiop->uio_resid != req_len) + if ((ulong_t)uiop->uio_resid != req_len) err = 0; return (err); @@ -1094,7 +1094,7 @@ wrfuse(struct vnode *vp, struct uio *uiop, int ioflag, if (limit == RLIM64_INFINITY || limit > MAXOFFSET_T) limit = MAXOFFSET_T; - if (uiop->uio_loffset >= limit) { + if ((rlim64_t)uiop->uio_loffset >= limit) { proc_t *p = ttoproc(curthread); mutex_enter(&p->p_lock); @@ -1122,7 +1122,7 @@ wrfuse(struct vnode *vp, struct uio *uiop, int ioflag, do { uoff = uiop->uio_offset; pageoff = uoff & (u_offset_t)PAGEOFFSET; - bytes = MIN(PAGESIZE - pageoff, uiop->uio_resid); + bytes = MIN(PAGESIZE - pageoff, (size_t)uiop->uio_resid); if (uoff + bytes >= limit) { if (uoff >= limit) { @@ -1138,8 +1138,8 @@ wrfuse(struct vnode *vp, struct uio *uiop, int ioflag, * 2. When the file is yet to be written to or of zero size. * 3. When we are extending the file from a new page */ - pagecreate = (bytes == PAGESIZE) | (fsize == 0) | - ((pageoff == 0) && (fsize <= uiop->uio_offset)); + pagecreate = (bytes == (ssize_t)PAGESIZE) | (fsize == 0) | + ((pageoff == 0) && (fsize <= (u_offset_t)uiop->uio_offset)); if (uoff + bytes > fsize) { file_size_change = 1; @@ -1180,7 +1180,7 @@ wrfuse(struct vnode *vp, struct uio *uiop, int ioflag, * write valid data. */ if (pagecreate && - uiop->uio_offset < P2ROUNDUP(uoff + bytes, + (size_t)uiop->uio_offset < P2ROUNDUP(uoff + bytes, PAGESIZE)) { long zoffset; long nmoved; @@ -1188,7 +1188,8 @@ wrfuse(struct vnode *vp, struct uio *uiop, int ioflag, nmoved = uiop->uio_offset - uoff; ASSERT((nmoved + pageoff) <= PAGESIZE); - if ((zoffset = pageoff + nmoved) < PAGESIZE) + if ((size_t)(zoffset = pageoff + nmoved) + < PAGESIZE) (void) kzero( base + segmap_offset + zoffset, (size_t)PAGESIZE - zoffset); @@ -2457,7 +2458,7 @@ fuse_perform_read(struct fuse_io_data *fiodata) fri = (struct fuse_read_in *)msgp->ipdata.indata; fri->fh = fh->fh_id; fri->offset = uiop->uio_offset; - fri->size = MIN(uiop->uio_resid, + fri->size = MIN((size_t)uiop->uio_resid, PAGESIZE * FUSE_MAX_PAGES_PER_REQ); if ((err = fuse_queue_request_wait(sep, msgp))) { @@ -3234,7 +3235,7 @@ fuse_space(vnode_t *vp, int cmd, struct flock64 *bfp, int flag, va.va_mask = AT_SIZE; error = VOP_GETATTR(vp, &va, 0, cr, ct); - if (error || va.va_size == bfp->l_start) { + if (error || va.va_size == (u_offset_t)bfp->l_start) { /* * do not update ctime/mtime if truncate * to previous size, just exit @@ -3401,7 +3402,7 @@ fuse_putpage(struct vnode *vp, offset_t off, size_t len, int flags, return (err); } - eoff = MIN(off + len, fsize); + eoff = MIN((u_offset_t)(off + len), fsize); for (io_off = off; io_off < eoff; io_off += io_len) { /* |