linux-nfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Trond Myklebust <trondmy@hammerspace.com>
To: "horms@kernel.org" <horms@kernel.org>,
	"chuck.lever@oracle.com" <chuck.lever@oracle.com>
Cc: "dsahern@kernel.org" <dsahern@kernel.org>,
	"wuyun.abel@bytedance.com" <wuyun.abel@bytedance.com>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	"davem@davemloft.net" <davem@davemloft.net>,
	"kuniyu@amazon.com" <kuniyu@amazon.com>,
	"luiz.dentz@gmail.com" <luiz.dentz@gmail.com>,
	"anna@kernel.org" <anna@kernel.org>,
	"pabeni@redhat.com" <pabeni@redhat.com>,
	"ying.xue@windriver.com" <ying.xue@windriver.com>,
	"willemb@google.com" <willemb@google.com>,
	"jmaloy@redhat.com" <jmaloy@redhat.com>,
	"tom@talpey.com" <tom@talpey.com>,
	"Dai.Ngo@oracle.com" <Dai.Ngo@oracle.com>,
	"kuba@kernel.org" <kuba@kernel.org>,
	"marcel@holtmann.org" <marcel@holtmann.org>,
	"linux-bluetooth@vger.kernel.org"
	<linux-bluetooth@vger.kernel.org>,
	"lizetao1@huawei.com" <lizetao1@huawei.com>,
	"ceph-devel@vger.kernel.org" <ceph-devel@vger.kernel.org>,
	"linux@treblig.org" <linux@treblig.org>,
	"tipc-discussion@lists.sourceforge.net"
	<tipc-discussion@lists.sourceforge.net>,
	"okorniev@redhat.com" <okorniev@redhat.com>,
	"jacob.e.keller@intel.com" <jacob.e.keller@intel.com>,
	"quic_abchauha@quicinc.com" <quic_abchauha@quicinc.com>,
	"edumazet@google.com" <edumazet@google.com>,
	"neilb@suse.de" <neilb@suse.de>,
	"jlayton@kernel.org" <jlayton@kernel.org>,
	"idryomov@gmail.com" <idryomov@gmail.com>,
	"linux-nfs@vger.kernel.org" <linux-nfs@vger.kernel.org>,
	"xiubli@redhat.com" <xiubli@redhat.com>,
	"gouhao@uniontech.com" <gouhao@uniontech.com>,
	"johan.hedberg@gmail.com" <johan.hedberg@gmail.com>
Subject: Re: [PATCH net-next 8/8] SUNRPC: use min() to simplify the code
Date: Sat, 24 Aug 2024 18:33:29 +0000	[thread overview]
Message-ID: <a44fbac0012c7f552867777dac41f85a554d6f73.camel@hammerspace.com> (raw)
In-Reply-To: <Zsokv8+9aDoR4uOu@tissot.1015granger.net>

On Sat, 2024-08-24 at 14:21 -0400, Chuck Lever wrote:
> On Sat, Aug 24, 2024 at 07:07:50PM +0100, Simon Horman wrote:
> > On Thu, Aug 22, 2024 at 09:39:08PM +0800, Li Zetao wrote:
> > > When reading pages in xdr_read_pages, the number of XDR encoded
> > > bytes
> > > should be less than the len of aligned pages, so using min() here
> > > is
> > > very semantic.
> > > 
> > > Signed-off-by: Li Zetao <lizetao1@huawei.com>
> > > ---
> > >  net/sunrpc/xdr.c | 2 +-
> > >  1 file changed, 1 insertion(+), 1 deletion(-)
> > > 
> > > diff --git a/net/sunrpc/xdr.c b/net/sunrpc/xdr.c
> > > index 62e07c330a66..6746e920dbbb 100644
> > > --- a/net/sunrpc/xdr.c
> > > +++ b/net/sunrpc/xdr.c
> > > @@ -1602,7 +1602,7 @@ unsigned int xdr_read_pages(struct
> > > xdr_stream *xdr, unsigned int len)
> > >  	end = xdr_stream_remaining(xdr) - pglen;
> > >  
> > >  	xdr_set_tail_base(xdr, base, end);
> > > -	return len <= pglen ? len : pglen;
> > > +	return min(len, pglen);
> > 
> > Both len and pglen are unsigned int, so this seems correct to me.
> > 
> > And the code being replaced does appear to be a min() operation in
> > both form and function.
> > 
> > Reviewed-by: Simon Horman <horms@kernel.org>
> > 
> > However, I don't believe SUNRPC changes usually don't go through
> > next-next.
> > So I think this either needs to be reposted or get some acks from
> > Chuck Lever (already CCed).
> > 
> > Chuck, perhaps you can offer some guidance here?
> > 
> > >  }
> > >  EXPORT_SYMBOL_GPL(xdr_read_pages);
> > >  
> > > -- 
> > > 2.34.1
> > > 
> > > 
> 
> Changes to net/sunrpc/ can go through Anna and Trond's NFS client
> trees, through the NFSD tree, or via netdev, but they are typically
> taken through the NFS-related trees.
> 
> Unless the submitter or the relevant maintainers prefer otherwise,
> I don't see a problem with this one going through netdev. Let me
> know otherwise.
> 
> Acked-by: Chuck Lever <chuck.lever@oracle.com>
> 
> 

