From: James Bottomley <James.Bottomley@HansenPartnership.com>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Osterlund <petero2@telia.com>,
Matthew Wilcox <matthew@wil.cx>, Ingo Molnar <mingo@elte.hu>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
Andrew Morton <akpm@linux-foundation.org>,
Jens Axboe <jens.axboe@oracle.com>,
Al Viro <viro@ZenIV.linux.org.uk>
Subject: Re: [patch] scsi: revert "[SCSI] Get rid of scsi_cmnd->done"
Date: Sun, 06 Jan 2008 12:54:56 -0600 [thread overview]
Message-ID: <1199645697.5205.80.camel@localhost.localdomain> (raw)
In-Reply-To: <alpine.LFD.1.00.0801061034410.2811@woody.linux-foundation.org>
On Sun, 2008-01-06 at 10:44 -0800, Linus Torvalds wrote:
>
> On Sun, 6 Jan 2008, Linus Torvalds wrote:
> >
> > That said:
> >
> > > pktcdvd shouldn't be mucking with the size of the underlying CD/DVD ...
> >
> > I'm not sure if it should be mucking with the size or not, but it
> > definitely shouldn't be mucking with the block-size, because that can
> > indeed cause huge problems.
>
> Hmm. Looking closer, it's probably ok in that case, because it does do a
> "bd_claim()" to make sure that it has exclusive access, so while there may
> be other openers around, at least those other openers won't be filesystem
> mounts or anything that opened with O_EXCL.
>
> So changing the blocksize is probably ok in this case.
>
> That still leaves the question whether pktcdvd *should* muck with the base
> device at all, and I'm not at all sure about that. But I'm no longer sure
> that the pktcdvd code is necessarily *clearly* broken, now it's more of a
> "should it really do that?" thing.
>
> So I still suspect that this:
>
> > - set_capacity(pd->disk, lba << 2);
> > - set_capacity(pd->bdev->bd_disk, lba << 2);
> > - bd_set_size(pd->bdev, (loff_t)lba << 11);
> > + set_capacity(pd->disk, get_capacity(pd->bdev->bd_disk));
>
> is likely a good thing to do (in conjunction with my patch that made
> i_size be "reliable" after an open), but there may be some reason why
> pktcdvd really wants to control the size rather than be on the receiving
> end of the size.
>
> Peter, this is your decision. Apparently my one-liner fixes the immediate
> bug (but it's not really a regression either - I think the i_size issue
> has been there since pretty much day #1), and what pktcdvd does is
> somewhat less critical an issue?
I think perhaps the true bug lies in the way we handle layered devices
like this. pktcdvd holds the underlying device open, so its refcount
never drops to zero. This is what causes the gendisk/block layer never
to update the sizes, and what lead to pktcdvd doing it instead.
However, what perhaps really needs to happen is that pktcdvd needs to
take over the media change events as well. That way it could see the
disk change and invalidate and reread its own setting of the block size
(and possibly re set the size of the underlying device).
I agree, though, this isn't a regression. It's probably obscure enough
in reproduction to warrant not holding up 2.6.24 --- especially as I
think the true fix will do small perturbations to a lot of subsystems.
If this were a product and I were the release manager, I'd be updating
the release notes with a note about having to break pktcdvd binding
across media changes to work around this bug and a promise to fix it in
the next release.
James
next prev parent reply other threads:[~2008-01-06 18:55 UTC|newest]
Thread overview: 59+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-01-02 16:25 [patch] scsi: revert "[SCSI] Get rid of scsi_cmnd->done" Ingo Molnar
2008-01-02 16:46 ` James Bottomley
2008-01-02 19:19 ` Linus Torvalds
2008-01-02 19:40 ` Matthew Wilcox
2008-01-02 19:57 ` Linus Torvalds
2008-01-02 20:17 ` Christoph Hellwig
2008-01-02 20:49 ` Linus Torvalds
2008-01-02 20:53 ` Matthew Wilcox
2008-01-02 20:18 ` Matthew Wilcox
2008-01-02 20:12 ` James Bottomley
2008-01-02 20:45 ` Linus Torvalds
2008-01-02 23:33 ` James Bottomley
2008-01-03 1:58 ` Linus Torvalds
2008-01-06 2:55 ` Peter Osterlund
2008-01-06 3:43 ` Linus Torvalds
2008-01-06 10:17 ` Peter Osterlund
2008-01-06 14:04 ` James Bottomley
2008-01-06 14:42 ` James Bottomley
2008-01-06 15:01 ` Peter Osterlund
2008-01-06 18:14 ` Linus Torvalds
2008-01-06 18:44 ` Linus Torvalds
2008-01-06 18:54 ` James Bottomley [this message]
2008-01-06 16:19 ` Boaz Harrosh
2008-01-06 16:47 ` James Bottomley
2008-01-06 13:57 ` James Bottomley
2008-01-06 14:47 ` Ingo Molnar
2008-01-06 15:20 ` James Bottomley
2008-01-06 15:45 ` Adrian Bunk
2008-01-06 16:00 ` James Bottomley
2008-01-06 16:12 ` Ingo Molnar
2008-01-06 17:10 ` James Bottomley
2008-01-08 16:55 ` Ingo Molnar
2008-01-06 17:11 ` Matthew Wilcox
2008-01-06 17:36 ` James Bottomley
2008-01-06 18:34 ` Willy Tarreau
2008-01-06 18:56 ` Adrian Bunk
2008-01-06 19:10 ` Willy Tarreau
2008-01-06 19:58 ` Adrian Bunk
2008-01-06 21:08 ` Willy Tarreau
2008-01-06 22:25 ` Adrian Bunk
2008-01-07 20:50 ` Valdis.Kletnieks
2008-01-07 21:31 ` Alan Cox
2008-01-07 21:37 ` Matthew Wilcox
2008-01-07 23:04 ` Valdis.Kletnieks
2008-01-07 23:19 ` Matthew Wilcox
2008-01-08 16:47 ` Stefan Richter
2008-01-08 17:11 ` Linus Torvalds
2008-01-08 20:01 ` Ingo Molnar
2008-01-09 4:01 ` Valdis.Kletnieks
2008-01-09 4:10 ` Andrew Morton
2008-01-09 6:03 ` Willy Tarreau
2008-01-09 4:03 ` Valdis.Kletnieks
2008-01-07 15:25 ` John Stoffel
2008-01-07 19:04 ` Stefan Richter
2008-01-07 19:59 ` John Stoffel
2008-01-06 17:29 ` Stefan Richter
2008-01-06 20:26 ` Ingo Molnar
-- strict thread matches above, loose matches on Subject: below --
2008-01-06 13:55 Thomas Meyer
2008-01-06 16:56 ` Matthew Wilcox
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=1199645697.5205.80.camel@localhost.localdomain \
--to=james.bottomley@hansenpartnership.com \
--cc=akpm@linux-foundation.org \
--cc=jens.axboe@oracle.com \
--cc=linux-kernel@vger.kernel.org \
--cc=matthew@wil.cx \
--cc=mingo@elte.hu \
--cc=petero2@telia.com \
--cc=torvalds@linux-foundation.org \
--cc=viro@ZenIV.linux.org.uk \
/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