From: James Bottomley <James.Bottomley@HansenPartnership.com>
To: Krzysztof Helt <krzysztof.h1@poczta.fm>
Cc: linux-scsi@vger.kernel.org, matthew@wil.cx
Subject: Re: [PATCH] sym8xx_2: kill compilation warning
Date: Tue, 08 Jan 2008 09:35:53 -0600 [thread overview]
Message-ID: <1199806553.3534.11.camel@localhost.localdomain> (raw)
In-Reply-To: <20080108074034.604f84ee.krzysztof.h1@poczta.fm>
On Tue, 2008-01-08 at 07:40 +0100, Krzysztof Helt wrote:
> On Mon, 07 Jan 2008 16:39:35 -0600
> James Bottomley <James.Bottomley@HansenPartnership.com> wrote:
>
> >
> > On Mon, 2008-01-07 at 22:56 +0100, Krzysztof Helt wrote:
> > > From: Krzysztof Helt <krzysztof.h1@wp.pl>
> > >
> > > This patch fixes call to wait_for_completion_timeout()
> > > with NULL argument.
> >
> > That doesn't seem to be at all what your patch is doing. I can't see
> > any case in the old code where wait_for_completion_timeout() could be
> > called with a NULL that you fix. What it seems you are doing is
> > altering the code to eliminate the finished_reset variable.
> >
>
> I am sorry for the mess. I put the wrong description of the patch.
> Here is the correct one:
> ---
>
> The purpose of the patch is to kill the compilation warning with gcc-4.1.1 on sparc64:
>
> sym_glue.c: In function sym_eh_handler:
> sym_glue.c:612: warning: io_reset may be used uninitialized in this function
>
> This patch also eliminates the finished_reset variable.
OK, ordinarily we don't change kernel code for what is clearly a
compiler bug (as in other versions of gcc 4.1 don't produce this warning
because they see the tie between the two variables).
However, now that I actually look at this code, it has two clear bugs in
it:
1. the if (!sym_data->io_reset). That variable is only ever filled
by a stack based completion. If we find it non empty it means
this code has been entered twice and we have a severe problem,
so that should just become a BUG_ON(!sym_data->io_reset)
2. sym_data->io_reset should be set to NULL before the routine is
exited otherwise the PCI recovery code could end up completing
what will be a bogus pointer into the stack.
The vaule of sym_data->io_reset looks like it should remain current
across the lock, so there's no need to save it in a variable (the
sym2_io_resume() routine also shouldn't be setting it to NULL, and the
complete_all should be complete---just because we can only have a single
thread waiting for the completion otherwise all hell would break loose).
So, fix these issues (and quietly change the code not to produce the
compile warning on sparc64) and it can go in.
James
prev parent reply other threads:[~2008-01-08 15:35 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-01-07 21:56 [PATCH] sym8xx_2: Fixes call to wait_for_completion_timeout() with NULL argument Krzysztof Helt
2008-01-07 22:39 ` James Bottomley
2008-01-08 6:40 ` [PATCH] sym8xx_2: kill compilation warning Krzysztof Helt
2008-01-08 15:35 ` James Bottomley [this message]
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=1199806553.3534.11.camel@localhost.localdomain \
--to=james.bottomley@hansenpartnership.com \
--cc=krzysztof.h1@poczta.fm \
--cc=linux-scsi@vger.kernel.org \
--cc=matthew@wil.cx \
/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