From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.0 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 44296C10F0E for ; Mon, 15 Apr 2019 07:47:19 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 1A76620825 for ; Mon, 15 Apr 2019 07:47:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726392AbfDOHrN (ORCPT ); Mon, 15 Apr 2019 03:47:13 -0400 Received: from mx1.redhat.com ([209.132.183.28]:40068 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725779AbfDOHrN (ORCPT ); Mon, 15 Apr 2019 03:47:13 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id CB9F6821C3; Mon, 15 Apr 2019 07:47:12 +0000 (UTC) Received: from [10.72.12.206] (ovpn-12-206.pek2.redhat.com [10.72.12.206]) by smtp.corp.redhat.com (Postfix) with ESMTP id 19B3E5D9CA; Mon, 15 Apr 2019 07:47:00 +0000 (UTC) Subject: Re: [PATCH v1 15/15] ceph: use put_user_pages() instead of ceph_put_page_vector() To: jglisse@redhat.com, linux-kernel@vger.kernel.org Cc: linux-fsdevel@vger.kernel.org, linux-block@vger.kernel.org, linux-mm@kvack.org, John Hubbard , Jan Kara , Dan Williams , Alexander Viro , Johannes Thumshirn , Christoph Hellwig , Jens Axboe , Ming Lei , Dave Chinner , Jason Gunthorpe , Matthew Wilcox , Sage Weil , Ilya Dryomov , ceph-devel@vger.kernel.org References: <20190411210834.4105-1-jglisse@redhat.com> <20190411210834.4105-16-jglisse@redhat.com> From: "Yan, Zheng" Message-ID: Date: Mon, 15 Apr 2019 15:46:59 +0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 MIME-Version: 1.0 In-Reply-To: <20190411210834.4105-16-jglisse@redhat.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Mon, 15 Apr 2019 07:47:13 +0000 (UTC) Sender: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org On 4/12/19 5:08 AM, jglisse@redhat.com wrote: > From: Jérôme Glisse > > When page reference were taken through GUP (get_user_page*()) we need > to drop them with put_user_pages(). > > Signed-off-by: Jérôme Glisse > Cc: linux-fsdevel@vger.kernel.org > Cc: linux-block@vger.kernel.org > Cc: linux-mm@kvack.org > Cc: John Hubbard > Cc: Jan Kara > Cc: Dan Williams > Cc: Alexander Viro > Cc: Johannes Thumshirn > Cc: Christoph Hellwig > Cc: Jens Axboe > Cc: Ming Lei > Cc: Dave Chinner > Cc: Jason Gunthorpe > Cc: Matthew Wilcox > Cc: Yan Zheng > Cc: Sage Weil > Cc: Ilya Dryomov > Cc: ceph-devel@vger.kernel.org > --- > fs/ceph/file.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/fs/ceph/file.c b/fs/ceph/file.c > index 6c5b85f01721..5842ad3a4218 100644 > --- a/fs/ceph/file.c > +++ b/fs/ceph/file.c > @@ -667,7 +667,8 @@ static ssize_t ceph_sync_read(struct kiocb *iocb, struct iov_iter *to, > } else { > iov_iter_advance(to, 0); > } > - ceph_put_page_vector(pages, num_pages, false); > + /* iov_iter_get_pages_alloc() did call GUP */ > + put_user_pages(pages, num_pages); pages in pipe were not from get_user_pages(). Am I missing anything? Regards Yan, Zheng > } else { > int idx = 0; > size_t left = ret > 0 ? ret : 0; >