From patchwork Tue Oct 16 03:21:02 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Darrick J. Wong" X-Patchwork-Id: 10643041 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 323AA18BC for ; Tue, 16 Oct 2018 03:21:10 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1E4E528E72 for ; Tue, 16 Oct 2018 03:21:10 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 11A8B29AA8; Tue, 16 Oct 2018 03:21:10 +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=-3.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9DFD128E72 for ; Tue, 16 Oct 2018 03:21:09 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 37B476B0292; Mon, 15 Oct 2018 23:21:08 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 32AA96B0294; Mon, 15 Oct 2018 23:21:08 -0400 (EDT) X-Original-To: int-list-linux-mm@kvack.org X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 241816B0295; Mon, 15 Oct 2018 23:21:08 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-pl1-f199.google.com (mail-pl1-f199.google.com [209.85.214.199]) by kanga.kvack.org (Postfix) with ESMTP id D76616B0292 for ; Mon, 15 Oct 2018 23:21:07 -0400 (EDT) Received: by mail-pl1-f199.google.com with SMTP id 43-v6so17279211ple.19 for ; Mon, 15 Oct 2018 20:21:07 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:dkim-signature:subject:from:to:cc:date :message-id:in-reply-to:references:user-agent:mime-version :content-transfer-encoding; bh=qvAdS5qtNPwhhtvBsCuVRJiAsJYI4Kg7IlMUAqU/umo=; b=c5A7f4TigvzlNPw3LY+NTO0m1P8Vpyc/hfWOjo/ZLLb9ZrXBfEkQI5BA7rgq8ho5ht MUYkFxpmrkPx+Ax5ZYxF4GL+PE6b/0vF+Sr6tBTo/OaSlMZzUWRIwANkczAAw1QPIDxd 7/tMnNsFEAGs4WwyMIqaAElytHvnlhODX7M5MLEEn8lLmgUfWp9nv105E83f3ZYrAtc/ RFQiBi/Jzum+z6d3O+lHSmymUMek1IC7T2ghPN/NupD/UjtYUBKFlZuTE1aDXzKYlg5i 5v0DvQ6eh1zhDeGw7Eyk6w2bnLEwI+xaBXi6RGKz58MTDqeWoD9QEH3axcGoLlFgDeJg 8V4g== X-Gm-Message-State: ABuFfogmVLrlC2hHc2cgZQe23ntM/G7gAm4nZ2aPbD5rB/6/89vnxOg2 KulBqSIfB2ziumRSjY2J+Ztmt8H4AxJ5QYYVMfzp36UkLKrH7ZiLxLrSsL3TkrJFjbVK+Jq/BX4 C+xNRhoVN6GUN9wgxDKvo8+YxQxZuGeq0yXj+8dKZTXUSn+nboMZz8X31LvwdDxbYUA== X-Received: by 2002:a62:5b43:: with SMTP id p64-v6mr20715955pfb.122.1539660067562; Mon, 15 Oct 2018 20:21:07 -0700 (PDT) X-Google-Smtp-Source: ACcGV61Tc5OPGAKR2UM5YE1oalC9HH4L9LETwXJ9qe4qo880OXh1vuJ568Vyt2n964urq4JFniDS X-Received: by 2002:a62:5b43:: with SMTP id p64-v6mr20715914pfb.122.1539660066875; Mon, 15 Oct 2018 20:21:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539660066; cv=none; d=google.com; s=arc-20160816; b=Y0tTyHoXMaqqhloyhQCxcbd4Zkg90wpcSxjUwVpWQreHvWS9YdFSWBYxfs0ZWwHBbr wki38nhsTItGuQAauePC5RInSM+l6DpIRQrGe2bwY1LsVXVH+AAev0Y681Dbhpq8UZLl 7bAM9XrK2BKsG3Q15eDF5WmftYO7PIIlkLnsYoVf9yLVrt5FBbSMXr1wGgr/wGCRan0y zJgxtDNTjc7WCC6Xj5xjidIkRyrqR+As4pnmP748LcEI0NLqKqvKy+pJYngHIxCfujIN sqaUaVbvN3mf+O0cTooXPT/pGyveIACA0CYzNNwHNwH4rc38Qa944x3QN/bQDrA/ECgh VOVQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:user-agent:references :in-reply-to:message-id:date:cc:to:from:subject:dkim-signature; bh=qvAdS5qtNPwhhtvBsCuVRJiAsJYI4Kg7IlMUAqU/umo=; b=fLnal18BqMzZ4U9Mixd9GqceVQfMdneWKtGOSI5F8nFV1O7JXkm4DRUnR7ktiJFR4N GlU9UvPwLhuusoktMoY1rrIEbWubBrDs1ASIVHnS46QPbOYysfoKSKeNw3/aYK1zy3DF tEz2dEutlUrguQ1Hq1gUwnX4cZpQsTGKel9Vb+XI69ASkFZdaGwm+lpsjAu91cQzuon/ vJZXo+wC3lPw/de/RvSE3iqv+A+yNAe+T6yHIuY//lmmYE74rLhxOYTW+V2K+PkLrZQ8 RZVFsa7Fx2MzwavoWHYIhpYgM2bkmmK962ZoQ9rS7L9sNkYneqGDyfWPlU3CYJkZk11S d1sQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2018-07-02 header.b="UxxSYl/D"; spf=pass (google.com: domain of darrick.wong@oracle.com designates 156.151.31.86 as permitted sender) smtp.mailfrom=darrick.wong@oracle.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Received: from userp2130.oracle.com (userp2130.oracle.com. [156.151.31.86]) by mx.google.com with ESMTPS id b10-v6si13298662pla.253.2018.10.15.20.21.06 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 15 Oct 2018 20:21:06 -0700 (PDT) Received-SPF: pass (google.com: domain of darrick.wong@oracle.com designates 156.151.31.86 as permitted sender) client-ip=156.151.31.86; Authentication-Results: mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2018-07-02 header.b="UxxSYl/D"; spf=pass (google.com: domain of darrick.wong@oracle.com designates 156.151.31.86 as permitted sender) smtp.mailfrom=darrick.wong@oracle.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Received: from pps.filterd (userp2130.oracle.com [127.0.0.1]) by userp2130.oracle.com (8.16.0.22/8.16.0.22) with SMTP id w9G3J5OE051357; Tue, 16 Oct 2018 03:21:06 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=subject : from : to : cc : date : message-id : in-reply-to : references : mime-version : content-type : content-transfer-encoding; s=corp-2018-07-02; bh=qvAdS5qtNPwhhtvBsCuVRJiAsJYI4Kg7IlMUAqU/umo=; b=UxxSYl/DXrxO/IZg8pk5FZRVB9feaAIbDplQfXDrHRWpbXSAh655KSzHfj9HJTq2FRun 5qWpfgKFkoHUVYXWz28OK9xEaPq3F3TsVSy71nU/I2Pq6Nk+kE3QdsDx/6GamStLikvt RLRqV78hcWqEVgCwxlu/u6rkFjibAfqEoeKUA0OFXP0SG5B4EQ+pmtGQnpQPHILGfor6 scK0Oab9mLmCte2BvdlJ/15BEr6ylQ8dUU1JXef0ajmgJ+f89iwIOJ3URUgAv1+6/92X i8zXaPbKSpSMDvsQvpDNOB55jRz3gSBXZk82gUO/HUdUC7VAqWblExDwxgc0BTb+GRJA cg== Received: from userv0021.oracle.com (userv0021.oracle.com [156.151.31.71]) by userp2130.oracle.com with ESMTP id 2n384tx2bg-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 16 Oct 2018 03:21:06 +0000 Received: from aserv0122.oracle.com (aserv0122.oracle.com [141.146.126.236]) by userv0021.oracle.com (8.14.4/8.14.4) with ESMTP id w9G3L4vD006101 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 16 Oct 2018 03:21:04 GMT Received: from abhmp0015.oracle.com (abhmp0015.oracle.com [141.146.116.21]) by aserv0122.oracle.com (8.14.4/8.14.4) with ESMTP id w9G3L3G5011041; Tue, 16 Oct 2018 03:21:03 GMT Received: from localhost (/10.159.227.150) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Mon, 15 Oct 2018 20:21:03 -0700 Subject: [PATCH 26/26] xfs: remove redundant remap partial EOF block checks From: "Darrick J. Wong" To: david@fromorbit.com, darrick.wong@oracle.com Cc: sandeen@redhat.com, linux-nfs@vger.kernel.org, linux-cifs@vger.kernel.org, linux-unionfs@vger.kernel.org, linux-xfs@vger.kernel.org, linux-mm@kvack.org, linux-btrfs@vger.kernel.org, Dave Chinner , linux-fsdevel@vger.kernel.org, ocfs2-devel@oss.oracle.com Date: Mon, 15 Oct 2018 20:21:02 -0700 Message-ID: <153966006214.3607.15131077363912605792.stgit@magnolia> In-Reply-To: <153965939489.1256.7400115244528045860.stgit@magnolia> References: <153965939489.1256.7400115244528045860.stgit@magnolia> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=9047 signatures=668706 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1807170000 definitions=main-1810160028 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: X-Virus-Scanned: ClamAV using ClamSMTP From: Darrick J. Wong Now that we've moved the partial EOF block checks to the VFS helpers, we can remove the redundant functionality from XFS. Signed-off-by: Darrick J. Wong Reviewed-by: Dave Chinner Reviewed-by: Christoph Hellwig --- fs/xfs/xfs_reflink.c | 19 ------------------- 1 file changed, 19 deletions(-) diff --git a/fs/xfs/xfs_reflink.c b/fs/xfs/xfs_reflink.c index af3368862c56..755d4a9446e3 100644 --- a/fs/xfs/xfs_reflink.c +++ b/fs/xfs/xfs_reflink.c @@ -1307,7 +1307,6 @@ xfs_reflink_remap_prep( struct inode *inode_out = file_inode(file_out); struct xfs_inode *dest = XFS_I(inode_out); bool same_inode = (inode_in == inode_out); - u64 blkmask = i_blocksize(inode_in) - 1; ssize_t ret; /* Lock both files against IO */ @@ -1335,24 +1334,6 @@ xfs_reflink_remap_prep( if (ret < 0 || *len == 0) goto out_unlock; - /* - * If the dedupe data matches, chop off the partial EOF block - * from the source file so we don't try to dedupe the partial - * EOF block. - */ - if (remap_flags & REMAP_FILE_DEDUP) { - *len &= ~blkmask; - } else if (*len & blkmask) { - /* - * The user is attempting to share a partial EOF block, - * if it's inside the destination EOF then reject it. - */ - if (pos_out + *len < i_size_read(inode_out)) { - ret = -EINVAL; - goto out_unlock; - } - } - /* Attach dquots to dest inode before changing block map */ ret = xfs_qm_dqattach(dest); if (ret)