aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGeorgios Toptsidis <gtoptsid@gmail.com>2015-09-25 03:50:08 -0400
committerJens Axboe <axboe@fb.com>2015-09-25 11:07:57 -0400
commitf7e7868b4743f1cc5e59e6e0ddd3ccf9cfe53a1b (patch)
tree9e4e423522ec16178282def5d7438399a6d0889f
parentbc07c10a3603a5ab3ef01ba42b3d41f9ac63d1b6 (diff)
cdrom: Random writing support for BD-RE media
Recently, i bought a blu-ray writer and noticed that while cdrecord worked perfectly, random writing didn't work on rewritable bd-re media. For example, dd if=/dev/zero of=/dev/sr0 bs=32768 count=2 gave the usual "read-only file system" message. After checking if the problem lies with my burner or firmware, i grep-ed the kernel source for EROFS. One of the results was in the cdrom driver. I tried to follow the function chain and ended in the cdrom_is_dvd_rw function where writing is permitted only for DVD-RAM and DVD+RW media. I added a new case label for 0x43 which is the profile name of BD-RE and now it works correctly for BD-RE too. Maybe there is a better way of implementing this, like a new function checking for blu-ray support and called from cdrom_open_write like it happens for mrw and dvdram media, but adding the case label worked. Thank you for your time. Signed-off-by: Jens Axboe <axboe@fb.com>
-rw-r--r--drivers/cdrom/cdrom.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/cdrom/cdrom.c b/drivers/cdrom/cdrom.c
index 5d28a45d2960..c206ccda899b 100644
--- a/drivers/cdrom/cdrom.c
+++ b/drivers/cdrom/cdrom.c
@@ -885,6 +885,7 @@ static int cdrom_is_dvd_rw(struct cdrom_device_info *cdi)
885 switch (cdi->mmc3_profile) { 885 switch (cdi->mmc3_profile) {
886 case 0x12: /* DVD-RAM */ 886 case 0x12: /* DVD-RAM */
887 case 0x1A: /* DVD+RW */ 887 case 0x1A: /* DVD+RW */
888 case 0x43: /* BD-RE */
888 return 0; 889 return 0;
889 default: 890 default:
890 return 1; 891 return 1;