From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from zeniv.linux.org.uk ([195.92.253.2]:60854 "EHLO ZenIV.linux.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751631AbcLJDD4 (ORCPT ); Fri, 9 Dec 2016 22:03:56 -0500 Date: Sat, 10 Dec 2016 03:03:54 +0000 From: Al Viro To: Jens Axboe Cc: linux-fsdevel@vger.kernel.org, Nicholas Piggin , Miklos Szeredi Subject: Re: [RFC] vmsplice() and ->steal() Message-ID: <20161210030354.GI1555@ZenIV.linux.org.uk> References: <20161210023849.GH1555@ZenIV.linux.org.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20161210023849.GH1555@ZenIV.linux.org.uk> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: On Sat, Dec 10, 2016 at 02:38:49AM +0000, Al Viro wrote: > vmsplice() generates pipe_bufs with ->steal() set to > user_page_pipe_buf_steal(). What should happen when the source pages > had code from an mmapped area and why shouldn't their ->steal() > do what page_cache_pipe_buf_release() does in that case? > > As it is, e.g. fuse_dev_splice_write() getting fed that stuff could, > AFAICS, clear MappedToDisk on such a page, scream about weird pages > (upon noticing non-NULL ->mapping) and fall back to copying (thankfully). > We don't have that many ->steal() users (as the matter of fact, I've > discovered that while trying to debug the breakage in one I'd been > trying to add), but I really wonder about the intended semantics of > ->steal(). Hmm... Nope, the source of breakage is different, and these guys will simply fail ->steal() - pages present in page cache will have refcount >= 2 due to the buf->page contributing to it. My apologies... BTW, why doesn't page_cache_pipe_buf_steal() clear MappedToDisk on its own in case of success?