From: Jesper Juhl <juhl-lkml@dif.dk>
To: Alan Cox <alan@lxorguk.ukuu.org.uk>
Cc: Jesper Juhl <juhl-lkml@dif.dk>, Steve French <sfrench@samba.org>,
Steve French <sfrench@us.ibm.com>,
samba-technical <samba-technical@lists.samba.org>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [patch] copy_to_user check and whitespace cleanups in fs/cifs/file.c
Date: Mon, 27 Dec 2004 02:21:36 +0100 (CET) [thread overview]
Message-ID: <Pine.LNX.4.61.0412270218560.3552@dragon.hygekrogen.localhost> (raw)
In-Reply-To: <1104104286.16545.7.camel@localhost.localdomain>
On Sun, 26 Dec 2004, Alan Cox wrote:
> On Sul, 2004-12-26 at 23:24, Jesper Juhl wrote:
> > Hi,
> >
> > Patch below adds a check for the copy_to_user return value and makes a few
> > whitespace cleanups in fs/cifs/file.c::cifs_user_read()
> > I hope bundling two different things together in one patch is OK when the
> > change is as small as this, but if you want it spplit in two patches, then
> > just say so.
>
> Corrupts the stats
> Fails to free smb_read_data where in some cases it was freed before
>
Whoops, I'll take care of that - thanks for pointing that out.
> I'm not sure the stats matter but I think you need something more like
>
>
> residue = copy_to_user(....)
> if(smb_read_data) {
> cifs_buf_release(...)
> ...
> }
>
> Then
>
> if(residue) {
> total_read += bytes_read - residue;
> FreeXid(xid);
> return total_read ? total_read: -EFAULT;
> }
>
>
I take that to mean that if we do manage to read something before we run
into the fault it's better to return what we have read than the fact that
we ran into a fault... that makes sense. Sure, I'll cook up a patch to do
that instead (tomorrow - I need some sleep).
--
Jesper Juhl
next prev parent reply other threads:[~2004-12-27 1:10 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-12-26 23:24 Jesper Juhl
2004-12-26 23:38 ` Alan Cox
2004-12-27 1:21 ` Jesper Juhl [this message]
2004-12-28 23:48 ` [patch 1/3] copy_to_user check " Jesper Juhl
2004-12-28 22:45 ` Alan Cox
2004-12-28 23:52 ` [patch 2/3] whitespace cleanups " Jesper Juhl
2004-12-29 1:57 ` Jörn Engel
2004-12-29 2:59 ` Jesper Juhl
2004-12-29 12:29 ` Jörn Engel
2004-12-29 18:48 ` Domen Puncer
2004-12-29 13:42 ` [patch 2/3] " Horst von Brand
2004-12-29 14:48 ` Jörn Engel
2004-12-29 16:31 ` Horst von Brand
2004-12-29 9:51 ` Wichert Akkerman
2004-12-29 12:10 ` Jörn Engel
2005-01-03 12:01 ` Martin Waitz
2004-12-28 23:55 ` [patch 3/3] get rid of two unnessesary assignments " Jesper Juhl
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=Pine.LNX.4.61.0412270218560.3552@dragon.hygekrogen.localhost \
--to=juhl-lkml@dif.dk \
--cc=alan@lxorguk.ukuu.org.uk \
--cc=linux-kernel@vger.kernel.org \
--cc=samba-technical@lists.samba.org \
--cc=sfrench@samba.org \
--cc=sfrench@us.ibm.com \
/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
all inboxes | Powered by JetHome®