From: Jens Axboe <axboe@suse.de>
To: Pascal Schmidt <der.eremit@email.de>
Cc: linux-kernel@vger.kernel.org
Subject: Re: MO: opening for write in cdrom.c
Date: Tue, 27 Jan 2004 12:07:13 +0100 [thread overview]
Message-ID: <20040127110713.GR11683@suse.de> (raw)
In-Reply-To: <Pine.LNX.4.44.0401261900460.855-100000@neptune.local>
On Mon, Jan 26 2004, Pascal Schmidt wrote:
> On Mon, 26 Jan 2004, Pascal Schmidt wrote:
>
> [short summary for l-k: this is about finding out whether an MO is
> write-protected or not, code that is yet missing from cdrom.c]
>
> > I'll try to implement the fallback that sd.c uses next. That code
> > tries several mode senses with different page and length.
>
> Okay, I got it working with the exact method that sd.c uses. I've put
> a few printk's in to see where it fails a mode sense. It's actually
> inconsistent:
>
> a) insert a writable disc first after boot, method 1 works
> b) then insert a non-writable disc once - suddenly method 1
> stops working, even on writable discs, instead method 2
> works
> c) insert a non-writable disc first after boot, method 1
> never works, but method 2 does
Sounds pretty shaky...
> There's a third method in sd.c. I've also left that in since I suspect
> it might be necessary under some circumstances, too.
Probably a good idea.
> >From my testing, I get the impression that this Fujitsu drive only
> has mode page 0, meaning that only 0x00 and 0x3F make sense, and that
> mode page 0x00 also only contains very few bytes of information -
> because asking for 16 bytes from 0x3F didn't work, but 4 bytes does.
> What's weird is that asking for all pages can also stop suddenly, after
> which only page 0x00 is accessible. And when that happens, we only get
> a meaningless request sense of 00/00/00 back.
>
> Oh well, strange hardware indeed.
>
> Here's the patch that works for me, please consider applying and
> pushing to Linus/Andrew:
Hmm, looks a bit strange. You want write protect to be set _if_
detection works, not otherwise. If it fails, just assume that you can
write to the drive and let the normal drive rejection work fail those
(maybe even catch them and write protect then). Seeing as the method is
unreliable, we cannot solely rely on that.
--
Jens Axboe
next prev parent reply other threads:[~2004-01-27 11:07 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <Pine.LNX.4.44.0401261826340.1102-100000@neptune.local>
2004-01-26 18:08 ` MO: opening for write in cdrom.c Pascal Schmidt
2004-01-27 11:07 ` Jens Axboe [this message]
2004-01-27 13:13 ` Pascal Schmidt
2004-01-27 16:33 ` Jens Axboe
[not found] <1izgH-3H4-37@gated-at.bofh.it>
[not found] ` <1iBiv-5u0-27@gated-at.bofh.it>
[not found] ` <1iEqx-8bO-31@gated-at.bofh.it>
2004-01-27 17:45 ` Pascal Schmidt
2004-01-27 23:44 ` Jens Axboe
[not found] <Pine.LNX.4.44.0401271538010.1498-100000@neptune.local>
2004-01-27 18:13 ` Pascal Schmidt
2004-01-28 0:02 ` Jens Axboe
2004-01-28 1:00 ` Pascal Schmidt
2004-01-28 1:02 ` Jens Axboe
2004-01-28 1:06 ` Pascal Schmidt
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=20040127110713.GR11683@suse.de \
--to=axboe@suse.de \
--cc=der.eremit@email.de \
--cc=linux-kernel@vger.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