From: Jens Axboe <axboe@kernel.dk>
To: Bharath Vedartham <linux.bhar@gmail.com>,
akpm@linux-foundation.org, ira.weiny@intel.com,
jhubbard@nvidia.com
Cc: "Mauro Carvalho Chehab" <mchehab@kernel.org>,
"Dimitri Sivanich" <sivanich@sgi.com>,
"Arnd Bergmann" <arnd@arndb.de>,
"Greg Kroah-Hartman" <gregkh@linuxfoundation.org>,
"Alex Williamson" <alex.williamson@redhat.com>,
"Cornelia Huck" <cohuck@redhat.com>,
"Alexander Viro" <viro@zeniv.linux.org.uk>,
"Björn Töpel" <bjorn.topel@intel.com>,
"Magnus Karlsson" <magnus.karlsson@intel.com>,
"David S. Miller" <davem@davemloft.net>,
"Alexei Starovoitov" <ast@kernel.org>,
"Daniel Borkmann" <daniel@iogearbox.net>,
"Jakub Kicinski" <jakub.kicinski@netronome.com>,
"Jesper Dangaard Brouer" <hawk@kernel.org>,
"John Fastabend" <john.fastabend@gmail.com>,
"Enrico Weigelt" <info@metux.net>,
"Thomas Gleixner" <tglx@linutronix.de>,
"Alexios Zavras" <alexios.zavras@intel.com>,
"Dan Carpenter" <dan.carpenter@oracle.com>,
"Max Filippov" <jcmvbkbc@gmail.com>,
"Matt Sickler" <Matt.Sickler@daktronics.com>,
"Kirill A. Shutemov" <kirill.shutemov@linux.intel.com>,
"Keith Busch" <keith.busch@intel.com>,
YueHaibing <yuehaibing@huawei.com>,
linux-media@vger.kernel.org, linux-kernel@vger.kernel.org,
devel@driverdev.osuosl.org, kvm@vger.kernel.org,
linux-block@vger.kernel.org, linux-fsdevel@vger.kernel.org,
linux-mm@kvack.org, netdev@vger.kernel.org, bpf@vger.kernel.org,
xdp-newbies@vger.kernel.org
Subject: Re: [PATCH] mm/gup: Use put_user_page*() instead of put_page*()
Date: Sun, 14 Jul 2019 20:33:57 -0600 [thread overview]
Message-ID: <018ee3d1-e2f0-ca12-9f63-945056c09985@kernel.dk> (raw)
In-Reply-To: <1563131456-11488-1-git-send-email-linux.bhar@gmail.com>
On 7/14/19 1:08 PM, Bharath Vedartham wrote:
> diff --git a/fs/io_uring.c b/fs/io_uring.c
> index 4ef62a4..b4a4549 100644
> --- a/fs/io_uring.c
> +++ b/fs/io_uring.c
> @@ -2694,10 +2694,9 @@ static int io_sqe_buffer_register(struct io_ring_ctx *ctx, void __user *arg,
> * if we did partial map, or found file backed vmas,
> * release any pages we did get
> */
> - if (pret > 0) {
> - for (j = 0; j < pret; j++)
> - put_page(pages[j]);
> - }
> + if (pret > 0)
> + put_user_pages(pages, pret);
> +
> if (ctx->account_mem)
> io_unaccount_mem(ctx->user, nr_pages);
> kvfree(imu->bvec);
You handled just the failure case of the buffer registration, but not
the actual free in io_sqe_buffer_unregister().
--
Jens Axboe
next prev parent reply other threads:[~2019-07-15 2:34 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-07-14 19:08 [PATCH] mm/gup: Use put_user_page*() instead of put_page*() Bharath Vedartham
2019-07-14 23:33 ` John Hubbard
2019-07-14 23:33 ` John Hubbard
2019-07-15 6:56 ` Bharath Vedartham
2019-07-15 16:29 ` Ira Weiny
2019-07-15 19:35 ` Bharath Vedartham
2019-07-15 18:10 ` John Hubbard
2019-07-15 19:36 ` Bharath Vedartham
2019-07-15 2:33 ` Jens Axboe [this message]
2019-07-15 6:59 ` Bharath Vedartham
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=018ee3d1-e2f0-ca12-9f63-945056c09985@kernel.dk \
--to=axboe@kernel.dk \
--cc=Matt.Sickler@daktronics.com \
--cc=akpm@linux-foundation.org \
--cc=alex.williamson@redhat.com \
--cc=alexios.zavras@intel.com \
--cc=arnd@arndb.de \
--cc=ast@kernel.org \
--cc=bjorn.topel@intel.com \
--cc=bpf@vger.kernel.org \
--cc=cohuck@redhat.com \
--cc=dan.carpenter@oracle.com \
--cc=daniel@iogearbox.net \
--cc=davem@davemloft.net \
--cc=devel@driverdev.osuosl.org \
--cc=gregkh@linuxfoundation.org \
--cc=hawk@kernel.org \
--cc=info@metux.net \
--cc=ira.weiny@intel.com \
--cc=jakub.kicinski@netronome.com \
--cc=jcmvbkbc@gmail.com \
--cc=jhubbard@nvidia.com \
--cc=john.fastabend@gmail.com \
--cc=keith.busch@intel.com \
--cc=kirill.shutemov@linux.intel.com \
--cc=kvm@vger.kernel.org \
--cc=linux-block@vger.kernel.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=linux.bhar@gmail.com \
--cc=magnus.karlsson@intel.com \
--cc=mchehab@kernel.org \
--cc=netdev@vger.kernel.org \
--cc=sivanich@sgi.com \
--cc=tglx@linutronix.de \
--cc=viro@zeniv.linux.org.uk \
--cc=xdp-newbies@vger.kernel.org \
--cc=yuehaibing@huawei.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.