Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp926063pxu; Wed, 7 Oct 2020 21:19:31 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwYeT70G4YO6xsM64GLRopmZE9oUQ4Z+Huo6X8VyNOFy9aK50EQMpx1QoQ5zEPjRidxBAoB X-Received: by 2002:a50:af21:: with SMTP id g30mr3520202edd.46.1602130771772; Wed, 07 Oct 2020 21:19:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1602130771; cv=none; d=google.com; s=arc-20160816; b=hfH2s4XKKBPQFP5Jnc0k62Qo5lMbAOBSu5RCwI8cmbQUXOXQg/SEsaXUD6pJfkxeUZ nNYcPkRrw9M6ouZl05kRkNiEIUADCLlsuy3NDbGvDrD0qbw8nHd7z1y0zS/3GntrZEHV yqgkd//39Nq/5lslT2WSBsZbFKK3+xtXjU2uQW4W3ElG/DRYHJTchveD2I3Z+MAxXS+j 23DqV8duODkXPIUauk78ASdZacxXJEAhriLO/n4QBq+zxxJOwUuE4FpEUDmoaL8Ea0ie zk349xUwVXuxjVbZYp1Jgiv3pZw6d2wFhr6OiuPnvZDCReIbBaZE/f3i6wwJRcDmmvH/ b15A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=sul8Dp6ULzHs9uhLFcHqUMOwUDviuVpIZeNf4gu07RM=; b=q7B+VveREn5JLs0nNsVAL3ihPD7KZpx3AHFHEE/t+Ade6D3xxE+k7SYqMmPaC0lDAL VLzmlg7M93OJg8S9EDGdlFSzTMbDdN3+G20k9URJzG4F1id3Z8f4YuoW8eyTFaSRhtv9 vuk8fgixwG9u/yMjP1LX2te3aEQ3yTACBVRxVRelzcFfq9Ya5vPpb3A5+Q/oIcbcZHT6 GfipqMaixw2a3uPuDPnNirx1XZPiu/ZrZKLW5I9vpVlhfiQYN6yEyPtGS6t79AEDmoFD hn4VYqaGpmULH5AJgrGBFr/aXKSEu0QVOonSxpzdNvRlsbiU+g5ue65zIkIYvhL7uiCE /1zg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=s9LeSxb+; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id d25si2792763ejc.621.2020.10.07.21.19.08; Wed, 07 Oct 2020 21:19:31 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=s9LeSxb+; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728268AbgJHDeV (ORCPT + 99 others); Wed, 7 Oct 2020 23:34:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40176 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728231AbgJHDeU (ORCPT ); Wed, 7 Oct 2020 23:34:20 -0400 Received: from mail-ej1-x644.google.com (mail-ej1-x644.google.com [IPv6:2a00:1450:4864:20::644]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 37FB3C061755 for ; Wed, 7 Oct 2020 20:34:20 -0700 (PDT) Received: by mail-ej1-x644.google.com with SMTP id e22so5987335ejr.4 for ; Wed, 07 Oct 2020 20:34:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:reply-to:references:mime-version :content-disposition:in-reply-to:user-agent; bh=sul8Dp6ULzHs9uhLFcHqUMOwUDviuVpIZeNf4gu07RM=; b=s9LeSxb+yukgTwhh48lz7LLaH8sjpqEtMl/ZhHbfSHZFph5k0mecRe8JXAtBmGVdC5 Oqzx+0eL9TYzThrCmFUNvJmF0m9yFkxbDVGJ9y9cwo6sUBPv9DXGf5aNPdN8x/0okGZR kkjKB+0f6/1iZnLCwcpEJBkTs3DFeN1VhpeF20w6kCFD+zKT/qHBWrp+KxzQsp/BnlHb 68t6OjlVLkXtxGe4rmBiVm+iF4W+xYRXDFbsztAeeUhtQO+BYiVGTge4LPuLTK8bTzTA b4lwK8Ek/m2qN3nD9YUuZmGb5Yjcsq1ItV0chMExgs5c+GlgMnft5kh+GwZxxCTuhW+R mJ2w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:reply-to :references:mime-version:content-disposition:in-reply-to:user-agent; bh=sul8Dp6ULzHs9uhLFcHqUMOwUDviuVpIZeNf4gu07RM=; b=J+ev2YPqYMPvCna16ncoUDeR36Us7sm5W7q4bQ48+Da2KJEfgMJuR21MXD72hUZTFS vf28HbEWjd7040kzsQlS6G99ObrGbmdFm6HUckMV4HuWqTb8z+JoOfzBsFpc+wI5I9qG Qy7HyuggPw3IZzinjsSgE9J5v3d3rtlQoX0LgxnegMmWke1cDJjuCVPpsCjrUNYbj5vf CqfFMjhtr7oIaxNc8RphwEdWXC+ezreN/k0RAMCYhb2wuSwbI9aj6W0QOMf8BTfhktKR tCzMQkV2PS2+0OSIexSLkmGKI8lRvx/TLjIzrUvvrtjrPcDXDDZhzgTLeFP6DdHzJzIt IGMA== X-Gm-Message-State: AOAM533JVEST4LLWXERdMW/kc4ph2F8euXnlsOvlEh4F7Dkg0jU5z3tf k2V44zL+jhHUrwNj5IGUmmOLMlLJCfg= X-Received: by 2002:a17:906:7f8c:: with SMTP id f12mr6796716ejr.8.1602128058943; Wed, 07 Oct 2020 20:34:18 -0700 (PDT) Received: from localhost ([185.92.221.13]) by smtp.gmail.com with ESMTPSA id jr9sm2945922ejb.87.2020.10.07.20.34.17 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 07 Oct 2020 20:34:17 -0700 (PDT) Date: Thu, 8 Oct 2020 03:34:16 +0000 From: Wei Yang To: Steven Rostedt Cc: Wei Yang , mingo@redhat.com, linux-kernel@vger.kernel.org Subject: Re: [PATCH 1/6] ftrace: define seq_file only for FMODE_READ Message-ID: <20201008033416.anmamvegf2g2zfwv@master> Reply-To: Wei Yang References: <20200831031104.23322-1-richard.weiyang@linux.alibaba.com> <20200831031104.23322-2-richard.weiyang@linux.alibaba.com> <20201006103638.153e39d3@gandalf.local.home> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20201006103638.153e39d3@gandalf.local.home> User-Agent: NeoMutt/20170113 (1.7.2) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Oct 06, 2020 at 10:36:38AM -0400, Steven Rostedt wrote: >On Mon, 31 Aug 2020 11:10:59 +0800 >Wei Yang wrote: > >> The purpose of the operation is to get ftrace_iterator, which is embedded >> in file or seq_file for FMODE_WRITE/FMODE_READ respectively. Since we >> don't have a seq_file for FMODE_WRITE case, it is meaningless to cast >> file->private_data to seq_file. >> >> Let's move the definition when there is a valid seq_file. > >I didn't pull in this patch because I find the original more expressive, >and there's really no benefit in changing it. > Got it, thanks >-- Steve > > >> >> Signed-off-by: Wei Yang >> --- >> kernel/trace/ftrace.c | 2 +- >> 1 file changed, 1 insertion(+), 1 deletion(-) >> >> diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c >> index edc233122598..12cb535769bc 100644 >> --- a/kernel/trace/ftrace.c >> +++ b/kernel/trace/ftrace.c >> @@ -5558,7 +5558,6 @@ static void __init set_ftrace_early_filters(void) >> >> int ftrace_regex_release(struct inode *inode, struct file *file) >> { >> - struct seq_file *m = (struct seq_file *)file->private_data; >> struct ftrace_iterator *iter; >> struct ftrace_hash **orig_hash; >> struct trace_parser *parser; >> @@ -5566,6 +5565,7 @@ int ftrace_regex_release(struct inode *inode, struct file *file) >> int ret; >> >> if (file->f_mode & FMODE_READ) { >> + struct seq_file *m = file->private_data; >> iter = m->private; >> seq_release(inode, file); >> } else -- Wei Yang Help you, Help me