PATCH/FIX for drivers/cdrom/cdrom.c

linux

PATCH/FIX for drivers/cdrom/cdrom.c

Postby Dirk » Fri, 18 Aug 2006 02:30:10 GMT

This is a multi-part message in MIME format.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to  XXXX@XXXXX.COM 
More majordomo info at   http://www.**--****.com/ 
Please read the FAQ at   http://www.**--****.com/ 
I have changed a message that didn't clearly tell the user what was goin
on...

Please have a look!

Thank you,
Dirk


Re: PATCH/FIX for drivers/cdrom/cdrom.c

Postby Jan Engelhardt » Fri, 18 Aug 2006 02:50:09 GMT


It is not April 01, is it?


Jan Engelhardt
-- 
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to  XXXX@XXXXX.COM 
More majordomo info at   http://www.**--****.com/ 
Please read the FAQ at   http://www.**--****.com/ 

Re: PATCH/FIX for drivers/cdrom/cdrom.c

Postby Dirk » Fri, 18 Aug 2006 03:40:05 GMT



Only when I try to burn a CD...
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to  XXXX@XXXXX.COM 
More majordomo info at   http://www.**--****.com/ 
Please read the FAQ at   http://www.**--****.com/ 

Re: PATCH/FIX for drivers/cdrom/cdrom.c

Postby Alan Cox » Fri, 18 Aug 2006 03:50:06 GMT

Ar Mer, 2006-08-16 am 19:26 +0200, ysgrifennodd Dirk:

File a gnome/kde/distro bug according whichever pile of garbage you've
got trying to do CD status monitoring and getting it wrong. This isn't a
kernel problem, some idiot user application is asking it continually.

Now there is an argument that the message is debug only but thats
another story.

Alan

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to  XXXX@XXXXX.COM 
More majordomo info at   http://www.**--****.com/ 
Please read the FAQ at   http://www.**--****.com/ 

Re: PATCH/FIX for drivers/cdrom/cdrom.c

Postby Arjan van de Ven » Fri, 18 Aug 2006 03:50:08 GMT





there is. O_EXCL works for this.
Any sane desktop app and cd burning app use O_EXCL already for this
purpose...


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to  XXXX@XXXXX.COM 
More majordomo info at   http://www.**--****.com/ 
Please read the FAQ at   http://www.**--****.com/ 

Re: PATCH/FIX for drivers/cdrom/cdrom.c

Postby Dirk » Fri, 18 Aug 2006 04:30:17 GMT





I still use fvwm1 with _my_ config file unchanged for ~6 years now!!!

But you were right... after i removed some package called "hal"
everything works fine again...

must have been another trojan from the "Ready for the Desktop!" camp...

Dirk
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to  XXXX@XXXXX.COM 
More majordomo info at   http://www.**--****.com/ 
Please read the FAQ at   http://www.**--****.com/ 

Re: PATCH/FIX for drivers/cdrom/cdrom.c

Postby Andrew Morton » Fri, 18 Aug 2006 07:30:11 GMT

On Wed, 16 Aug 2006 19:26:02 +0200




Please keep the code formatted to fit in an 80-column xterm.  See
Documentation/CodingStyle.  Thanks.

(And you forget the Signed-off-by: line)
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to  XXXX@XXXXX.COM 
More majordomo info at   http://www.**--****.com/ 
Please read the FAQ at   http://www.**--****.com/ 

Re: PATCH/FIX for drivers/cdrom/cdrom.c

Postby Jan Engelhardt » Fri, 18 Aug 2006 17:00:17 GMT

>> I have changed a message that didn't clearly tell the user what was goin

Before any of this gets ANY chance to get in:

NAK.



Jan Engelhardt
-- 
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to  XXXX@XXXXX.COM 
More majordomo info at   http://www.**--****.com/ 
Please read the FAQ at   http://www.**--****.com/ 

Re: PATCH/FIX for drivers/cdrom/cdrom.c

Postby Arjan van de Ven » Fri, 18 Aug 2006 21:40:08 GMT







all burning apps will retry a few times if they get "busy"....


doesn't help, since hal doesn't just open it, but also issues an ioctl
that then goes to the device, and THAT is causing the damage. Not the
open itself.


if the user wants to destroy his own burning cd... then why is it the
kernels job to stop him?


oh I really want to have this ioctl cached, but more so that the kernel
can enforce a reasonable polling interval ;)

