• Jens Axboe's avatar
    [PATCH] DVD-R capability flag set incorrectly, /proc formatting fix · 1ec2fc7d
    Jens Axboe authored
    From John McKell <mckellj@iomega.com>:
    
      This patch for scsi/sr.c and cdrom/cdrom.c persuades
      /proc/sys/dev/cdrom/info to report that connecting a drive via USB
      rather than ATAPI in fact does not make it able to write DVD-R.
    
      Without this patch, when sr0 and hdd are the same type of device
      connected via USB and ATAPI respectively, I see:
    
    	$ cat /proc/sys/dev/cdrom/info:
    	drive name:             sr1     sr0     hdd
    	...
    	Can write CD-R:         1       0       0
    	Can write CD-RW:        1       0       0
    	Can read DVD:           0       0       0
    	Can write DVD-R:        1       1       0
    	Can write DVD-RAM:      0       0       0
    	Can read MRW:           0               0               0
    	Can write MRW:          0               0               0
    
      With this patch applied, instead I see:
    
    	$ cat /proc/sys/dev/cdrom/info:
    	drive name:             sr1     sr0     hdd
    	...
    	Can write CD-R:         1       0       0
    	Can write CD-RW:        1       0       0
    	Can read DVD:           0       0       0
    	Can write DVD-R:        0       0       0
    	Can write DVD-RAM:      0       0       0
    	Can read MRW:           0       0       0
    	Can write MRW:          0       0       0
    
      The sr1 device in particular is an ordinary CD-RW that in fact cannot
      write DVD-R.
    
      While messing with this code, I also thought to tweak the /proc
      formatting to align the tabbed columns.
    1ec2fc7d
sr.c 22.8 KB