All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alan Cox <alan@lxorguk.ukuu.org.uk>
To: Jesper Juhl <juhl-lkml@dif.dk>
Cc: 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: Sun, 26 Dec 2004 23:38:07 +0000	[thread overview]
Message-ID: <1104104286.16545.7.camel@localhost.localdomain> (raw)
In-Reply-To: <Pine.LNX.4.61.0412270019370.3552@dragon.hygekrogen.localhost>

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

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;
}



  reply	other threads:[~2004-12-27  0:47 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-12-26 23:24 [patch] copy_to_user check and whitespace cleanups in fs/cifs/file.c Jesper Juhl
2004-12-26 23:38 ` Alan Cox [this message]
2004-12-27  1:21   ` Jesper Juhl
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=1104104286.16545.7.camel@localhost.localdomain \
    --to=alan@lxorguk.ukuu.org.uk \
    --cc=juhl-lkml@dif.dk \
    --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 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.