From patchwork Thu May 26 03:24:45 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Abhi Das X-Patchwork-Id: 9136539 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id D5CD86075C for ; Thu, 26 May 2016 03:25:30 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CBCA626E82 for ; Thu, 26 May 2016 03:25:30 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C0221282B3; Thu, 26 May 2016 03:25:30 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 519D526E82 for ; Thu, 26 May 2016 03:25:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752821AbcEZDYz (ORCPT ); Wed, 25 May 2016 23:24:55 -0400 Received: from mx1.redhat.com ([209.132.183.28]:38474 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752711AbcEZDYy (ORCPT ); Wed, 25 May 2016 23:24:54 -0400 Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 1019872670; Thu, 26 May 2016 03:24:54 +0000 (UTC) Received: from radium.msp.redhat.com (radium.msp.redhat.com [10.15.80.88]) by int-mx14.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u4Q3OqBs002472 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Wed, 25 May 2016 23:24:53 -0400 From: Abhi Das To: cluster-devel@redhat.com, linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org Cc: Abhi Das , Miklos Szeredi , Jens Axboe , Al Viro Subject: [PATCH] fs: Do not check for valid page->mapping in page_cache_pipe_buf_confirm Date: Wed, 25 May 2016 22:24:45 -0500 Message-Id: <1464233085-19165-1-git-send-email-adas@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.27 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Thu, 26 May 2016 03:24:54 +0000 (UTC) Sender: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP If the page is truncated after being spliced into the pipe, it's probably not invalid. For filesystems that invalidate pages, we used to return -ENODATA even though the data is there, it's just possibly different from what was spliced into the pipe. We shouldn't have to throw away the buffer or return error in this case. Signed-off-by: Abhi Das CC: Miklos Szeredi CC: Jens Axboe CC: Al Viro --- fs/splice.c | 9 --------- 1 file changed, 9 deletions(-) diff --git a/fs/splice.c b/fs/splice.c index dd9bf7e..b9899b99 100644 --- a/fs/splice.c +++ b/fs/splice.c @@ -106,15 +106,6 @@ static int page_cache_pipe_buf_confirm(struct pipe_inode_info *pipe, lock_page(page); /* - * Page got truncated/unhashed. This will cause a 0-byte - * splice, if this is the first page. - */ - if (!page->mapping) { - err = -ENODATA; - goto error; - } - - /* * Uh oh, read-error from disk. */ if (!PageUptodate(page)) {