Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp3665043ybi; Sun, 14 Jul 2019 19:34:43 -0700 (PDT) X-Google-Smtp-Source: APXvYqwdrlEW90NiA0p1ymA9j0d4tTtKiGLAkztmOUBdq3VHDh16i0YN152gzuEhs3QZfKzqSWUi X-Received: by 2002:a63:c34c:: with SMTP id e12mr23751606pgd.195.1563158082926; Sun, 14 Jul 2019 19:34:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563158082; cv=none; d=google.com; s=arc-20160816; b=uhG3xnGNwowPDzqH1X5y5Ocm+JbBq9X04X+A0w2j4/78Ii44HYhGyfGcAl8o9/cNlr CsL57VOpMZuW2YXV795CHcZFLRFTBPMd8OAbLET+IIBSHifhX3ipRkj53ef1fxuM2s0u 8vTM8ccyILZuXHQxEQNz/53PjkJo0Pwi84fWnZe8YSadfE72yNw8/knQxIGKjBRInEek VNAbGfQLel3gIBV/yPFlEN5jok24iDm27VC5bhIUiNln9jTf/uro9BG+ryMJ+UQRZo28 Z8hK0zQqijRU4bwOTtlY6ncX2/l+lYRYsHynrHUvygXHUK3kxoNWLvh3G0Mg395Klsdp R1Og== 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:from:references:cc:to:subject:dkim-signature; bh=j1D3jAEemUPemgo3Jj5nb6GS6101sWhcpLMgfsoNq8g=; b=vlOX1nPsxdc4pXeCk7OqtfRDhA+rDWwKW6RmvhT8U6eSfFazVeeKZC+mTiD0IScVY4 MTW+C8KpU80fBKFe0SbsR/1FEfBNmQgT5ymHq8+Joajan8MBmv+LWkbFtrcWMK3q9tiu 9ORfQRCXhUTfUR/pNlSZeapeHvw0+sPfZSUzRbXghC6gfDWZnvmJEyQ8y2wTqc/ZXRid IcQUvjDU7qPV6W4tKMWtFwKRmBPtkYhx34u64u6y0rKT2yRloQhQqVlgKSxHiE2mypMO +rfa4DdEsHjxG61rZ8jWI+7Yl6E0NFGZeM+h/FzDPmIuI7WMMgdh/bma9Y3FZUf7rC7f jjpA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel-dk.20150623.gappssmtp.com header.s=20150623 header.b=QrISUnxC; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v71si15452066pgd.468.2019.07.14.19.34.26; Sun, 14 Jul 2019 19:34:42 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel-dk.20150623.gappssmtp.com header.s=20150623 header.b=QrISUnxC; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729012AbfGOCeE (ORCPT + 99 others); Sun, 14 Jul 2019 22:34:04 -0400 Received: from mail-pf1-f195.google.com ([209.85.210.195]:36756 "EHLO mail-pf1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728914AbfGOCeE (ORCPT ); Sun, 14 Jul 2019 22:34:04 -0400 Received: by mail-pf1-f195.google.com with SMTP id r7so6697799pfl.3 for ; Sun, 14 Jul 2019 19:34:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel-dk.20150623.gappssmtp.com; s=20150623; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=j1D3jAEemUPemgo3Jj5nb6GS6101sWhcpLMgfsoNq8g=; b=QrISUnxCSscxlNiF2KqrOgYSELv84+I/OVPUsZDhEuEi4r7R8YUKcUPEfdayuPSfK0 wrQ3Q089jqbmouyR+NoH07yfRGBgepPs66CHFe5siqBvErBCrBMbICucDPWVzgWos38b Wf2Rms1UOmhDfsHeziRBcVVeqhPowRnyQF6ZIirk9sqy61+7brb3XjH5WSXDOqEwMkq3 q0U1QstYRjrFeTUkIvslQ7dopjLzTMUk5/MTR7wo3HmTm88DIkL2jdeSCkahHTIsS0XU 2mC5wBJ5eaM50hskzzZTjH7Ed3Xloa++ONtGgIN+sj2f13lAUYZHfj/Zj0wydtFoffX+ bJXQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=j1D3jAEemUPemgo3Jj5nb6GS6101sWhcpLMgfsoNq8g=; b=oQtQyqKSSWxrweyPYW/8RSWmp+yGefdhVo8LS4csrztcc2g6/E8c6lVueozy9dCOL5 dMcFjQ5OR7tEfgWwLRzBfeM64Py0bjY85VUBbDL0bW3pO9nu5xEIcSZB4nWvUR/g/FLx cAfwnMxtJ/w3alGttU+WKSsopmxzproXW6Fe/36RbQ3xCgPadoJWsotFa9Qq9IZcRpnW 45Xhsh0PzJVOM1MHtNloDOGM6MuIsxTpSxNA+5hWmK0gCidvNM/2YwqoOfa0sbKMLHb9 /Dr20TRg4ajqTFiiAqAZ7QMKiATQBguCmH90nshdAFph8np6xqEoKiodZfjbPRjuMmtZ Seeg== X-Gm-Message-State: APjAAAXr7sOCUrp+OnSx42vQIx+WKI839GyKjTAoyZyaoXpX83AY2hiz d+ZaCHh+6hzNHUTaTmXm8r4= X-Received: by 2002:a63:7a01:: with SMTP id v1mr25024594pgc.310.1563158042768; Sun, 14 Jul 2019 19:34:02 -0700 (PDT) Received: from [192.168.1.121] (66.29.164.166.static.utbb.net. [66.29.164.166]) by smtp.gmail.com with ESMTPSA id d129sm16418490pfc.168.2019.07.14.19.33.58 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 14 Jul 2019 19:34:01 -0700 (PDT) Subject: Re: [PATCH] mm/gup: Use put_user_page*() instead of put_page*() To: Bharath Vedartham , akpm@linux-foundation.org, ira.weiny@intel.com, jhubbard@nvidia.com Cc: Mauro Carvalho Chehab , Dimitri Sivanich , Arnd Bergmann , Greg Kroah-Hartman , Alex Williamson , Cornelia Huck , Alexander Viro , =?UTF-8?B?QmrDtnJuIFTDtnBlbA==?= , Magnus Karlsson , "David S. Miller" , Alexei Starovoitov , Daniel Borkmann , Jakub Kicinski , Jesper Dangaard Brouer , John Fastabend , Enrico Weigelt , Thomas Gleixner , Alexios Zavras , Dan Carpenter , Max Filippov , Matt Sickler , "Kirill A. Shutemov" , Keith Busch , YueHaibing , 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 References: <1563131456-11488-1-git-send-email-linux.bhar@gmail.com> From: Jens Axboe Message-ID: <018ee3d1-e2f0-ca12-9f63-945056c09985@kernel.dk> Date: Sun, 14 Jul 2019 20:33:57 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.7.2 MIME-Version: 1.0 In-Reply-To: <1563131456-11488-1-git-send-email-linux.bhar@gmail.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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