Commit b98e26df authored by Steve French's avatar Steve French
Browse files

cifs: fix signed/unsigned mismatch on aio_read patch



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: default avatarLong Li <longli@microsoft.com>
Signed-off-by: default avatarSteve French <stfrench@microsoft.com>
Reported-by: default avatarJulia Lawall <julia.lawall@lip6.fr>
parent 8c6c9bed
Loading
Loading
Loading
Loading
+11 −6
Original line number Original line Diff line number Diff line
@@ -2625,18 +2625,21 @@ cifs_write_from_iter(loff_t offset, size_t len, struct iov_iter *from,
			break;
			break;


		if (ctx->direct_io) {
		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);
			if (cur_len < 0) {
			if (result < 0) {
				cifs_dbg(VFS,
				cifs_dbg(VFS,
					"direct_writev couldn't get user pages "
					"direct_writev couldn't get user pages "
					"(rc=%zd) iter type %d iov_offset %zd "
					"(rc=%zd) iter type %d iov_offset %zd "
					"count %zd\n",
					"count %zd\n",
					cur_len, from->type,
					result, from->type,
					from->iov_offset, from->count);
					from->iov_offset, from->count);
				dump_stack();
				dump_stack();
				break;
				break;
			}
			}
			cur_len = (size_t)result;
			iov_iter_advance(from, cur_len);
			iov_iter_advance(from, cur_len);


			nr_pages =
			nr_pages =
@@ -3322,21 +3325,23 @@ cifs_send_async_read(loff_t offset, size_t len, struct cifsFileInfo *open_file,
		cur_len = min_t(const size_t, len, rsize);
		cur_len = min_t(const size_t, len, rsize);


		if (ctx->direct_io) {
		if (ctx->direct_io) {
			ssize_t result;


			cur_len = iov_iter_get_pages_alloc(
			result = iov_iter_get_pages_alloc(
					&direct_iov, &pagevec,
					&direct_iov, &pagevec,
					cur_len, &start);
					cur_len, &start);
			if (cur_len < 0) {
			if (result < 0) {
				cifs_dbg(VFS,
				cifs_dbg(VFS,
					"couldn't get user pages (cur_len=%zd)"
					"couldn't get user pages (cur_len=%zd)"
					" iter type %d"
					" iter type %d"
					" iov_offset %zd count %zd\n",
					" iov_offset %zd count %zd\n",
					cur_len, direct_iov.type,
					result, direct_iov.type,
					direct_iov.iov_offset,
					direct_iov.iov_offset,
					direct_iov.count);
					direct_iov.count);
				dump_stack();
				dump_stack();
				break;
				break;
			}
			}
			cur_len = (size_t)result;
			iov_iter_advance(&direct_iov, cur_len);
			iov_iter_advance(&direct_iov, cur_len);


			rdata = cifs_readdata_direct_alloc(
			rdata = cifs_readdata_direct_alloc(