Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp11455174rwd; Thu, 22 Jun 2023 13:34:29 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6Hmx3SifDjRmnlXwHA9Hb3cjCVahX/Ggsh3SHzHpeV3/U/HjZmxfjA+4eJ7F7eZwORQR2E X-Received: by 2002:a05:6808:f15:b0:3a0:411b:faa1 with SMTP id m21-20020a0568080f1500b003a0411bfaa1mr9831747oiw.46.1687466068759; Thu, 22 Jun 2023 13:34:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687466068; cv=none; d=google.com; s=arc-20160816; b=chcdgssEI39HKxMs+MJ38iHWsdIrbzOxgaU9oGsuNDga8gz3mP9vrlwH3LR9+qjVQz 4JKg/U83JayTgcuFbHolBYAm1YFQNdnHr+W8WaueYZekEpsFdVAIDSD984kBbg2/E5h0 UyDqOd/SlkAX8hUddGkDzLm6tZ6cTV3RxyP2XwgtQM5N2mgDwf2gcdnmTFP1hlfXSpEE R7hociFkcMI4aBgccAbsnrKfEkB524C35QTDdmchoKjHs6ZflRpv/UWeri30ySlo4a7J baetAblN2QsOuQmpbCDiPVmXHTgAyMb6Mx1UAUPgLvMHaJmcFAMNzjZurYpBwWQ+EbjV iHnw== 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:dkim-signature :dkim-filter; bh=RAT0iDUtzjz+5JfOsFH9SpTpq7B5LHWBm6Sv3uMm9Ds=; fh=apLrHjB4FoM0ezE4UxXDHd3J7aJtlAg7XodRfHXucwE=; b=xcCFCUXHlY9XG3qj9Yjlpj/z6ASqbGbCXbphevfb8rvBQusdJE2Mh2von2K7n+ten+ G7acHcou62TTttmA+7+5pR3/im+yjSYAF2WNhar5/AsLuJGMPv1deZkNqPnVxSjzXyXL fK5i7Wamz0umkmsrb/yFv2dlLZg1BLbGZ9QUNZ52+woXPpLnqfN6m0jXrLmIRT+jcWYO qpZ/3lwCWHJ7VeJiQnjavHJYrGi4gicHhOiTe7s/lQ1kpKT3YN9l3PmHDKpr9IpqEAKO a3AEFD4s5m9cOSBDSLXUsaSNJsEVX3WjHNivnFLdah53bpe+WK4vO7gB38RV3ap+7Oh1 Gu5g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.microsoft.com header.s=default header.b=PKN5ftEA; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.microsoft.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id d16-20020a17090ab31000b00256a4676b7asi341380pjr.14.2023.06.22.13.34.16; Thu, 22 Jun 2023 13:34:28 -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; dkim=pass header.i=@linux.microsoft.com header.s=default header.b=PKN5ftEA; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.microsoft.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230216AbjFVUUs (ORCPT + 99 others); Thu, 22 Jun 2023 16:20:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37970 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229691AbjFVUUr (ORCPT ); Thu, 22 Jun 2023 16:20:47 -0400 Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 490511BFE; Thu, 22 Jun 2023 13:20:46 -0700 (PDT) Received: from CPC-beaub-VBQ1L.localdomain (unknown [4.155.48.114]) by linux.microsoft.com (Postfix) with ESMTPSA id C88CF21C20AC; Thu, 22 Jun 2023 13:20:45 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com C88CF21C20AC DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1687465245; bh=RAT0iDUtzjz+5JfOsFH9SpTpq7B5LHWBm6Sv3uMm9Ds=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=PKN5ftEARR7Gra+CFHm7hKYRp+c569viadSpxfcuF2PLEZTxh5xzgn4zp5ap4kzcM l78ojKEfNTv165OE+6c5JzLMQg25sh+a2t7OT4TpUfWNcZSenf8fuAhkJdzq6crL+f cqb/rZW5GASX1DmHb9mz4P9/7fIRIrH2nJyW1unY= Date: Thu, 22 Jun 2023 20:20:40 +0000 From: Beau Belgrave To: sunliming Cc: rostedt@goodmis.org, mhiramat@kernel.org, kelulanainsley@gmail.com, linux-trace-kernel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v3 1/3] tracing/user_events: Fix incorrect return value for writing operation when events are disable Message-ID: References: <20230621060827.151564-1-sunliming@kylinos.cn> <20230621060827.151564-2-sunliming@kylinos.cn> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230621060827.151564-2-sunliming@kylinos.cn> X-Spam-Status: No, score=-19.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,ENV_AND_HDR_SPF_MATCH,RCVD_IN_DNSWL_MED, SPF_HELO_PASS,SPF_PASS,T_SCC_BODY_TEXT_LINE,USER_IN_DEF_DKIM_WL, USER_IN_DEF_SPF_WL autolearn=ham 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 Wed, Jun 21, 2023 at 02:08:24PM +0800, sunliming wrote: > The writing operation return the count of writes regardless of whether events > are enabled or disabled. Switch it to return 0 to indicates that the event > is disabled. > > Signed-off-by: sunliming This looks good to me. Acked-by: Beau Belgrave Thanks! > --- > kernel/trace/trace_events_user.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/kernel/trace/trace_events_user.c b/kernel/trace/trace_events_user.c > index 1ac5ba5685ed..c085ff829a58 100644 > --- a/kernel/trace/trace_events_user.c > +++ b/kernel/trace/trace_events_user.c > @@ -1957,7 +1957,8 @@ static ssize_t user_events_write_core(struct file *file, struct iov_iter *i) > > if (unlikely(faulted)) > return -EFAULT; > - } > + } else > + return 0; > > return ret; > } > -- > 2.25.1