Linux MM tree latest commits
 help / color / mirror / Atom feed
* + kfifo-replace-the-old-non-generic-api-kfifo-fix-scatterlist-usage.patch added to -mm tree
@ 2010-06-02 20:19 akpm
       [not found] ` <1275510551.1294.7.camel@wall-e.seibold.net>
  0 siblings, 1 reply; 2+ messages in thread
From: akpm @ 2010-06-02 20:19 UTC (permalink / raw)
  To: mm-commits; +Cc: kernel, greg, stefani


The patch titled
     kfifo: fix scatterlist usage
has been added to the -mm tree.  Its filename is
     kfifo-replace-the-old-non-generic-api-kfifo-fix-scatterlist-usage.patch

Before you just go and hit "reply", please:
   a) Consider who else should be cc'ed
   b) Prefer to cc a suitable mailing list as well
   c) Ideally: find the original patch on the mailing list and do a
      reply-to-all to that, adding suitable additional cc's

*** Remember to use Documentation/SubmitChecklist when testing your code ***

See http://userweb.kernel.org/~akpm/stuff/added-to-mm.txt to find
out what to do about this

The current -mm tree may be found at http://userweb.kernel.org/~akpm/mmotm/

------------------------------------------------------
Subject: kfifo: fix scatterlist usage
From: Ira W. Snyder <kernel@irasnyder.com>

The current kfifo scatterlist implementation will not work with chained
scatterlists.  It assumes that struct scatterlist arrays are allocated
contiguously, which is not the case when chained scatterlists (struct
sg_table) are in use.

Signed-off-by: Ira W. Snyder <kernel@irasnyder.com>
Cc: Greg KH <greg@kroah.com>
Cc: Stefani Seibold <stefani@seibold.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 kernel/kfifo.c |    9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff -puN kernel/kfifo.c~kfifo-replace-the-old-non-generic-api-kfifo-fix-scatterlist-usage kernel/kfifo.c
--- a/kernel/kfifo.c~kfifo-replace-the-old-non-generic-api-kfifo-fix-scatterlist-usage
+++ a/kernel/kfifo.c
@@ -333,17 +333,16 @@ static int setup_sgl_buf(struct scatterl
 		buf += PAGE_SIZE;
 		npage = virt_to_page(buf);
 		if (page_to_phys(page) != page_to_phys(npage) - l) {
-			sgl->page_link = 0;
-			sg_set_page(sgl++, page, l - off, off);
-			if (++n == nents)
+			sg_set_page(sgl, page, l - off, off);
+			sgl = sg_next(sgl);
+			if (++n == nents || sgl == NULL)
 				return n;
 			page = npage;
 			len -= l - off;
 			l = off = 0;
 		}
 	}
-	sgl->page_link = 0;
-	sg_set_page(sgl++, page, len, off);
+	sg_set_page(sgl, page, len, off);
 	return n + 1;
 }
 
_

Patches currently in -mm which might be from kernel@irasnyder.com are

kfifo-replace-the-old-non-generic-api-kfifo-fix-scatterlist-usage.patch


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: + kfifo-replace-the-old-non-generic-api-kfifo-fix-scatterlist-usage.patch added to -mm tree
       [not found] ` <1275510551.1294.7.camel@wall-e.seibold.net>
@ 2010-06-02 20:34   ` Andrew Morton
  0 siblings, 0 replies; 2+ messages in thread
From: Andrew Morton @ 2010-06-02 20:34 UTC (permalink / raw)
  To: Stefani Seibold; +Cc: mm-commits, kernel, greg

On Wed, 02 Jun 2010 22:29:11 +0200
Stefani Seibold <stefani@seibold.net> wrote:

> 
> Am Mittwoch, den 02.06.2010, 13:19 -0700 schrieb
> akpm@linux-foundation.org:
> > The patch titled
> >      kfifo: fix scatterlist usage
> > has been added to the -mm tree.  Its filename is
> >      kfifo-replace-the-old-non-generic-api-kfifo-fix-scatterlist-usage.patch
> > 
> > Before you just go and hit "reply", please:
> >    a) Consider who else should be cc'ed
> >    b) Prefer to cc a suitable mailing list as well
> >    c) Ideally: find the original patch on the mailing list and do a
> >       reply-to-all to that, adding suitable additional cc's
> > 
> > *** Remember to use Documentation/SubmitChecklist when testing your code ***
> > 
> > See http://userweb.kernel.org/~akpm/stuff/added-to-mm.txt to find
> > out what to do about this
> > 
> > The current -mm tree may be found at http://userweb.kernel.org/~akpm/mmotm/
> > 
> > ------------------------------------------------------
> > Subject: kfifo: fix scatterlist usage
> > From: Ira W. Snyder <kernel@irasnyder.com>
> > 
> > The current kfifo scatterlist implementation will not work with chained
> > scatterlists.  It assumes that struct scatterlist arrays are allocated
> > contiguously, which is not the case when chained scatterlists (struct
> > sg_table) are in use.
> > 
> 
> Why do you have added this?

Because nobody reviewed the code.

> No one had reviewed the code and no one gave
> an ack. I am currently to busy to check this.

And I don't have the bandwidth to track hundreds of maybe, maybe-not
emails stretching over months of time.  So generally I'll just apply
the thing if it looks good so that I can keep track of it and so that
it gets some testing.


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2010-06-02 20:34 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-06-02 20:19 + kfifo-replace-the-old-non-generic-api-kfifo-fix-scatterlist-usage.patch added to -mm tree akpm
     [not found] ` <1275510551.1294.7.camel@wall-e.seibold.net>
2010-06-02 20:34   ` Andrew Morton

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox