usb: gadget: mass_storage: make "file" and "ro" read only in some cases

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 <mina86@mina86.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
(cherry picked from commit 48a31af74404e6460eabca410bf0b4a625bfd372)

Signed-off-by: Do Quang Thang <dq-thang@jinso.co.jp>
2 files changed