[for-linus,1/3] tracing/user_events: Fix incorrect return value for writing operation when events are disabled
Message ID | 20230628140338.707970985@goodmis.org |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp8963664vqr; Wed, 28 Jun 2023 07:20:40 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5tI3pBriTDmcHuIyMw2I3iqjNgwxxe9AmIZSlceJ45XXZI04Am50v3eKKUx9DhJvUapew2 X-Received: by 2002:a17:906:7a52:b0:988:9dea:ab9c with SMTP id i18-20020a1709067a5200b009889deaab9cmr21675340ejo.1.1687962039712; Wed, 28 Jun 2023 07:20:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687962039; cv=none; d=google.com; s=arc-20160816; b=rA4DcnOMV6sJTWxyU7oJlLjloEva5IY4Nw/gYNw/ISZtSHSx4r5Td6ynDCi2twVkea a791IdyACCwVh7SGXUPw7Ibi73wrcyGphGIi5FSwElGldfUi5UeECubl7StuXFoUsPCH 9o7f9Y8deBd8a2PgMwwzBa1vQPu/BindPaA/HvNTaROyiK3BeU7BtnbtBHGJJ++Q3bZc Ws45ntIoKGPny6uiyWdXwBsHDqCtt+IUKDmk3bmcnZjMf7+VjdW8ptxjG/0NJBS2WEN1 LaNow15VbXmM95xDwRmJ5FqUKc8nVhrLFVhfx5ifjLhYlKuDwcVxD2g1rj99/irB+Vob tcSg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:subject:cc:to:from:date :user-agent:message-id; bh=8HYs9F+2Nrmb1IMKfISausfDcAaD4qToL1WkjRihD+U=; fh=XyXCQ+Xm6Xbh43g0a2No8WvLIzKo19KiX0TngsJCwhU=; b=Pczdeo0oc5ivzZf2Z7J1mkUKKMF7CFAGh3+9Q74+CXreNkoYa2wwsLGA6sbOIXFcmW 5dRkrJ9RdxAIIw2rFsUBopZYHIbeNEmQHR5xpENKv2iTKIwWMQdQhMRtJR0YfU+/U3sf jkPYq+D/3uT3XKNYUZBwX6aosvBy1jTRWJhl6xPqaftwkRKOhlBv6X1ekdwV+jXyaE8R fbPfno2cB5eCBJQ9aqnV0twsi30cStxEn8gp2Ckd+NPZvhAbCPUP8k/dnXzPWdKXEY2C b2fQMhh3jCpZg+u8/ZB3vE+ZxOJq6APWcv2aQUx5MDG+3xxKrYKF1Dny8wI/3tKynJRQ VuAg== 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 Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id gf18-20020a170906e21200b009828e8bec17si5725306ejb.531.2023.06.28.07.20.15; Wed, 28 Jun 2023 07:20:39 -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 S231368AbjF1OFM (ORCPT <rfc822;ivan.orlov0322@gmail.com> + 99 others); Wed, 28 Jun 2023 10:05:12 -0400 Received: from dfw.source.kernel.org ([139.178.84.217]:39632 "EHLO dfw.source.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232414AbjF1ODl (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Wed, 28 Jun 2023 10:03:41 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 7E48661342 for <linux-kernel@vger.kernel.org>; Wed, 28 Jun 2023 14:03:40 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id EA91BC433C0; Wed, 28 Jun 2023 14:03:39 +0000 (UTC) Received: from rostedt by gandalf with local (Exim 4.96) (envelope-from <rostedt@goodmis.org>) id 1qEVli-002phL-2s; Wed, 28 Jun 2023 10:03:38 -0400 Message-ID: <20230628140338.707970985@goodmis.org> User-Agent: quilt/0.66 Date: Wed, 28 Jun 2023 08:54:49 -0400 From: Steven Rostedt <rostedt@goodmis.org> To: linux-kernel@vger.kernel.org Cc: Masami Hiramatsu <mhiramat@kernel.org>, Mark Rutland <mark.rutland@arm.com>, Andrew Morton <akpm@linux-foundation.org>, Beau Belgrave <beaub@linux.microsoft.com>, sunliming <sunliming@kylinos.cn> Subject: [for-linus][PATCH 1/3] tracing/user_events: Fix incorrect return value for writing operation when events are disabled References: <20230628125448.007243475@goodmis.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1769956483731628919?= X-GMAIL-MSGID: =?utf-8?q?1769956483731628919?= |
Series |
tracing: Final updates for 6.4+
|
|
Commit Message
Steven Rostedt
June 28, 2023, 12:54 p.m. UTC
From: sunliming <sunliming@kylinos.cn> The writing operation return the count of writes regardless of whether events are enabled or disabled. Switch it to return -EBADF to indicates that the event is disabled. Link: https://lkml.kernel.org/r/20230626111344.19136-2-sunliming@kylinos.cn Acked-by: Beau Belgrave <beaub@linux.microsoft.com> Signed-off-by: sunliming <sunliming@kylinos.cn> Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org> --- 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 8df0550415e7..09f7d9167b8e 100644 --- a/kernel/trace/trace_events_user.c +++ b/kernel/trace/trace_events_user.c @@ -2096,7 +2096,8 @@ static ssize_t user_events_write_core(struct file *file, struct iov_iter *i) if (unlikely(faulted)) return -EFAULT; - } + } else + return -EBADF; return ret; }