From: Jens Axboe <axboe@suse.de>
To: Ben Collins <ben.collins@ubuntu.com>
Cc: Ben Collins <bcollins@ubuntu.com>,
torvalds@osdl.org, akpm@osdl.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2.6.15-rc6] block: Make CDROMEJECT more robust
Date: Mon, 19 Dec 2005 21:46:24 +0100 [thread overview]
Message-ID: <20051219204624.GR3734@suse.de> (raw)
In-Reply-To: <1135024069.4541.6.camel@localhost.localdomain>
On Mon, Dec 19 2005, Ben Collins wrote:
> > - Read request: direction bit not set, non-zero data length
> > - Write request: direction bit set, non-zero data length
> >
> > How can you read or write anything, when there's nothing to read or
> > write?
>
> Exactly, but the block layer (and I'd have to trace back through the
> code to find the exact failure point) has a check somewhere in there
> that checks the direction, and if it's a WRITE, checks data_len, and
> fails if it is 0.
I'd like to see that, if it's true it wants fixing of course.
> Note, my patch does not fix the case for the bug if I leave it as WRITE.
> It only works when it is READ.
We need to get that fixed as well, it should not make a difference.
> > So the medium removal command does require write permission on the
> > deviec, but it doesn't require root. If they need to rw to the device
> > fs, surely they need write permissions on the device in the first place?
>
> bcollins@colorless:~$ id -a
> uid=1000(bcollins) gid=1000(bcollins)
> groups=4(adm),20(dialout),24(cdrom),25(floppy),29(audio),30(dip),44(video),46(plugdev),104(lpadmin),105(scanner),106(admin),1000(bcollins)
> bcollins@colorless:~$ ls -l /dev/hdc
> brw-rw---- 1 root plugdev 22, 0 Dec 19 2005 /dev/hdc
> bcollins@colorless:~$ eject -s /dev/hdc
> eject: unable to eject, last error: Operation not permitted
> bcollins@colorless:~$ eject -r /dev/hdc
Does eject open the device O_RDWR?
--
Jens Axboe
next prev parent reply other threads:[~2005-12-19 20:44 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-12-19 15:32 [PATCH 2.6.15-rc6] block: Make CDROMEJECT more robust Ben Collins
2005-12-19 19:35 ` Jens Axboe
2005-12-19 19:35 ` Jens Axboe
2005-12-19 19:44 ` Ben Collins
2005-12-19 19:56 ` Jens Axboe
2005-12-19 20:27 ` Ben Collins
2005-12-19 20:46 ` Jens Axboe [this message]
2005-12-19 21:24 ` Ben Collins
2005-12-19 20:02 ` Linus Torvalds
2005-12-19 20:07 ` Jens Axboe
2005-12-19 20:37 ` Ben Collins
2005-12-19 19:58 ` Ben Collins
2005-12-19 20:05 ` Jens Axboe
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=20051219204624.GR3734@suse.de \
--to=axboe@suse.de \
--cc=akpm@osdl.org \
--cc=bcollins@ubuntu.com \
--cc=ben.collins@ubuntu.com \
--cc=linux-kernel@vger.kernel.org \
--cc=torvalds@osdl.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