linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Al Viro <viro@ZenIV.linux.org.uk>
To: Stefano Stabellini <sstabellini@kernel.org>
Cc: v9fs-developer@lists.sourceforge.net, ericvh@gmail.com,
	rminnich@sandia.gov, lucho@ionkov.net,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 4/5] 9p: introduce async read requests
Date: Sat, 10 Dec 2016 01:50:59 +0000	[thread overview]
Message-ID: <20161210015059.GD1555@ZenIV.linux.org.uk> (raw)
In-Reply-To: <1481230746-16741-4-git-send-email-sstabellini@kernel.org>

On Thu, Dec 08, 2016 at 12:59:05PM -0800, Stefano Stabellini wrote:


> +		} else {
> +			req = p9_client_get_req(clnt, P9_TREAD, "dqd", fid->fid, offset, rsize);
> +			if (IS_ERR(req)) {
> +				*err = PTR_ERR(req);
> +				break;
> +			}
> +			req->rsize = iov_iter_get_pages_alloc(to, &req->pagevec, 
> +					(size_t)rsize, &req->offset);
> +			req->kiocb = iocb;
> +			for (i = 0; i < req->rsize; i += PAGE_SIZE)
> +				page_cache_get_speculative(req->pagevec[i/PAGE_SIZE]);
> +			req->callback = p9_client_read_complete;
> +
> +			*err = clnt->trans_mod->request(clnt, req);
> +			if (*err < 0) {
> +				clnt->status = Disconnected;
> +				release_pages(req->pagevec,
> +						(req->rsize + PAGE_SIZE - 1) / PAGE_SIZE,
> +						true);
> +				kvfree(req->pagevec);
> +				p9_free_req(clnt, req);
> +				break;
> +			}
> +
> +			*err = -EIOCBQUEUED;

IDGI.  AFAICS, your code will result in shitloads of short reads - every
time when you give it a multi-iovec array, only the first one will be
issued and the rest won't be even looked at.  Sure, it is technically
legal, but I very much doubt that aio users will be happy with that.

What am I missing here?

  parent reply	other threads:[~2016-12-10  1:51 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-12-08 20:58 [PATCH 0/5] async requests support for 9pfs Stefano Stabellini
2016-12-08 20:59 ` [PATCH 1/5] 9p: add iocb parameter to p9_client_read and p9_client_write Stefano Stabellini
2016-12-08 20:59   ` [PATCH 2/5] 9p: store req details and callback in struct p9_req_t Stefano Stabellini
2016-12-09  7:18     ` [V9fs-developer] " Dominique Martinet
2016-12-09 23:24       ` Stefano Stabellini
2016-12-08 20:59   ` [PATCH 3/5] 9p: introduce p9_client_get_req Stefano Stabellini
2016-12-08 20:59   ` [PATCH 4/5] 9p: introduce async read requests Stefano Stabellini
2016-12-09  7:27     ` [V9fs-developer] " Dominique Martinet
2016-12-09 22:22       ` Stefano Stabellini
2016-12-10  1:50     ` Al Viro [this message]
2016-12-13  1:15       ` Stefano Stabellini
2016-12-13 14:29         ` Latchesar Ionkov
2016-12-08 20:59   ` [PATCH 5/5] 9p: introduce async write requests Stefano Stabellini

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20161210015059.GD1555@ZenIV.linux.org.uk \
    --to=viro@zeniv.linux.org.uk \
    --cc=ericvh@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lucho@ionkov.net \
    --cc=rminnich@sandia.gov \
    --cc=sstabellini@kernel.org \
    --cc=v9fs-developer@lists.sourceforge.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).