Re: [PATCH 5/5] usb: gadget: mass_storage: Send correct number of LUNs to host

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 





On 06/22/2015 04:34 PM, Michal Nazarewicz wrote:
On Mon, Jun 22 2015, Krzysztof Opasiak wrote:
GET_MAX_LUN request should return number of realy created LUNs
not the size of preallocated array.

This patch changes fsg_common_set_nluns() to fsg_common_set_max_luns()
which now only allocates an empty array for luns and set nluns
to 0. While LUNS are create we simply count them and store result
in nluns which is send later to host.

Reported-by: David Fisher <david.fisher1@xxxxxxxxxxxx>
Signed-off-by: Krzysztof Opasiak <k.opasiak@xxxxxxxxxxx>

At this point I would just change common->luns to be an array rather
than a pointer.  This would remove need for max_luns all together.

Sounds like a good idea and I also though about it but I gave up due to memory usage. Most legacy gadgets reduce size of allocated luns array to number of received luns in module params. Adding array with static size will make this impossible. If we may don't care about this ~80 bytes I will be happy make common->luns array as it simplifies the code.

BR's
--
Krzysztof Opasiak
Samsung R&D Institute Poland
Samsung Electronics
--
To unsubscribe from this list: send the line "unsubscribe stable" in



[Index of Archives]     [Linux Kernel]     [Kernel Development Newbies]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Hiking]     [Linux Kernel]     [Linux SCSI]