lkml.org 
[lkml]   [2008]   [Aug]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] 9p bug fix: return non-zero error value in p9_put_data
On Tue, Aug 26, 2008 at 10:30 AM, Abhishek Kulkarni <kulkarni@lanl.gov> wrote:
> p9_put_data is called by p9_create_twrite which expects it to return a
> non-zero value on error. This was the reason why every p9_client_write
> was failing. This patch also adds a check for buffer overflow in
> p9_put_data.
>

I'm a bit confused about when this is even getting called -- O thought
all writes were following the p9_client_uwrite path?

Also, we do the bufoverflow check in p9_create_write -- so with your
patch aren't we doing this twice?

-eric


> Signed-off-by: Abhishek Kulkarni <kulkarni@lanl.gov>
> ---
> net/9p/conv.c | 5 ++++-
> 1 files changed, 4 insertions(+), 1 deletions(-)
> diff --git a/net/9p/conv.c b/net/9p/conv.c
> index 4454720..7f6db15 100644
> --- a/net/9p/conv.c
> +++ b/net/9p/conv.c
> @@ -451,8 +451,11 @@ p9_put_data(struct cbuf *bufp, const char *data,
> int count,
> unsigned char **pdata)
> {
> *pdata = buf_alloc(bufp, count);
> + if (buf_check_overflow(bufp))
> + return -EIO;
> +
> memmove(*pdata, data, count);
> - return count;
> + return 0;
> }
>
> static int
>
>
> Thanks,
> -- Abhishek
>
>


\
 
 \ /
  Last update: 2008-08-28 20:13    [W:0.098 / U:5.732 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site