What is the value of this change? Unless the current code is actually
broken or somehow difficult to read, then I much prefer to leave it
untouched so that any future back ports of fixes to code around that
line remain trivial.

So NACK to this change for now.

-- 
Trond Myklebust
Linux NFS client maintainer, Hammerspace
trond.myklebust@hammerspace.com



  reply	other threads:[~2024-08-24 18:33 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-22 13:39 [PATCH net-next 0/8] Some modifications to optimize code readability Li Zetao
2024-08-22 13:39 ` [PATCH net-next 1/8] atm: use min() to simplify the code Li Zetao
2024-08-22 13:39   ` Dr. David Alan Gilbert
2024-08-22 13:50     ` Li Zetao
2024-08-22 20:20       ` Jacob Keller
2024-08-22 13:39 ` [PATCH net-next 2/8] Bluetooth: " Li Zetao
2024-08-24 18:15   ` Simon Horman
2024-08-22 13:39 ` [PATCH net-next 3/8] net: caif: use max() " Li Zetao
2024-08-24 17:37   ` Simon Horman
2024-08-22 13:39 ` [PATCH net-next 4/8] libceph: use min() " Li Zetao
2024-08-24 18:12   ` Simon Horman
2024-08-25 16:21     ` Ilya Dryomov
2024-08-27  7:31       ` Ilya Dryomov
2024-08-22 13:39 ` [PATCH net-next 5/8] net: remove redundant judgments " Li Zetao
2024-08-24 18:16   ` Simon Horman
2024-08-22 13:39 ` [PATCH net-next 6/8] ipv6: mcast: use min() " Li Zetao
2024-08-24 17:57   ` Simon Horman
2024-08-22 13:39 ` [PATCH net-next 7/8] tipc: " Li Zetao
2024-08-24 18:03   ` Simon Horman
2024-08-22 13:39 ` [PATCH net-next 8/8] SUNRPC: " Li Zetao
2024-08-24 18:07   ` Simon Horman
2024-08-24 18:21     ` Chuck Lever
2024-08-24 18:33       ` Trond Myklebust [this message]
2024-08-26 17:00 ` [PATCH net-next 0/8] Some modifications to optimize code readability patchwork-bot+netdevbpf
2024-09-12 16:33 ` patchwork-bot+bluetooth

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=a44fbac0012c7f552867777dac41f85a554d6f73.camel@hammerspace.com \
    --to=trondmy@hammerspace.com \
    --cc=Dai.Ngo@oracle.com \
    --cc=anna@kernel.org \
    --cc=ceph-devel@vger.kernel.org \
    --cc=chuck.lever@oracle.com \
    --cc=davem@davemloft.net \
    --cc=dsahern@kernel.org \
    --cc=edumazet@google.com \
    --cc=gouhao@uniontech.com \
    --cc=horms@kernel.org \
    --cc=idryomov@gmail.com \
    --cc=jacob.e.keller@intel.com \
    --cc=jlayton@kernel.org \
    --cc=jmaloy@redhat.com \
    --cc=johan.hedberg@gmail.com \
    --cc=kuba@kernel.org \
    --cc=kuniyu@amazon.com \
    --cc=linux-bluetooth@vger.kernel.org \
    --cc=linux-nfs@vger.kernel.org \
    --cc=linux@treblig.org \
    --cc=lizetao1@huawei.com \
    --cc=luiz.dentz@gmail.com \
    --cc=marcel@holtmann.org \
    --cc=neilb@suse.de \
    --cc=netdev@vger.kernel.org \
    --cc=okorniev@redhat.com \
    --cc=pabeni@redhat.com \
    --cc=quic_abchauha@quicinc.com \
    --cc=tipc-discussion@lists.sourceforge.net \
    --cc=tom@talpey.com \
    --cc=willemb@google.com \
    --cc=wuyun.abel@bytedance.com \
    --cc=xiubli@redhat.com \
    --cc=ying.xue@windriver.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).