lkml.org 
[lkml]   [2014]   [Apr]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH 3.2 17/18] cifs: ensure that uncached writes handle unmapped areas correctly
From
Date
On Mon, 2014-04-07 at 15:45 +0200, Raphael Geissert wrote:
> Hi,
>
> On 7 April 2014 03:41, Ben Hutchings <ben@decadent.org.uk> wrote:
> > On Mon, 2014-04-07 at 00:35 +0100, Ben Hutchings wrote:
> >> 3.2.57-rc1 review patch. If anyone has any objections, please let me know.
> > [...]
> > --- a/fs/cifs/file.c
> > +++ b/fs/cifs/file.c
> [...]
> > + /*
> > + * i + 1 now represents the number of pages we actually used in
> > + * the copy phase above.
> > + */
> > + npages = min(npages, i + 1);
>
> I'm having trouble understanding why min() is needed here. It
> shouldn't harm either, but I find it confusing.

Because in the case where no error occurred, the comment is not true:
i == npages and npages have been used. The loop used upstream works,
but it seemed a bit silly to use a loop here.

Ben.

--
Ben Hutchings
Sturgeon's Law: Ninety percent of everything is crap.
[unhandled content-type:application/pgp-signature]
\
 
 \ /
  Last update: 2014-04-07 22:41    [W:0.050 / U:0.812 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site