From: Krzysztof Opasiak <k.opasiak@samsung.com>
To: Michal Nazarewicz <mina86@mina86.com>, balbi@ti.com
Cc: stable@vger.kernel.org, david.fisher1@synopsys.com,
gregkh@linuxfoundation.org, andrzej.p@samsung.com,
m.szyprowski@samsung.com, linux-usb@vger.kernel.org
Subject: Re: [PATCH 5/5] usb: gadget: mass_storage: Send correct number of LUNs to host
Date: Mon, 22 Jun 2015 16:42:39 +0200 [thread overview]
Message-ID: <55881EDF.4070609@samsung.com> (raw)
In-Reply-To: <xa1t7fqvizh0.fsf@mina86.com>
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@synopsys.com>
>> Signed-off-by: Krzysztof Opasiak <k.opasiak@samsung.com>
>
> 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
prev parent reply other threads:[~2015-06-22 14:42 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-06-22 13:19 [PATCH 0/5] Mass storage fixes and improvements Krzysztof Opasiak
2015-06-22 13:19 ` [PATCH 1/5] usb: gadget: mass_storage: Free buffers if create lun fails Krzysztof Opasiak
2015-06-22 14:27 ` Michal Nazarewicz
2015-06-22 13:19 ` [PATCH 2/5] usb: gadget: mass_storage: Enforce contiguous LUN ids Krzysztof Opasiak
2015-06-22 14:31 ` Michal Nazarewicz
2015-06-22 14:45 ` Alan Stern
2015-06-24 16:01 ` Krzysztof Opasiak
2015-06-22 13:19 ` [PATCH 3/5] usb: gadget: mass_storage: Place EXPORT_SYMBOL_GPL() after func definition Krzysztof Opasiak
2015-06-22 14:31 ` Michal Nazarewicz
2015-06-22 13:19 ` [PATCH 4/5] usb: gadget: storage-common: Set FSG_MAX_LUNS to 16 Krzysztof Opasiak
2015-06-22 14:32 ` Michal Nazarewicz
2015-06-22 13:19 ` [PATCH 5/5] usb: gadget: mass_storage: Send correct number of LUNs to host Krzysztof Opasiak
2015-06-22 14:34 ` Michal Nazarewicz
2015-06-22 14:42 ` Krzysztof Opasiak [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=55881EDF.4070609@samsung.com \
--to=k.opasiak@samsung.com \
--cc=andrzej.p@samsung.com \
--cc=balbi@ti.com \
--cc=david.fisher1@synopsys.com \
--cc=gregkh@linuxfoundation.org \
--cc=linux-usb@vger.kernel.org \
--cc=m.szyprowski@samsung.com \
--cc=mina86@mina86.com \
--cc=stable@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox