The patch "CIFS: Add support for direct I/O read" had
a signed/unsigned mismatch (ssize_t vs. size_t) in the
return from one function. Similar trivial change
in aio_write
Signed-off-by: Long Li <longli@microsoft.com>
Signed-off-by: Steve French <stfrench@microsoft.com>
Reported-by: Julia Lawall <julia.lawall@lip6.fr>
break;
if (ctx->direct_io) {
break;
if (ctx->direct_io) {
- cur_len = iov_iter_get_pages_alloc(
+ ssize_t result;
+
+ result = iov_iter_get_pages_alloc(
from, &pagevec, wsize, &start);
from, &pagevec, wsize, &start);
cifs_dbg(VFS,
"direct_writev couldn't get user pages "
"(rc=%zd) iter type %d iov_offset %zd "
"count %zd\n",
cifs_dbg(VFS,
"direct_writev couldn't get user pages "
"(rc=%zd) iter type %d iov_offset %zd "
"count %zd\n",
from->iov_offset, from->count);
dump_stack();
break;
}
from->iov_offset, from->count);
dump_stack();
break;
}
+ cur_len = (size_t)result;
iov_iter_advance(from, cur_len);
nr_pages =
iov_iter_advance(from, cur_len);
nr_pages =
cur_len = min_t(const size_t, len, rsize);
if (ctx->direct_io) {
cur_len = min_t(const size_t, len, rsize);
if (ctx->direct_io) {
- cur_len = iov_iter_get_pages_alloc(
+ result = iov_iter_get_pages_alloc(
&direct_iov, &pagevec,
cur_len, &start);
&direct_iov, &pagevec,
cur_len, &start);
cifs_dbg(VFS,
"couldn't get user pages (cur_len=%zd)"
" iter type %d"
" iov_offset %zd count %zd\n",
cifs_dbg(VFS,
"couldn't get user pages (cur_len=%zd)"
" iter type %d"
" iov_offset %zd count %zd\n",
- cur_len, direct_iov.type,
+ result, direct_iov.type,
direct_iov.iov_offset,
direct_iov.count);
dump_stack();
break;
}
direct_iov.iov_offset,
direct_iov.count);
dump_stack();
break;
}
+ cur_len = (size_t)result;
iov_iter_advance(&direct_iov, cur_len);
rdata = cifs_readdata_direct_alloc(
iov_iter_advance(&direct_iov, cur_len);
rdata = cifs_readdata_direct_alloc(