Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp3990567imw; Thu, 7 Jul 2022 10:46:32 -0700 (PDT) X-Google-Smtp-Source: AGRyM1v3GrCfsxlJ/F6oBVhzF6rQSuDmrxHqEFKfUMSsJHRWTpj+t8o3y3/nCED9HV0MW2QeyjU6 X-Received: by 2002:aa7:dd48:0:b0:437:9074:8bc5 with SMTP id o8-20020aa7dd48000000b0043790748bc5mr42082643edw.266.1657215991820; Thu, 07 Jul 2022 10:46:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1657215991; cv=none; d=google.com; s=arc-20160816; b=CodPR8fg3pJW+r5Uz1aPBXjPjjhOBNAy69eqbSjzdaZ/H6kNjcOfzPpRfe+lutrI0U V8ygtMJYAz6KwAXpy0aOOPORosdIRWBm55XF+8KlTe7NGT2iers/kmjCplG6U63j5D3x 8pzGXnNRYPWBGflr0w305S7scqAjVjtb0b0k0RV8X7AMrriUwa7E5/fEWfyZ0xqwMq30 fVQQSK1WhZE1hftwOAXL8auqMQRNR/YdL9E2mIozFNaeYyy4pCD2st1E+8LQl4PQGz+Q 74y1OtcgjVZhND360aMjtno6EgHpWlaz2maKC5kFC3fMAiw4dPnVRJ6vPFqwVv+M/pec sguQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=oMsAyk3RyV6IKPoIz4ET84QF+swfQ4ShIg0BOevm1MA=; b=auBSx/iNlEhrB6pMfyRYDQW48gKEv75K5lacf/GErT/M00/flPppfZ2rgmevbzlo9v bwUcVqNfkqRHs9/DWohj9qtZDD5yfYQ4Y3xUrC/MGxoC5q4a5+lTOmuxPo3LGfRf03Fo bJNsJHbRFzUzBwQ8Ay4M8L9GDnGe9XVfLJJHXR3/D7GHnWK1ywKrWDbM5jUZqvnRXkSR IVhlhHtyt5/3snm7HSRqeOxuITMwaq2QwIYKF0GoT8HuF8ew/ecusNUaKFIEfezlJWxp TmYcqK5DPhHcnT8Vp9sUS823nQSqFySSlvEeJlZPcqKMgrqyhEechW/rjQJDqboxwKVs x28g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id e7-20020a170906748700b006feb0e0856dsi46515626ejl.653.2022.07.07.10.46.03; Thu, 07 Jul 2022 10:46:31 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235833AbiGGRX6 (ORCPT + 99 others); Thu, 7 Jul 2022 13:23:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34456 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235339AbiGGRX5 (ORCPT ); Thu, 7 Jul 2022 13:23:57 -0400 Received: from netrider.rowland.org (netrider.rowland.org [192.131.102.5]) by lindbergh.monkeyblade.net (Postfix) with SMTP id 20FA04F1A2 for ; Thu, 7 Jul 2022 10:23:51 -0700 (PDT) Received: (qmail 433016 invoked by uid 1000); 7 Jul 2022 13:23:50 -0400 Date: Thu, 7 Jul 2022 13:23:50 -0400 From: Alan Stern To: Maxim Devaev 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 Message-ID: References: <20220707170912.70505-1-mdevaev@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220707170912.70505-1-mdevaev@gmail.com> X-Spam-Status: No, score=-1.7 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,SPF_HELO_PASS,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 > 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 Alan Stern