[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Pine.LNX.4.64.1005302303180.19253@ask.diku.dk>
Date: Sun, 30 May 2010 23:09:48 +0200 (CEST)
From: Julia Lawall <julia@...u.dk>
To: Eric Dumazet <eric.dumazet@...il.com>
Cc: "David S. Miller" <davem@...emloft.net>,
Alexey Kuznetsov <kuznet@....inr.ac.ru>,
"Pekka Savola (ipv6)" <pekkas@...core.fi>,
James Morris <jmorris@...ei.org>,
Hideaki YOSHIFUJI <yoshfuji@...ux-ipv6.org>,
Patrick McHardy <kaber@...sh.net>, netdev@...r.kernel.org,
linux-kernel@...r.kernel.org, kernel-janitors@...r.kernel.org
Subject: Re: Subject: [PATCH] net/ipv6: Use GFP_ATOMIC when a lock is held
On Sun, 30 May 2010, Eric Dumazet wrote:
> Le dimanche 30 mai 2010 à 22:50 +0200, Julia Lawall a écrit :
>
> > I think the proposed patch does not work, because the for loop overwrites
> > p. That use of p looks like it is completely local to the for loop, so
> > perhaps a new variable p1 could be added to be used there?
>
> Please do so.
>
> I just wanted to tell you changing GFP_KERNEL to GFP_ATOMIC is not an
> appropriate way to solve this kind of problems. My patch was to get an
> idea, not a full and tested patch :)
Looking at it again, there is still a problem, because in the original
code, the loop:
for (p = t->prl; p; p = p->next) {
if (p->addr == a->addr) {
if (chg) {
p->flags = a->flags;
goto out;
}
err = -EEXIST;
goto out;
}
}
could exit with success without the kzalloc ever being called. If the
kzalloc is moved up, it could fail and then it returns immediately without
executing the loop. A solution could be to leave the NULL test on p where
it is, and only move up the kzalloc. Or perhaps the change in behavior
doesn't matter?
julia
Powered by blists - more mailing lists