-- 
if you want to mail me at work (you don't), use arjan (at) linux.intel.com

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to  XXXX@XXXXX.COM 
More majordomo info at   http://www.**--****.com/ 
Please read the FAQ at   http://www.**--****.com/ 

Re: PATCH/FIX for drivers/cdrom/cdrom.c

Postby Bodo Eggert » Fri, 18 Aug 2006 21:40:11 GMT






This was discussed to death:

HAL using O_EXCL will randomly prevent burning/mounting/etc by causing a
race condition, so it can't do that. HAL not using O_EXCL will OTOH succeed
in opening despite of O_EXCL used by the burning process and thereby
prevent burning by opening a busy device. The proposed solution was
introducing O_NONE or O_HARMLESS to prevent side-effects from opening
the device.

This will, however, not prevent other users from maliciously destroying the
CD by not using O_EXCL. Chowning the device is not a real solution, since
users should be able to fusermount the CD.

Maybe it's possible to cache the result and thereby prevent repeated
opening from disturbing the burning process.
-- 
Ich danke GMX daf, die Verwendung meiner Adressen mittels per SPF
verbreiteten Len zu sabotieren.

 http://www.**--****.com/ 
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to  XXXX@XXXXX.COM 
More majordomo info at   http://www.**--****.com/ 
Please read the FAQ at   http://www.**--****.com/ 

Re: PATCH/FIX for drivers/cdrom/cdrom.c

Postby Alan Cox » Fri, 18 Aug 2006 22:20:08 GMT

Ar Iau, 2006-08-17 am 14:27 +0200, ysgrifennodd Bodo Eggert:

man 3 sleep
man 2 flock

or in the GUI world I'm firmly assured that the sun shines out of the
arse of dbus for intra desktop communication.

Lots of solutions.


We could certainly add an ioctl for this in the new libata layer. We
couldn't automate it as with pass through commands the kernel doesn't
really know what kind of exclusivity is needed and when.

Not sure its actually useful but its doable.

Alan
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to  XXXX@XXXXX.COM 
More majordomo info at   http://www.**--****.com/ 
Please read the FAQ at   http://www.**--****.com/ 

Re: PATCH/FIX for drivers/cdrom/cdrom.c

Postby Jeff Garzik » Fri, 18 Aug 2006 22:50:15 GMT



Such use of O_EXCL is a weird and non-standard behavior.

	Jeff


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to  XXXX@XXXXX.COM 
More majordomo info at   http://www.**--****.com/ 
Please read the FAQ at   http://www.**--****.com/ 

Re: PATCH/FIX for drivers/cdrom/cdrom.c

Postby Alan Cox » Fri, 18 Aug 2006 23:00:16 GMT

Ar Iau, 2006-08-17 am 09:23 -0400, ysgrifennodd Lennart Sorensen:

If you were designing a new OS from scratch you might want to explore
that semantic as a design idea. I wouldn't recommend it because a lot of
apps will be upset if they issue an ioctl and it mysteriously fails or
hangs.

Issues of this nature require high level synchronization and that
(witness email) is generally done in user space which is the only place
that has transaction level visibility.

Alan

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to  XXXX@XXXXX.COM 
More majordomo info at   http://www.**--****.com/ 
Please read the FAQ at   http://www.**--****.com/ 

Re: PATCH/FIX for drivers/cdrom/cdrom.c

Postby Alan Cox » Fri, 18 Aug 2006 23:50:09 GMT

Ar Iau, 2006-08-17 am 10:36 -0400, ysgrifennodd Lennart Sorensen:

If it uses O_EXCL it will find the device busy assuming both parties use
O_EXCL properly.


Indeed but this is HAL so I suggest you strace it first 8)

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to  XXXX@XXXXX.COM 
More majordomo info at   http://www.**--****.com/ 
Please read the FAQ at   http://www.**--****.com/ 

Re: PATCH/FIX for drivers/cdrom/cdrom.c

Postby Helge Hafting » Fri, 18 Aug 2006 23:50:13 GMT





None on the file level I hope, for it will surely get abused.
Windows have exclusive open for example, and there acrobat reader
locks the pdf file it views, so you can't make a new version without
killing acrobat first.  (And then you have to restart it to
view the new file.)  Stupid in the extreme.  Fortunately, acrobat can't
do that on linux where there is no (easy) opportunity to do so.

There are many other examples - backup sw can't read files that
happens to be opened exclusive by some process.

I guess this particular case could be solved by fixing the cdrom
driver like this:

Whenever the device is opened for writing (i.e. someone is
burning a CD/DVD), then reject the probing ioctls HAL uses.
Or just make the device exclusive while burning.  Restore
normal operation as soon as the burn ends.   There is no
use for reading the device during a burn anyway - a special case
for CD/DVD writers.


Helge Hafting






-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to  XXXX@XXXXX.COM 
More majordomo info at   http://www.**--****.com/ 
Please read the FAQ at   http://www.**--****.com/ 



Return to linux

 

Who is online

Users browsing this forum: No registered users and 19 guest