Messages in this thread | | | Date | Thu, 7 Jul 2022 13:23:50 -0400 | From | Alan Stern <> | Subject | Re: [PATCH v3] usb: gadget: f_mass_storage: forced_eject attribute |
| |
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
| |