Re: [PATCH 3/3] usb: gadget: mass_storage: add documentation

From: Michal Nazarewicz
Date: Mon Jun 11 2012 - 12:08:47 EST


On Mon, 11 Jun 2012, Michal Nazarewicz wrote:
+ Mass Storage Gadget (or MSG) acts as a USB Mass Storage device,
+ appearing to the host as a disk or a CD-ROM drive. It supports
+ multiple logical units (LUNs). Backing storage for each LUN is
+ provided by a regular file or a block device, access can be limited
+ to read-only, and gadget can indicate that it is removable and/or
+ CD-ROM (the latter implies read-only access).

On Mon, 11 Jun 2012 17:25:15 +0200, Alan Stern <stern@xxxxxxxxxxxxxxxxxxx> wrote:
Does CD-ROM really imply read-only? If not, shouldn't it?

It indeed does:

curlun->ro = lcfg->cdrom || lcfg->ro;

+ - ro=b[,b...]
+
+ This parameter specifies whether each logical unit should be
+ reported as read only. This will prevent host from modifying the
+ backing files.
+
+ Note that if this flag for given logical unit is false but the
+ backing file could not be opened in read/write mode, the gadget
+ will fall back to read only mode anyway.
+
+ The default value for each logical unit is false.

Shouldn't the default be true for logical units that are cdroms?

Indeed. I've changed this last line to: The default value for non-CD-ROM
logical units is false; for logical units simulating CD-ROM it is forced
to true.

Very good. When you make the small changes listed above, you can add

Acked-by: Alan Stern <stern@xxxxxxxxxxxxxxxxxxx>

I'll resend it tomorrow in case anyone else has any comments.

--
Best regards, _ _
.o. | Liege of Serenely Enlightened Majesty of o' \,=./ `o
..o | Computer Science, MichaÅ âmina86â Nazarewicz (o o)
ooo +----<email/xmpp: mpn@xxxxxxxxxx>--------------ooO--(_)--Ooo--
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/