Received: by 2002:a25:e74b:0:0:0:0:0 with SMTP id e72csp1652284ybh; Thu, 16 Jul 2020 19:22:58 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwo1V2A/NMdsQzg15lkyZ+6r6zbZTCg4vyQuaxNM7AL3YWWzbo8W42w7nUZ69wOMQRorf/b X-Received: by 2002:a17:906:3984:: with SMTP id h4mr6971499eje.254.1594952578347; Thu, 16 Jul 2020 19:22:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594952578; cv=none; d=google.com; s=arc-20160816; b=Y0DWJpyOT4wsiS26gh3HxZFlJN9DV8Gxm0lAXW33zhBMOoCgB4ZKAiBdW9Wd3RRfKK Q3YZsLsPcSw2V5NL92dDqsJdBT/MuXwOwR5wwTyuJBNkMVhtUd/b7RU2bkTjLxkeealx fzfGbuYY+fTv6uYwgDS5VwiyKmX625gYTDAwfgnLou9lNGlS56a74SzrMbAM39QO9cX0 F9yBSbQuwUPzuTmPW3ANe4hufVJRJkAOViTnAgxZEEWE9YKYpt/I7vc8IKnoPc7s+R48 DNc/UGzJ9ftTMnfpqY08lvNoL3QIB/rNWb9IuvMW7CLTuC3JdooF5Q8mzT6UjzfC7VfT 072A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:subject:autocrypt:references:cc:to:from; bh=d4MJKCPLVqI5cL1DE8FPoxAiwP/Ge2MlwMWee4a9u5I=; b=PbJOJz6obtOqyIlGOow0ghu0b2bY4BKlb2CHEMy08C22nZEeA6v6clZIo6FZB8hMTK A/3FwBogRP6g/2yRQ38a/ynlVeXWjcHbTjMbUQ29FOKO7/gl8vIQHBXdktV5z6t6AG02 vL3JDyvN/vokJoOTJ2XV1J9e8WPpGNVPj4ZPMoTM89JQAS8OQ2Nmagqz0LX5zk2IZvv0 k9f0pygEztqhSBXwULjqZPttn8JxwnOYKHoN2oecTtQazGrlWiNoBU9gX9vszS0vHOFi mtAvWPrbJBcPv+DBAUA1sW4FUyMlxSY5N/kOEqClYg9NA2fjKrKJw/rWcHnjXp5KXDaw lJaA== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id x18si4703943ejd.51.2020.07.16.19.22.35; Thu, 16 Jul 2020 19:22:58 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726234AbgGQCW0 (ORCPT + 99 others); Thu, 16 Jul 2020 22:22:26 -0400 Received: from mx2.suse.de ([195.135.220.15]:37358 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726130AbgGQCWZ (ORCPT ); Thu, 16 Jul 2020 22:22:25 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 82EB3AB76; Fri, 17 Jul 2020 02:22:26 +0000 (UTC) From: Coly Li To: Qinglang Miao Cc: Greg Kroah-Hartman , Kent Overstreet , linux-tegra@vger.kernel.org, linux-kernel@vger.kernel.org, liuyongqiang13@huawei.com References: <20200716090313.13216-1-miaoqinglang@huawei.com> Autocrypt: addr=colyli@suse.de; keydata= mQINBFYX6S8BEAC9VSamb2aiMTQREFXK4K/W7nGnAinca7MRuFUD4JqWMJ9FakNRd/E0v30F qvZ2YWpidPjaIxHwu3u9tmLKqS+2vnP0k7PRHXBYbtZEMp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AmAhsMFiEE6j5FL/T5SGCN6PrQxzkHk2t9+PwFAlxHziAFCRj7 5/EACgkQxzkHk2t9+PxgfA//cH5R1DvpJPwraTAl24SUcG9EWe+NXyqveApe05nk15zEuxxd e4zFEjo+xYZilSveLqYHrm/amvQhsQ6JLU+8N60DZHVcXbw1Eb8CEjM5oXdbcJpXh1/1BEwl 4phsQMkxOTns51bGDhTQkv4lsZKvNByB9NiiMkT43EOx14rjkhHw3rnqoI7ogu8OO7XWfKcL CbchjJ8t3c2XK1MUe056yPpNAT2XPNF2EEBPG2Y2F4vLgEbPv1EtpGUS1+JvmK3APxjXUl5z 6xrxCQDWM5AAtGfM/IswVjbZYSJYyH4BQKrShzMb0rWUjkpXvvjsjt8rEXpZEYJgX9jvCoxt oqjCKiVLpwje9WkEe9O9VxljmPvxAhVqJjX62S+TGp93iD+mvpCoHo3+CcvyRcilz+Ko8lfO hS9tYT0HDUiDLvpUyH1AR2xW9RGDevGfwGTpF0K6cLouqyZNdhlmNciX48tFUGjakRFsxRmX K0Jx4CEZubakJe+894sX6pvNFiI7qUUdB882i5GR3v9ijVPhaMr8oGuJ3kvwBIA8lvRBGVGn 9xvzkQ8Prpbqh30I4NMp8MjFdkwCN6znBKPHdjNTwE5PRZH0S9J0o67IEIvHfH0eAWAsgpTz +jwc7VKH7vkvgscUhq/v1/PEWCAqh9UHy7R/jiUxwzw/288OpgO+i+2l11Y= Subject: Re: [PATCH -next] bcache: Convert to DEFINE_SHOW_ATTRIBUTE Message-ID: <639a9561-2824-b668-42b3-b69f016f54e1@suse.de> Date: Fri, 17 Jul 2020 10:22:17 +0800 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2020/7/16 17:54, Coly Li wrote: > On 2020/7/16 17:03, Qinglang Miao wrote: >> From: Yongqiang Liu >> > > Hi Qianlang and Yongqiang, > >> Use DEFINE_SHOW_ATTRIBUTE macro to simplify the code. >> >> Signed-off-by: Yongqiang Liu >> --- >> drivers/md/bcache/closure.c | 16 +++------------- >> 1 file changed, 3 insertions(+), 13 deletions(-) >> >> diff --git a/drivers/md/bcache/closure.c b/drivers/md/bcache/closure.c >> index 99222aa5d..37b9c5d49 100644 >> --- a/drivers/md/bcache/closure.c >> +++ b/drivers/md/bcache/closure.c >> @@ -159,7 +159,7 @@ void closure_debug_destroy(struct closure *cl) >> >> static struct dentry *closure_debug; >> >> -static int debug_seq_show(struct seq_file *f, void *data) >> +static int debug_show(struct seq_file *f, void *data) >> { >> struct closure *cl; >> >> @@ -188,17 +188,7 @@ static int debug_seq_show(struct seq_file *f, void *data) >> return 0; >> } >> >> -static int debug_seq_open(struct inode *inode, struct file *file) >> -{ >> - return single_open(file, debug_seq_show, NULL); >> -} >> - > > Here NULL is sent to single_open(), in DEFINE_SHOW_ATTRIBUTE() > inode->i_private is sent into single_open(). I don't see the commit log > mentions or estimates such change. > Still this change modifies original code logic, I need to know the exact effect before taking this patch. > >> -static const struct file_operations debug_ops = { >> - .owner = THIS_MODULE, >> - .open = debug_seq_open, >> - .read_iter = seq_read_iter, > > I doubt this patch applies to Linux v5.8-rc, this is how debug_ops is > defined in Linux v5.8-rc5, > I realize your patch is against linux-next, which is ahead of both linux-block and mainline tree. So this patch does not apply to linux-block tree, which is my upstream for bcache going to upstream. I suggest to generate the patch against latest mainline kernel, or linux-block branch for next merge window (for 5.9 it is branch remotes/origin/for-5.9/drivers). > 196 static const struct file_operations debug_ops = { > 197 .owner = THIS_MODULE, > 198 .open = debug_seq_open, > 199 .read = seq_read, > 200 .release = single_release > 201 }; > >> - .release = single_release >> -}; >> +DEFINE_SHOW_ATTRIBUTE(debug); >> >> void __init closure_debug_init(void) >> { >> @@ -209,7 +199,7 @@ void __init closure_debug_init(void) >> * about this. >> */ >> closure_debug = debugfs_create_file( >> - "closures", 0400, bcache_debug, NULL, &debug_ops); >> + "closures", 0400, bcache_debug, NULL, &debug_fops); >> } >> #endif > > Do you test your change with upstream kernel ? Or at least you should > try to apply and compile the patch with latest upstream kernel. I withdraw the above wrong word, the -next tag in patch subject was overlooked by me. Next time I will try to avoid such mistake. Coly Li