From: Kai Makisara <Kai.Makisara@kolumbus.fi>
To: Lin Tan <tammy000@gmail.com>
Cc: James Bottomley <James.Bottomley@HansenPartnership.com>,
linux-kernel@vger.kernel.org, linux-scsi@vger.kernel.org
Subject: Re: [PATCH git latest] drivers/scsi: fixing wrong comment before new_buffer_tape()
Date: Fri, 26 Sep 2008 22:55:24 +0300 (EEST) [thread overview]
Message-ID: <alpine.LNX.1.10.0809262234520.25887@kai.makisara.local> (raw)
In-Reply-To: <20080926170624.GA19223@carmen.cs.uiuc.edu>
I am talking only about st.c but most of this probably applies also to
osst.c.
On Fri, 26 Sep 2008, Lin Tan wrote:
> > > > > Looks true to me for the current versions of the code. In fact it is only
> > > > > ever called from the initialisation function that I can see so chunks of
> > > > > the code could simply go away as well as bits of the comment. Ditto the
It is true that the function is currently called only from initialisation.
It was called from other contexts earlier and the extra code is leftover
from that time.
> > > > > one in drivers/scsi/st.c
> > > > >
> > > > > Acked-by: Alan Cox <alan@redhat.com>
> > > > >
> > > >
> > > > I am sorry I didn't quite understand. You mean it is true that caller
> > > > must hold os_scsi_tapes_lock?
> > >
> > > Sorry - I mean what you claim is true - that the comment is incorrect.
> >
> > So, I think I'm missing a piece of this: There's no patch in this
> > thread (I presume it's lurking somewhere on lkml). Could someone repost
> > the proposed patch and copy the tape maintainer: Kai Makisara
> > <Kai.Makisara@kolumbus.fi> to get his input?
> >
I saw the patch but my mail client does not include attachments as text in
reply ;-(
Anyway, the comment is there because new_tape_buffer() may sleep and
st_dev_arr_lock is a spinlock. I have been under the impression that code
inside a spinlock must not sleep.
When called from initialisation, new_tape_buffer() _currently_ used
GFP_ATOMIC. I am not sure that this is necessary but as long as I don't
know, I don't want to change it. The comment protects callers even if
someone knows that it is safe to use GFP_KERNEL from initialisation.
I don't see why new_tape_buffer() needs to be inside the lock. It just
allocates an initialises a structure.
If someone wants to remove the comment from st.c, I don't mind. But please
make sure that what you write to the commit is correct.
Kai
prev parent reply other threads:[~2008-09-26 20:02 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-09-25 17:49 Lin Tan
2008-09-26 10:13 ` Alan Cox
2008-09-26 16:05 ` Tammy
2008-09-26 16:09 ` Alan Cox
2008-09-26 16:20 ` James Bottomley
2008-09-26 17:06 ` Lin Tan
2008-09-26 19:55 ` Kai Makisara [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=alpine.LNX.1.10.0809262234520.25887@kai.makisara.local \
--to=kai.makisara@kolumbus.fi \
--cc=James.Bottomley@HansenPartnership.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=tammy000@gmail.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®