From: John Hubbard Subject: Re: [PATCH 07/12] vhost-scsi: convert put_page() to put_user_page*() Date: Tue, 23 Jul 2019 21:34:56 -0700 Message-ID: References: <20190724042518.14363-1-jhubbard@nvidia.com> <20190724042518.14363-8-jhubbard@nvidia.com> Mime-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Return-path: In-Reply-To: <20190724042518.14363-8-jhubbard@nvidia.com> Content-Language: en-US Sender: linux-kernel-owner@vger.kernel.org To: john.hubbard@gmail.com, Andrew Morton Cc: Alexander Viro , Anna Schumaker , "David S . Miller" , Dominique Martinet , Eric Van Hensbergen , Jason Gunthorpe , Jason Wang , Jens Axboe , Latchesar Ionkov , "Michael S . Tsirkin" , Miklos Szeredi , Trond Myklebust , Christoph Hellwig , Matthew Wilcox , linux-mm@kvack.org, LKML , ceph-devel@vger.kernel.org, kvm@vger.kernel.org, linux-block@vger.kernel.org, linux-cifs@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-nfs@vger.ker List-Id: ceph-devel.vger.kernel.org On 7/23/19 9:25 PM, john.hubbard@gmail.com wrote: > From: J=C3=A9r=C3=B4me Glisse >=20 > For pages that were retained via get_user_pages*(), release those pages > via the new put_user_page*() routines, instead of via put_page(). >=20 > This is part a tree-wide conversion, as described in commit fc1d8e7cca2d > ("mm: introduce put_user_page*(), placeholder versions"). >=20 > Changes from J=C3=A9r=C3=B4me's original patch: >=20 > * Changed a WARN_ON to a BUG_ON. >=20 Clearly, the above commit log has it backwards (this is quite my night for typos). Please read that as "changed a BUG_ON to a WARN_ON". I'll correct the commit description in next iteration of this patchset. ... > + /* > + * Here in all cases we should have an IOVEC which use GUP. If that is > + * not the case then we will wrongly call put_user_page() and the page > + * refcount will go wrong (this is in vhost_scsi_release_cmd()) > + */ > + WARN_ON(!iov_iter_get_pages_use_gup(iter)); > + ... thanks, --=20 John Hubbard NVIDIA