From: Alan Stern <stern@rowland.harvard.edu>
To: Maxim Devaev <mdevaev@gmail.com>
Cc: linux-usb@vger.kernel.org, balbi@kernel.org,
gregkh@linuxfoundation.org, caihuoqing@baidu.com,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH v3] usb: gadget: f_mass_storage: forced_eject attribute
Date: Thu, 7 Jul 2022 13:23:50 -0400 [thread overview]
Message-ID: <YscWpjFlV60NybEA@rowland.harvard.edu> (raw)
In-Reply-To: <20220707170912.70505-1-mdevaev@gmail.com>
On Thu, Jul 07, 2022 at 08:09:13PM +0300, Maxim Devaev wrote:
> It allows to reset prevent_medium_removal flag and "eject" the image.
>
> The patch is a completely alternative implementation of the previously
> proposed [1], the idea of which was born after the mentioned discussion.
>
> Signed-off-by: Maxim Devaev <mdevaev@gmail.com>
> Link: https://lore.kernel.org/lkml/20220406092445.215288-1-mdevaev@gmail.com [1]
> ---
Greg's patch bot is going to complain that you didn't describe the
differences between v2 and v3 at this point.
And since you'll have to submit the patch again...
> +ssize_t fsg_store_forced_eject(struct fsg_lun *curlun, struct rw_semaphore *filesem,
> + const char *buf, size_t count)
> +{
> + int ret;
> +
... How about putting a comment line here, explaining that this
override will cause the medium to be ejected no matter what the host
wants?
> + curlun->prevent_medium_removal = 0;
> + ret = fsg_store_file(curlun, filesem, "", 0);
> + return ret < 0 ? ret : count;
> +}
> +EXPORT_SYMBOL_GPL(fsg_store_forced_eject);
In any case, in the next submission you can add:
Reviewed-by: Alan Stern <stern@rowland.harvard.edu>
Alan Stern
next prev parent reply other threads:[~2022-07-07 17:23 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-07-07 17:09 [PATCH v3] usb: gadget: f_mass_storage: forced_eject attribute Maxim Devaev
2022-07-07 17:23 ` Alan Stern [this message]
2022-07-10 20:19 ` Maxim Devaev
2022-07-07 18:38 ` Greg KH
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=YscWpjFlV60NybEA@rowland.harvard.edu \
--to=stern@rowland.harvard.edu \
--cc=balbi@kernel.org \
--cc=caihuoqing@baidu.com \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=mdevaev@gmail.com \
/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