Thread (27 messages) flat view 27 messages, 7 authors, 2019-08-07

Re: [PATCH 07/12] vhost-scsi: convert put_page() to put_user_page*()

From: John Hubbard <jhubbard@nvidia.com>
Date: 2019-07-24 04:35:06
Also in: ceph-devel, kvm, linux-block, linux-cifs, linux-fsdevel, linux-mm, linux-nfs, linux-rdma, lkml

On 7/23/19 9:25 PM, john.hubbard@gmail.com wrote:
From: Jérôme Glisse <redacted>

For pages that were retained via get_user_pages*(), release those pages
via the new put_user_page*() routines, instead of via put_page().

This is part a tree-wide conversion, as described in commit fc1d8e7cca2d
("mm: introduce put_user_page*(), placeholder versions").

Changes from Jérôme's original patch:

* Changed a WARN_ON to a BUG_ON.
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,
-- 
John Hubbard
NVIDIA
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help