Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp886233rwb; Thu, 22 Sep 2022 07:34:50 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4JQYWEvaj/5qaA9OZN5VDwBLoBTqDFpAxEX4dFXZT1dAI1nDfQWgtoOcoymyAMnhuJMNBQ X-Received: by 2002:a17:907:7fa3:b0:782:3034:cbc5 with SMTP id qk35-20020a1709077fa300b007823034cbc5mr3060363ejc.96.1663857289816; Thu, 22 Sep 2022 07:34:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1663857289; cv=none; d=google.com; s=arc-20160816; b=0EMo73u6VvPzFrvA1WA3w/sh8ggWZGS8VuhvjJv8ys713mnspQJLF2UD7KAfsXX54v 1H293Xp5b2ix9XJKF5Cgqwy/x9a7tm4dUK4TvJplaakxV6nNgPrJIxO63a/94JB3CjZv b7EkRRn5PFUrktrAI0bGpMsM6SskRTzQjNmab+7nA1UmZ/l0IApBHl+m4kbwhlrn7oz8 +gNb2qesFw0ZfSW6xQ/trRFLBJBuvzj0Ok9eyOtto298DWIs1WuJ8Q9mbuR+UTaxaixJ IhyGXoHgoDYaTAoCXGkMwW9pCJAfdsc9DGhTRrY/Kz554AYSvw2+2pqUN2oiATJgFLgz 6bZg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=/mtTNf4PXC+ykYPVOfxIiGXI0dE7me4fgbHt4EcB8iA=; b=Jy1xhQys7Ukmxwr4dXqHYoo1rPdQxSyY10HW1lQSL2sMbsthz0xMEZVi6rJN3oTGaT VbkXnDC5nA3ppDPXLoycrssOGS/RICAW9Mt6vRD7OvOVVi/nh5hPQjHQPsNZ/cm0+QPa ICAWQJHBE/B9YedISkqyYDvj6RY7UTg2P37MZUC4NiZuciwDOi2d9PFBMZIkh0dEe+V2 6804/10SCZoKXu0ND36mY/X9XHPMkq83PbhHbyD/ojxDEU35qexPOw4daFXRdrO9F3Uy hFc08iF0TP4mPAlrdSYHCJSfyj948wIg3MsOqg6qbDQEOAp0vmhtpikuPP5VgHq1XrrV PRhg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b=n2t0Tta3; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ky16-20020a170907779000b007806964b2fcsi4509046ejc.447.2022.09.22.07.34.18; Thu, 22 Sep 2022 07:34:49 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b=n2t0Tta3; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231817AbiIVOcX (ORCPT + 99 others); Thu, 22 Sep 2022 10:32:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53240 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231377AbiIVOcB (ORCPT ); Thu, 22 Sep 2022 10:32:01 -0400 Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 66770F684F; Thu, 22 Sep 2022 07:31:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=/mtTNf4PXC+ykYPVOfxIiGXI0dE7me4fgbHt4EcB8iA=; b=n2t0Tta3S2zKp9yZTFKbZ9rphf NyKlU4nGzFCh/vtSf0VjfGGOZyYnQmAY6C2VSWMuh1lYMGzKJfdlihT87q7rgO+yN8QSP3acrnf0O pzK3CUy1uAzfs5PUdi36ROvFDkKPOS+9GBFBRhkfqa0BIh/fIDCxCX4SQpc61HTRFrHYmF+e5T4wE hzpecbbxEXy5fYxSKCWMbo0z4+lT106+/wRSystE+ajPaTGAL6qsCSOqyIv4AWcyAhZbLzDR/0uZu IDrNucF+k2FAFp84QyXEI2UfPseFKFQNUKimNMSO5wtOMgwXFNWpTYDz5VnHE74/7HxxkYr+vQUNO sxjfGb6g==; Received: from hch by bombadil.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1obNEm-00G32R-Cq; Thu, 22 Sep 2022 14:31:36 +0000 Date: Thu, 22 Sep 2022 07:31:36 -0700 From: Christoph Hellwig To: Al Viro Cc: Christoph Hellwig , Jan Kara , John Hubbard , Andrew Morton , Jens Axboe , Miklos Szeredi , "Darrick J . Wong" , Trond Myklebust , Anna Schumaker , David Hildenbrand , Logan Gunthorpe , linux-block@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-xfs@vger.kernel.org, linux-nfs@vger.kernel.org, linux-mm@kvack.org, LKML Subject: Re: [PATCH v2 4/7] iov_iter: new iov_iter_pin_pages*() routines Message-ID: References: <20220831041843.973026-1-jhubbard@nvidia.com> <20220831041843.973026-5-jhubbard@nvidia.com> <103fe662-3dc8-35cb-1a68-dda8af95c518@nvidia.com> <20220906102106.q23ovgyjyrsnbhkp@quack3> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org On Wed, Sep 14, 2022 at 04:51:17AM +0100, Al Viro wrote: > Unless I'm misreading Jan, the question is whether they should get or > pin. And I think the answer is: inside ->read_iter or ->write_iter they should neither get or pin. The callers of it need to pin the pages if they are pagecache pages that can potentially be written to through shared mappings, else a get would be enough. But the method instance should not have to care and just be able to rely on the caller making sure they do not go away. > I'm really tempted to slap > if (WARN_ON(i->data_source)) > return 0; > into copy_to_iter() et.al., along with its opposite for copy_from_iter(). Ys, I think that would be useful. And we could use something more descriptive than READ/WRITE to start with.