lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Mon, 30 Jan 2023 15:38:03 +0000
From:   Chuck Lever III <chuck.lever@...cle.com>
To:     Christoph Hellwig <hch@....de>
CC:     Jens Axboe <axboe@...nel.dk>, Ilya Dryomov <idryomov@...il.com>,
        "Michael S. Tsirkin" <mst@...hat.com>,
        Jason Wang <jasowang@...hat.com>,
        Minchan Kim <minchan@...nel.org>,
        Sergey Senozhatsky <senozhatsky@...omium.org>,
        Keith Busch <kbusch@...nel.org>,
        Sagi Grimberg <sagi@...mberg.me>,
        Chaitanya Kulkarni <kch@...dia.com>,
        Martin Petersen <martin.petersen@...cle.com>,
        David Howells <dhowells@...hat.com>,
        Marc Dionne <marc.dionne@...istor.com>,
        Xiubo Li <xiubli@...hat.com>, Steve French <sfrench@...ba.org>,
        Trond Myklebust <trond.myklebust@...merspace.com>,
        Anna Schumaker <anna@...nel.org>,
        Mike Marshall <hubcap@...ibond.com>,
        Andrew Morton <akpm@...ux-foundation.org>,
        "David S. Miller" <davem@...emloft.net>,
        Eric Dumazet <edumazet@...gle.com>,
        Jakub Kicinski <kuba@...nel.org>,
        Paolo Abeni <pabeni@...hat.com>,
        "linux-block@...r.kernel.org" <linux-block@...r.kernel.org>,
        "ceph-devel@...r.kernel.org" <ceph-devel@...r.kernel.org>,
        "virtualization@...ts.linux-foundation.org" 
        <virtualization@...ts.linux-foundation.org>,
        "linux-nvme@...ts.infradead.org" <linux-nvme@...ts.infradead.org>,
        "linux-scsi@...r.kernel.org" <linux-scsi@...r.kernel.org>,
        "target-devel@...r.kernel.org" <target-devel@...r.kernel.org>,
        "kvm@...r.kernel.org" <kvm@...r.kernel.org>,
        "open list:NETWORKING [GENERAL]" <netdev@...r.kernel.org>,
        "linux-afs@...ts.infradead.org" <linux-afs@...ts.infradead.org>,
        CIFS <linux-cifs@...r.kernel.org>,
        "samba-technical@...ts.samba.org" <samba-technical@...ts.samba.org>,
        linux-fsdevel <linux-fsdevel@...r.kernel.org>,
        Linux NFS Mailing List <linux-nfs@...r.kernel.org>,
        "devel@...ts.orangefs.org" <devel@...ts.orangefs.org>,
        "io-uring@...r.kernel.org" <io-uring@...r.kernel.org>,
        "linux-mm@...ck.org" <linux-mm@...ck.org>
Subject: Re: [PATCH 21/23] sunrpc: use bvec_set_page to initialize bvecs



> On Jan 30, 2023, at 4:21 AM, Christoph Hellwig <hch@....de> wrote:
> 
> Use the bvec_set_page helper to initialize bvecs.
> 
> Signed-off-by: Christoph Hellwig <hch@....de>

Acked-by: Chuck Lever <chuck.lever@...cle.com>


> ---
> net/sunrpc/svcsock.c | 7 ++-----
> net/sunrpc/xdr.c     | 5 ++---
> 2 files changed, 4 insertions(+), 8 deletions(-)
> 
> diff --git a/net/sunrpc/svcsock.c b/net/sunrpc/svcsock.c
> index 815baf308236a9..91252adcae4696 100644
> --- a/net/sunrpc/svcsock.c
> +++ b/net/sunrpc/svcsock.c
> @@ -252,11 +252,8 @@ static ssize_t svc_tcp_read_msg(struct svc_rqst *rqstp, size_t buflen,
> 
> 	clear_bit(XPT_DATA, &svsk->sk_xprt.xpt_flags);
> 
> -	for (i = 0, t = 0; t < buflen; i++, t += PAGE_SIZE) {
> -		bvec[i].bv_page = rqstp->rq_pages[i];
> -		bvec[i].bv_len = PAGE_SIZE;
> -		bvec[i].bv_offset = 0;
> -	}
> +	for (i = 0, t = 0; t < buflen; i++, t += PAGE_SIZE)
> +		bvec_set_page(&bvec[i], rqstp->rq_pages[i], PAGE_SIZE, 0);
> 	rqstp->rq_respages = &rqstp->rq_pages[i];
> 	rqstp->rq_next_page = rqstp->rq_respages + 1;
> 
> diff --git a/net/sunrpc/xdr.c b/net/sunrpc/xdr.c
> index f7767bf224069f..afe7ec02d23229 100644
> --- a/net/sunrpc/xdr.c
> +++ b/net/sunrpc/xdr.c
> @@ -150,9 +150,8 @@ xdr_alloc_bvec(struct xdr_buf *buf, gfp_t gfp)
> 		if (!buf->bvec)
> 			return -ENOMEM;
> 		for (i = 0; i < n; i++) {
> -			buf->bvec[i].bv_page = buf->pages[i];
> -			buf->bvec[i].bv_len = PAGE_SIZE;
> -			buf->bvec[i].bv_offset = 0;
> +			bvec_set_page(&buf->bvec[i], buf->pages[i], PAGE_SIZE,
> +				      0);
> 		}
> 	}
> 	return 0;
> -- 
> 2.39.0
> 

--
Chuck Lever



Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