aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--fs/cifs/file.c17
1 files changed, 11 insertions, 6 deletions
diff --git a/fs/cifs/file.c b/fs/cifs/file.c
index 937ffa79066b..74c33d5fafc8 100644
--- a/fs/cifs/file.c
+++ b/fs/cifs/file.c
@@ -2625,18 +2625,21 @@ cifs_write_from_iter(loff_t offset, size_t len, struct iov_iter *from,
2625 break; 2625 break;
2626 2626
2627 if (ctx->direct_io) { 2627 if (ctx->direct_io) {
2628 cur_len = iov_iter_get_pages_alloc( 2628 ssize_t result;
2629
2630 result = iov_iter_get_pages_alloc(
2629 from, &pagevec, wsize, &start); 2631 from, &pagevec, wsize, &start);
2630 if (cur_len < 0) { 2632 if (result < 0) {
2631 cifs_dbg(VFS, 2633 cifs_dbg(VFS,
2632 "direct_writev couldn't get user pages " 2634 "direct_writev couldn't get user pages "
2633 "(rc=%zd) iter type %d iov_offset %zd " 2635 "(rc=%zd) iter type %d iov_offset %zd "
2634 "count %zd\n", 2636 "count %zd\n",
2635 cur_len, from->type, 2637 result, from->type,
2636 from->iov_offset, from->count); 2638 from->iov_offset, from->count);
2637 dump_stack(); 2639 dump_stack();
2638 break; 2640 break;
2639 } 2641 }
2642 cur_len = (size_t)result;
2640 iov_iter_advance(from, cur_len); 2643 iov_iter_advance(from, cur_len);
2641 2644
2642 nr_pages = 2645 nr_pages =
@@ -3322,21 +3325,23 @@ cifs_send_async_read(loff_t offset, size_t len, struct cifsFileInfo *open_file,
3322 cur_len = min_t(const size_t, len, rsize); 3325 cur_len = min_t(const size_t, len, rsize);
3323 3326
3324 if (ctx->direct_io) { 3327 if (ctx->direct_io) {
3328 ssize_t result;
3325 3329
3326 cur_len = iov_iter_get_pages_alloc( 3330 result = iov_iter_get_pages_alloc(
3327 &direct_iov, &pagevec, 3331 &direct_iov, &pagevec,
3328 cur_len, &start); 3332 cur_len, &start);
3329 if (cur_len < 0) { 3333 if (result < 0) {
3330 cifs_dbg(VFS, 3334 cifs_dbg(VFS,
3331 "couldn't get user pages (cur_len=%zd)" 3335 "couldn't get user pages (cur_len=%zd)"
3332 " iter type %d" 3336 " iter type %d"
3333 " iov_offset %zd count %zd\n", 3337 " iov_offset %zd count %zd\n",
3334 cur_len, direct_iov.type, 3338 result, direct_iov.type,
3335 direct_iov.iov_offset, 3339 direct_iov.iov_offset,
3336 direct_iov.count); 3340 direct_iov.count);
3337 dump_stack(); 3341 dump_stack();
3338 break; 3342 break;
3339 } 3343 }
3344 cur_len = (size_t)result;
3340 iov_iter_advance(&direct_iov, cur_len); 3345 iov_iter_advance(&direct_iov, cur_len);
3341 3346
3342 rdata = cifs_readdata_direct_alloc( 3347 rdata = cifs_readdata_direct_alloc(