From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 10ED2EB64DA for ; Thu, 22 Jun 2023 20:20:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229873AbjFVUUs (ORCPT ); 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> Precedence: bulk List-ID: X-Mailing-List: linux-trace-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