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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7F5C5C678D6 for ; Thu, 19 Jan 2023 02:32:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229689AbjASCcF (ORCPT ); Wed, 18 Jan 2023 21:32:05 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46550 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229446AbjASCcD (ORCPT ); Wed, 18 Jan 2023 21:32:03 -0500 Received: from zeniv.linux.org.uk (zeniv.linux.org.uk [IPv6:2a03:a000:7:0:5054:ff:fe1c:15ff]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CC3FAA24E; Wed, 18 Jan 2023 18:32:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=linux.org.uk; s=zeniv-20220401; h=Sender:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=ALLkriTWE+SzQ0sqzMUjGDLtM+PH1VXpy/CU3zVeJ/E=; b=ENObJlCpA6C70A+samIfTPkGeo 5zl+m9fp7s4ZnPB0kuPmwyEkDZujgpYlmLu0t4X5ZAzAwUPxgOXOqRVRgMy8ATxPO72aTVyZ18Mg9 4JW3pJPVJFDK8G2VxY37mD3WdE+qOz6wLrsMbh6AG+4gTYdZua0jHS/MFtCOwzXv3TXjsKnsnUGqO fq4aYMHb+HygThlbM6fSCQMmpt2glx+yY/+m2fOKCbET69IKJihm+fhkdChtyFwxPFOB6l3O3E/6F HfLhAqZoEUnk3Y3AK5ufM9wTGFHm70MzOLZIFGgDvw9A8hhfBiMixFbq0mVTPpjqB9VcYUYksS3Dn ch6T6PcQ==; Received: from viro by zeniv.linux.org.uk with local (Exim 4.96 #2 (Red Hat Linux)) id 1pIKib-002euc-2o; Thu, 19 Jan 2023 02:31:57 +0000 Date: Thu, 19 Jan 2023 02:31:57 +0000 From: Al Viro To: David Howells Cc: Christoph Hellwig , Matthew Wilcox , linux-fsdevel@vger.kernel.org, Christoph Hellwig , Jens Axboe , Jan Kara , Jeff Layton , Logan Gunthorpe , linux-block@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v6 20/34] vfs: Make splice use iov_iter_extract_pages() Message-ID: References: <167391047703.2311931.8115712773222260073.stgit@warthog.procyon.org.uk> <167391062544.2311931.15195962488932892568.stgit@warthog.procyon.org.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <167391062544.2311931.15195962488932892568.stgit@warthog.procyon.org.uk> Sender: Al Viro Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jan 16, 2023 at 11:10:25PM +0000, David Howells wrote: > diff --git a/fs/splice.c b/fs/splice.c > index 19c5b5adc548..c3433266ba1b 100644 > --- a/fs/splice.c > +++ b/fs/splice.c > @@ -1159,14 +1159,18 @@ static int iter_to_pipe(struct iov_iter *from, > size_t total = 0; > int ret = 0; > > + /* For the moment, all pages attached to a pipe must have refs, not pins. */ > + if (WARN_ON(iov_iter_extract_mode(from, FOLL_SOURCE_BUF) != FOLL_GET)) > + return -EIO; Huh? WTF does that have to do with pins? Why would we be pinning the _source_ pages anyway? We do want them referenced, for obvious reasons (they might be stuck in the pipe), but that has nothing to do with get vs. pin. If anything, this is one place where we want the semantics of iov_iter_get_pages...