From: Amit Shah <amit.shah@redhat.com>
To: Tejun Heo <tj@kernel.org>
Cc: linux-kernel@vger.kernel.org, Jens Axboe <axboe@kernel.dk>,
"James E.J. Bottomley" <James.Bottomley@suse.de>,
linux-scsi@vger.kernel.org, Markus Armbruster <armbru@redhat.com>,
Stefan Hajnoczi <stefanha@gmail.com>
Subject: Re: [PATCH] sr: Ensure disk is revalidated when media changes
Date: Tue, 5 Apr 2011 20:16:51 +0530 [thread overview]
Message-ID: <20110405144651.GA20671@amit-x200.redhat.com> (raw)
In-Reply-To: <20110401154327.GA6593@mtj.dyndns.org>
On (Fri) 01 Apr 2011 [17:43:27], Tejun Heo wrote:
> Hello,
>
> On Thu, Mar 31, 2011 at 11:50:04PM +0530, Amit Shah wrote:
> > After the first GET_EVENT_STATUS_NOTIFICATION command, any new media
> > notification is reset by the device. The following is then noticed:
> >
> > 1. insert a CD of a particular size
> > 2. mount it
> > 3. note /sys/block/sr0/size
> > 4. unmount cd
> > 5. replace cd with a size greater than previous one
> > 6. mount it
> > 7. /sys/block/sr0/size isn't updated
> > 8. copy all files from cd to somewhere; IO errors will pop up where the
> > files lie beyond previous CD's geometry
> >
> > The cause is:
> >
> > cdrom_open()
> > open_for_data()
> > cdo->drive_status() = sr_drive_status()
> > cdrom_get_media_event()
> > --> GPCMD_GET_EVENT_STATUS_NOTIFICATION
> > --> med.media_present is true, return CDS_DISK_OK
> > (success)
> > check_disk_change()
> > ... -> 2nd call to GPCMD_GET_EVENT_STATUS_NOTIFICATION
> >
> > at this point the device has already reset the new media event and the
> > call to revalidate_disk() in check_disk_change() is never made.
>
> Hmm... I see. That's something I didn't expect.
...
> But I don't think this is the correct place to do it. The problem
> happens because block layer consumes the event but doesn't remember it
> when the time for revalidation comes. It should be done by block
> layer, not sr.
Hm, only the open call at the start of the call sequence is involved
from the block layer. How to pass on such a pending event back? Some
kind of an event array with helpers to modify it?
Amit
prev parent reply other threads:[~2011-04-05 14:47 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-03-31 18:20 [PATCH] sr: Ensure disk is revalidated when media changes Amit Shah
2011-04-01 15:43 ` Tejun Heo
2011-04-05 6:51 ` Amit Shah
2011-04-06 10:06 ` Tejun Heo
2011-04-06 11:02 ` Amit Shah
2011-04-08 11:37 ` Stefan Hajnoczi
2011-04-08 16:20 ` Tejun Heo
2011-04-08 16:43 ` Stefan Hajnoczi
2011-04-08 16:52 ` Tejun Heo
2011-04-12 4:51 ` Amit Shah
2011-04-12 8:16 ` Stefan Hajnoczi
2011-04-12 8:36 ` Amit Shah
2011-04-05 14:46 ` Amit Shah [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=20110405144651.GA20671@amit-x200.redhat.com \
--to=amit.shah@redhat.com \
--cc=James.Bottomley@suse.de \
--cc=armbru@redhat.com \
--cc=axboe@kernel.dk \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=stefanha@gmail.com \
--cc=tj@kernel.org \
/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;
as well as URLs for NNTP newsgroup(s).