public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] usb gadget: remove size limitation for storage cdrom
@ 2015-03-08  4:24 Dave Young
  2015-03-08 15:29 ` Alan Stern
  0 siblings, 1 reply; 6+ messages in thread
From: Dave Young @ 2015-03-08  4:24 UTC (permalink / raw)
  To: balbi, gregkh, linux-usb, linux-kernel

I used usb cdrom emulation to play video dvd for my daughter, but I got below
error:

[dave@darkstar tmp]$ cat /mnt/sr1/VIDEO_TS/VTS_01_5.VOB >/dev/null
cat: /mnt/sr1/VIDEO_TS/VTS_01_5.VOB: Input/output error
[dave@darkstar tmp]$ dmesg|tail -1
[ 3349.371857] sr1: rw=0, want=8028824, limit=4607996

The assumption of cdrom size is not right, we can create data dvd large then
4G, also mkisofs can create an iso with only one blank directory, the size is
less than 300 sectors. The size limit does not make sense, thus remove them. 

Signed-off-by: Dave Young <dyoung@redhat.com>
---
 drivers/usb/gadget/function/storage_common.c |    9 ---------
 1 file changed, 9 deletions(-)

--- linux.orig/drivers/usb/gadget/function/storage_common.c
+++ linux/drivers/usb/gadget/function/storage_common.c
@@ -247,15 +247,6 @@ int fsg_lun_open(struct fsg_lun *curlun,
 
 	num_sectors = size >> blkbits; /* File size in logic-block-size blocks */
 	min_sectors = 1;
-	if (curlun->cdrom) {
-		min_sectors = 300;	/* Smallest track is 300 frames */
-		if (num_sectors >= 256*60*75) {
-			num_sectors = 256*60*75 - 1;
-			LINFO(curlun, "file too big: %s\n", filename);
-			LINFO(curlun, "using only first %d blocks\n",
-					(int) num_sectors);
-		}
-	}
 	if (num_sectors < min_sectors) {
 		LINFO(curlun, "file too small: %s\n", filename);
 		rc = -ETOOSMALL;

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2015-03-12  1:35 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-03-08  4:24 [PATCH] usb gadget: remove size limitation for storage cdrom Dave Young
2015-03-08 15:29 ` Alan Stern
2015-03-09  5:33   ` Dave Young
2015-03-09 14:22     ` Alan Stern
2015-03-09 14:39       ` Alan Stern
2015-03-12  1:34       ` Dave Young

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox