From 48a31af74404e6460eabca410bf0b4a625bfd372 Mon Sep 17 00:00:00 2001 From: Michal Nazarewicz Date: Mon, 25 Jun 2012 16:40:22 +0200 Subject: [PATCH] usb: gadget: mass_storage: make "file" and "ro" read only in some cases MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit The “file” sysfs entry for LUNs was writable even for non-removable LUNs and the fsg_store_file() function did not check whether LUN is removable or not. This made it possible to change or even close LUN's backing file. The same is true for “ro” sysfs entry and LUNs simulating CD-ROM. For those LUNs, the file should not be writable. This commit introduces two new device_attribute structures for those two special cases so that the file/ro sysfs entries are made non-writable when not desired. Signed-off-by: Michal Nazarewicz Signed-off-by: Felipe Balbi --- Reading git-format-patch failed