All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Venkateswararao Jujjuri (JV)" <jvrao@linux.vnet.ibm.com>
To: "Aneesh Kumar K. V" <aneesh.kumar@linux.vnet.ibm.com>
Cc: v9fs-developer@lists.sourceforge.net, linux-fsdevel@vger.kernel.org
Subject: Re: [RFC-V3 7/7] [net/9p] Handle TREAD/RERROR case in !dotl case.
Date: Fri, 11 Feb 2011 10:46:42 -0800	[thread overview]
Message-ID: <4D558412.6030805@linux.vnet.ibm.com> (raw)
In-Reply-To: <87pqqyo31t.fsf@linux.vnet.ibm.com>

On 2/11/2011 10:10 AM, Aneesh Kumar K. V wrote:
> On Thu, 10 Feb 2011 17:25:11 -0800, "Venkateswararao Jujjuri (JV)" <jvrao@linux.vnet.ibm.com> wrote:
>> In addition, this patch also avoids zero copy for short reads in !dotl case.
>>
>> Signed-off-by: Venkateswararao Jujjuri <jvrao@linux.vnet.ibm.com>
>> ---
>>  net/9p/client.c |   64 +++++++++++++++++++++++++++++++++++-------------------
>>  1 files changed, 41 insertions(+), 23 deletions(-)
>>
>> diff --git a/net/9p/client.c b/net/9p/client.c
>> index f6d8531..3e51273 100644
>> --- a/net/9p/client.c
>> +++ b/net/9p/client.c
>> @@ -443,6 +443,7 @@ static int p9_check_errors(struct p9_client *c, struct p9_req_t *req)
>>  {
>>  	int8_t type;
>>  	int err;
>> +	int ecode;
>>
>>  	err = p9_parse_header(req->rc, NULL, &type, NULL, 0);
>>  	if (err) {
>> @@ -450,36 +451,53 @@ static int p9_check_errors(struct p9_client *c, struct p9_req_t *req)
>>  		return err;
>>  	}
>>
>> -	if (type == P9_RERROR || type == P9_RLERROR) {
>> -		int ecode;
>> -
>> -		if (!p9_is_proto_dotl(c)) {
>> -			char *ename;
>> +	if (type != P9_RERROR && type != P9_RLERROR)
>> +		return 0;
>>
>> -			err = p9pdu_readf(req->rc, c->proto_version, "s?d",
>> -								&ename, &ecode);
>> -			if (err)
>> -				goto out_err;
>> +	if (!p9_is_proto_dotl(c)) {
>> +		char *ename;
>> +
>> +		if (req->tc->pbuf_size) {
>> +			/* Handle user buffers */
>> +			size_t len = req->rc->size - req->rc->offset;
>> +			if (req->tc->pubuf) {
>> +				/* User Buffer */
>> +				err = copy_from_user(
>> +					&req->rc->sdata[req->rc->offset],
>> +					req->tc->pubuf, len);
>> +				if (err) {
>> +					err = -EFAULT;
>> +					return err;
>> +				}
> 
> Will this handle error resulting from kernel_read ?. I guess we have a
> kernel address there.

Yes. It should work. copy_to/from_user works fine..if you recall this how the
code is in the client_read().

- JV

> 
> 
>> +			} else {
>> +				/* Kernel Buffer */
>> +				memmove(&req->rc->sdata[req->rc->offset],
>> +						req->tc->pkbuf, len);
>> +			}
>> +		}
> 
> -aneesh



      reply	other threads:[~2011-02-11 18:46 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-02-11  1:25 [RFC-V3] [net/9p] [PATCH 0/7] Zero Copy Venkateswararao Jujjuri (JV)
2011-02-11  1:25 ` [RFC-V3 1/7] [net/9p] Additional elements to p9_fcall to acoomodate zero copy Venkateswararao Jujjuri (JV)
2011-02-11  1:25 ` [RFC-V3 2/7] [net/9p] Adds supporting functions for " Venkateswararao Jujjuri (JV)
2011-02-11  1:25 ` [RFC-V3 3/7] [net/9p] Assign type of transaction to tc->pdu->id which is otherwise unsed Venkateswararao Jujjuri (JV)
2011-02-11  6:59   ` Aneesh Kumar K. V
2011-02-11  1:25 ` [RFC-V3 4/7] [net/9p] Add gup/zero_copy support to VirtIO transport layer Venkateswararao Jujjuri (JV)
2011-02-11  7:07   ` Aneesh Kumar K. V
2011-02-11 16:08     ` Venkateswararao Jujjuri (JV)
2011-02-11 17:58   ` Aneesh Kumar K. V
2011-02-11 18:42     ` Venkateswararao Jujjuri (JV)
2011-02-11  1:25 ` [RFC-V3 5/7] [net/9p] Add preferences to " Venkateswararao Jujjuri (JV)
2011-02-11  1:25 ` [RFC-V3 6/7] [net/9p] Read and Write side zerocopy changes for 9P2000.L protocol Venkateswararao Jujjuri (JV)
2011-02-11 19:35   ` Aneesh Kumar K. V
2011-02-11 21:03     ` Venkateswararao Jujjuri (JV)
2011-02-11  1:25 ` [RFC-V3 7/7] [net/9p] Handle TREAD/RERROR case in !dotl case Venkateswararao Jujjuri (JV)
2011-02-11 18:10   ` Aneesh Kumar K. V
2011-02-11 18:46     ` Venkateswararao Jujjuri (JV) [this message]

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=4D558412.6030805@linux.vnet.ibm.com \
    --to=jvrao@linux.vnet.ibm.com \
    --cc=aneesh.kumar@linux.vnet.ibm.com \
    --cc=linux-fsdevel@vger.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.