Re: [PATCH 3/3] usb: gadget: mass_storage: require backing file fornon-removable LUNs

From: Alan Stern
Date: Mon Jun 18 2012 - 10:18:38 EST


On Mon, 18 Jun 2012, Michal Nazarewicz wrote:

> From: Michal Nazarewicz <mina86@xxxxxxxxxx>
>
> The fsg_file_store() function does not check whether a LUN is removable or not
> allowing one to specify an empty file name for a non-removable LUN. This
> commit adds explicit check of whether a file name is provided for
> non-removable LUNs.

Looks okay. Note that in file_storage.c, the "file" attribute isn't
writable if the LUN isn't removable, and the "ro" attribute isn't
writable if the LUN is a cdrom. Maybe you would prefer to do things
that way instead.

Alan Stern

--
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/