From patchwork Wed Sep 14 08:37:15 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miklos Szeredi X-Patchwork-Id: 9330885 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 875C96077F for ; Wed, 14 Sep 2016 08:38:17 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 78CD729B61 for ; Wed, 14 Sep 2016 08:38:17 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6DA0829B65; Wed, 14 Sep 2016 08:38:17 +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.4 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM 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 0BFFF29B61 for ; Wed, 14 Sep 2016 08:38:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1761469AbcINIiP (ORCPT ); Wed, 14 Sep 2016 04:38:15 -0400 Received: from mail-wm0-f45.google.com ([74.125.82.45]:36305 "EHLO mail-wm0-f45.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1761275AbcINIhh (ORCPT ); Wed, 14 Sep 2016 04:37:37 -0400 Received: by mail-wm0-f45.google.com with SMTP id b187so34767219wme.1 for ; Wed, 14 Sep 2016 01:37:36 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=S8MO1A9lvhrYZ4wWS6Tr9MLfqmC3cX2vgf3PYNvNZv8=; b=imlFrKJcETr3pHOuguch3dACcMVkI2hWYuBTlvOz19lRm3nAAEgcHhfJsQb7rC6dc9 XdWPNe6zzDQtSt28umS+cM3vgWdoVhfrwS1unobbjwMW1E1HQszVVZCXn/OCH8p7Qe43 /5AGA0OWVxDwxXoqEwhy7Pfy4y+ecciD9b+cqc/yGAaIV9sMvpHTjEuW7boCL97qewlu the1yQ8kXI/AEWCITgHXC3bmAJOH42+dUenfLm3cTADX1sxPZFMNb9ydT6mmdxpnKKbj fSftcnYuYV9HBzAkfX21ngKjJE4MMgILcHEUZj9t1MBvtuZIt/bdTLOeSjDBjshCjPNn ESXQ== X-Gm-Message-State: AE9vXwMqwPxzTFJbNqOiv1kSMfyCIo0c0NzWmDv7SmsAa79gzzHKndpf6+l1mxXp3eoAP1VW X-Received: by 10.28.38.131 with SMTP id m125mr1884777wmm.38.1473842253162; Wed, 14 Sep 2016 01:37:33 -0700 (PDT) Received: from veci.piliscsaba.szeredi.hu (pool-dsl-2c-0018.externet.hu. [217.173.44.24]) by smtp.gmail.com with ESMTPSA id g184sm9533889wme.15.2016.09.14.01.37.32 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 14 Sep 2016 01:37:32 -0700 (PDT) From: Miklos Szeredi To: linux-fsdevel@vger.kernel.org Cc: linux-kernel@vger.kernel.org, Al Viro Subject: [PATCH 10/11] splice: don't check i_size in generic_file_splice_read() Date: Wed, 14 Sep 2016 10:37:15 +0200 Message-Id: <1473842236-28655-11-git-send-email-mszeredi@redhat.com> X-Mailer: git-send-email 2.5.5 In-Reply-To: <1473842236-28655-1-git-send-email-mszeredi@redhat.com> References: <1473842236-28655-1-git-send-email-mszeredi@redhat.com> 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 This is handled in get_page_for_read() already. Signed-off-by: Miklos Szeredi --- fs/splice.c | 9 --------- 1 file changed, 9 deletions(-) diff --git a/fs/splice.c b/fs/splice.c index e7757b363b6c..bee282803ccf 100644 --- a/fs/splice.c +++ b/fs/splice.c @@ -334,20 +334,11 @@ ssize_t generic_file_splice_read(struct file *in, loff_t *ppos, struct pipe_inode_info *pipe, size_t len, unsigned int flags) { - loff_t isize, left; int ret; if (IS_DAX(in->f_mapping->host)) return default_file_splice_read(in, ppos, pipe, len, flags); - isize = i_size_read(in->f_mapping->host); - if (unlikely(*ppos >= isize)) - return 0; - - left = isize - *ppos; - if (unlikely(left < len)) - len = left; - ret = __generic_file_splice_read(in, ppos, pipe, len, flags); if (ret > 0) { *ppos += ret;