public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
From: Pat LaVarre <p.lavarre@ieee.org>
To: linux-scsi@vger.kernel.org
Subject: writable mmc profiles actually are writable
Date: 06 Oct 2003 12:12:26 -0600	[thread overview]
Message-ID: <1065463946.5185.8.camel@patehci2> (raw)
In-Reply-To: <1065460336.10804.1.camel@patehci2>

> Newsgroups: mlist.linux.scsi
> Date: 2003-09-10 16:00:27 PST
> Subject: Re: [PATCH] mount -w of dvd+rw etc. in vanilla 2.6
> From: Patrick Mansfield (patmans@us.ibm.com)
>
> Should sd.c and sr.c be calling set_device_ro?
> (after adding a read only block device, or
> changing back to read/write)?

That good question stands open, I think.

The following inline plain text, now revved for -test6 & posted here,
allows modprobe to overcome such uncooperative attitudes as:

$ sudo dd if=/dev/scd2 bs=2k count=1 | wc
1+0 records in
1+0 records out
      0       0    2048
$
$ sudo dd of=/dev/scd2 bs=2k count=1 if=/dev/zero
dd: opening `/dev/scd2': Read-only file system
$

Allowing dd, mkudffs, etc. are the good consequences.  The evil
consequences I do not yet know.  I do notice we have achieved
writability without extending the enumeration that `cat
/proc/sys/dev/cdrom/info` dumps:

Can write CD-R:         0
Can write CD-RW:        0
Can read DVD:           0
Can write DVD-R:        0
Can write DVD-RAM:      0

Pat LaVarre

diff -ur linux-2.6.0-test6/drivers/cdrom/cdrom.c linux/drivers/cdrom/cdrom.c
--- linux-2.6.0-test6/drivers/cdrom/cdrom.c	2003-09-27 18:50:10.000000000 -0600
+++ linux/drivers/cdrom/cdrom.c	2003-10-06 11:53:41.826299728 -0600
@@ -426,8 +426,8 @@
 	if ((fp->f_flags & O_NONBLOCK) && (cdi->options & CDO_USE_FFLAGS))
 		ret = cdi->ops->open(cdi, 1);
 	else {
-		if ((fp->f_mode & FMODE_WRITE) && !CDROM_CAN(CDC_DVD_RAM))
-			return -EROFS;
+//		if ((fp->f_mode & FMODE_WRITE) && !CDROM_CAN(CDC_DVD_RAM))
+//			return -EROFS;
 
 		ret = open_for_data(cdi);
 	}
diff -ur linux-2.6.0-test6/drivers/scsi/sr.c linux/drivers/scsi/sr.c
--- linux-2.6.0-test6/drivers/scsi/sr.c	2003-09-27 18:50:13.000000000 -0600
+++ linux/drivers/scsi/sr.c	2003-10-06 11:51:59.655832000 -0600
@@ -327,8 +327,8 @@
 	}
 
 	if (rq_data_dir(SCpnt->request) == WRITE) {
-		if (!cd->device->writeable)
-			return 0;
+//		if (!cd->device->writeable)
+//			return 0;
 		SCpnt->cmnd[0] = WRITE_10;
 		SCpnt->sc_data_direction = SCSI_DATA_WRITE;
 	} else if (rq_data_dir(SCpnt->request) == READ) {



  reply	other threads:[~2003-10-06 18:12 UTC|newest]

Thread overview: 50+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-09-22 22:55 [linux-usb-devel] Re: USB storage problems on OHCI Pat LaVarre
2003-09-29 14:54 ` Pat LaVarre
2003-09-29 15:50   ` 2 KiB/block loopback found where Pat LaVarre
2003-09-29 16:46     ` Jens Axboe
2003-09-29 17:12       ` Pat LaVarre
2003-09-29 20:02         ` Pat LaVarre
2003-10-06 17:12           ` max GiB written per boot Pat LaVarre
2003-10-06 18:12             ` Pat LaVarre [this message]
2003-10-06 18:22               ` writable mmc profiles actually are writable Jens Axboe
2003-10-06 18:25                 ` Jens Axboe
2003-10-06 19:50                   ` Pat LaVarre
2003-10-06 20:38                     ` Jens Axboe
2003-10-06 20:58                       ` Pat LaVarre
2003-10-06 22:14                         ` Pat LaVarre
2003-10-06 23:56                           ` Pat LaVarre
2003-10-07  5:38                             ` Jens Axboe
2003-10-07  6:45                               ` Matthew Dharm
2003-10-07  6:48                                 ` Jens Axboe
2003-10-07  7:00                                   ` Matthew Dharm
2003-10-07  7:04                                     ` Jens Axboe
2003-10-10 20:36                                       ` Pat LaVarre
2003-10-10 21:04                                         ` Pat LaVarre
2003-10-10 21:25                                           ` Pat LaVarre
2003-10-10 22:43                                             ` Pat LaVarre
2003-10-10 23:16                                               ` Pat LaVarre
2003-10-11  0:43                                                 ` Pat LaVarre
2003-10-07 20:46                               ` Pat LaVarre
2003-10-07 21:00                                 ` Jens Axboe
2003-10-09 23:01                                   ` Pat LaVarre
2003-10-07  7:00                         ` Jens Axboe
2003-10-06 20:10                 ` Pat LaVarre
2003-10-06 20:28                   ` Jens Axboe
2003-10-06 20:21                 ` Pat LaVarre
2003-10-06 20:33                   ` Jens Axboe
2003-10-06 21:00             ` max GiB written per boot Pat LaVarre
2003-10-06 23:47               ` Pat LaVarre
2003-10-07  5:57                 ` Jens Axboe
2003-10-07 22:12                   ` Randy.Dunlap
2003-10-07 22:57                     ` Willem Riede
2003-10-08  1:27                       ` Randy.Dunlap
2003-10-08  4:34                         ` Randy.Dunlap
2003-10-08  6:44                           ` Jens Axboe
2003-10-09 21:59                     ` Pat LaVarre
2003-10-10 20:54                       ` Pat LaVarre
2003-10-07  0:51         ` 2 KiB/block loopback found where Pat LaVarre
2003-09-29 17:55     ` aligned /dev/scd$n reads less rare how Pat LaVarre
2003-09-29 19:39       ` zip of GiB cross-platform Pat LaVarre
2003-09-29 19:50         ` Matthew Wilcox
2003-09-29 19:56           ` Pat LaVarre
2003-10-24 14:41       ` aligned /dev/scd$n reads less rare how Pat LaVarre

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=1065463946.5185.8.camel@patehci2 \
    --to=p.lavarre@ieee.org \
    --cc=linux-scsi@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