@@ -104,6 +104,9 @@ static ssize_t __iter_get_bvecs(struct iov_iter *iter, size_t maxsize,
min_t(int, bytes, PAGE_SIZE - start),
start);
+ /* Is iov_iter_get_pages() using GUP ? */
+ if (iov_iter_get_pages_use_gup(iter))
+ bvec_set_gup_page(&bv, pages[idx]);
bvecs[bvec_idx] = bv;
bytes -= bv.bv_len;
start = 0;
@@ -883,7 +883,11 @@ setup_aio_ctx_iter(struct cifs_aio_ctx *ctx, struct iov_iter *iter, int rw)
for (i = 0; i < cur_npages; i++) {
len = rc > PAGE_SIZE ? PAGE_SIZE : rc;
- bvec_set_page(&bv[npages + i], pages[i]);
+ /* Is iov_iter_get_pages() using GUP ? */
+ if (iov_iter_get_pages_use_gup(iter))
+ bvec_set_gup_page(&bv[npages + i], pages[i]);
+ else
+ bvec_set_page(&bv[npages + i], pages[i]);
bv[npages + i].bv_offset = start;
bv[npages + i].bv_len = len - start;
rc -= len;