From patchwork Sat Oct 13 00:08:39 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: 10639735 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 74E181508 for ; Sat, 13 Oct 2018 00:08:46 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 635712B7F4 for ; Sat, 13 Oct 2018 00:08:46 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 578062B8A4; Sat, 13 Oct 2018 00:08:46 +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 E88C42B7F4 for ; Sat, 13 Oct 2018 00:08:45 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id F322A6B0292; Fri, 12 Oct 2018 20:08:43 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id F06746B0294; Fri, 12 Oct 2018 20:08:43 -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 D7F5E6B0295; Fri, 12 Oct 2018 20:08:43 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-pg1-f199.google.com (mail-pg1-f199.google.com [209.85.215.199]) by kanga.kvack.org (Postfix) with ESMTP id 9ACBF6B0292 for ; Fri, 12 Oct 2018 20:08:43 -0400 (EDT) Received: by mail-pg1-f199.google.com with SMTP id i189-v6so10531423pge.6 for ; Fri, 12 Oct 2018 17:08:43 -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=0eMENz0xNhmHfEQz6xYs7euXYnzzeWKWI3aBWCtEoDg=; b=g9F2tdEQLoZzbhAWt28yBLRwHJKUTYRjIDXBVgoksjh+nQ24q2W2xJiVwqCIZz9h6d iMmHcyzzTLYGrSMqDsLTlmI9nc63xW8Zm4sH2j4cFvhM2ZR2yFnchdvPsQEn6rnFZsvO j3706sZAfJiEntDCAEItg6gV7BpiqdW0FG8/Wbq220hU+9dTUU2xfzD1hDDE0TzWw7JO 2aM3S0Ps39Spr00NRADjg6wdyb88EMN36e2jcToXUVMks+s29mWp4JHg2UvkYs2zeffL h1l+x0zKEcguNo9LR7JhDe63Ic1y6KslBNSh+yVfMKCAGzUpVYSHt9bfInZSh6G5Ed2O JK1w== X-Gm-Message-State: ABuFfoj7Lo9xYFMyAt9LITFehvKVqEr/RXgEGukg+RBtbmVAUxEbD+Up dVDmWKbQFkdnMSpID7I0joNvH9qK/bgKfoVfNVTTkwB3alX6wtZlxHWUrFpGgljBuigBch+2x9d INGsQYsLD2XMA1qr+BC4at+04hou82/2oVvzEHfjWTLPS8yqUHvf9SYPFbXV+v1ep4Q== X-Received: by 2002:a63:ec4b:: with SMTP id r11-v6mr7316989pgj.295.1539389323313; Fri, 12 Oct 2018 17:08:43 -0700 (PDT) X-Google-Smtp-Source: ACcGV62vGIgqs+v//KGKkgb5iqyTFQdjey0wknxGQswVM2xza3DtldtNZN341QLBTMlrZMsMcje8 X-Received: by 2002:a63:ec4b:: with SMTP id r11-v6mr7316964pgj.295.1539389322733; Fri, 12 Oct 2018 17:08:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539389322; cv=none; d=google.com; s=arc-20160816; b=hEGDFge2nu1F3IrbVx9RIEeX6xw5wDec/lKHHjFx83edHgN0ABoOCYpUcodIsXpjmZ KLk4BDWDLrwIw0jdUQWBpeY3JuBnN/SceLUSzmGKVmdydLdlawOgKEbhNtGnK/D7DAy5 eq7yg0eVvrChfElNHrp6LtinSRusFvd90q85YUX/Pu4ik68E3DG4KWTaeofOU8y3bYkq k0DREwG6hfvM4BGLnsgSoZDpcXO8vFY8Y9aILjIcXwggVG6c7tJLK74OEvV9+d+MPXB8 fC2/y8oTW8EJ1kqoQGeg3+3MFcRTFiV0avs7hv2Jpc0vmm64JiCWm60EXsO61PjroZZL Zkbw== 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=0eMENz0xNhmHfEQz6xYs7euXYnzzeWKWI3aBWCtEoDg=; b=lo0SuFHsGE8yp2BW1gKbw5giWRHUdIDEGiRVMQI3/PmoKaF4M9kIQCbfsmHkPBXXGk fwB/ADAlHbs3pINaHAogwgLlCLQaEUdIkDUNV8ku7rJI+Ouh7dP4vkeajxqfaYPE+BOR s8y8k9gqvF5xgUfyXzAAh7yI0//5m1jUPzMcbz8DyVeftdhlT61WfC/BO2YgK8iW6ZEM nauaT9VzabiNJ11rp3uE0H84Vkd+5dTjtn2/i2qwSsDm8T2mdaJOg4VLVzoMwAN6C4ab kSGACbA0eMJtC9Z8+YkqBUaKESXvP/oE3inlB+3L0g7Mgja9deO9hIhkcn6MkvISF8B7 tqhg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2018-07-02 header.b=QLAlO+oU; 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 r15-v6si2833051pgh.88.2018.10.12.17.08.42 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 12 Oct 2018 17:08:42 -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=QLAlO+oU; 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 w9D03xw9143588; Sat, 13 Oct 2018 00:08:42 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=0eMENz0xNhmHfEQz6xYs7euXYnzzeWKWI3aBWCtEoDg=; b=QLAlO+oUAaMXeV7DCIZKiwC/Y8nT7kt+X2XFrc2aMWjchKzJMosE+wqRl6CyqyD8POb9 S5i9J6lbYBWP2GjfF7EAhBTJzmljWmK/QVyXKT2Sw25GhOq/yfIEk768cf+1PlxaO+Wt QwDyxx/BNzCcM01YJV0wNLyPpsQGu8S5b8ehSH09yQ1FG9mrnehdQ2td8Y1fz505f0s+ VRI44pPC4mc5C8mLKf7ILkaylwo4j7H0KKdPwQA6c9AMSCQ1++zoONmNlIkrFS6VpmD8 ak5wmxNU8t2G76GfKSNd4vdTz6y3ahgqkzwCDsmhU79v6UFNsvSnHXy8mdSL2F9a6Yp2 cw== Received: from userv0022.oracle.com (userv0022.oracle.com [156.151.31.74]) by userp2130.oracle.com with ESMTP id 2mxmfudq2g-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sat, 13 Oct 2018 00:08:42 +0000 Received: from aserv0122.oracle.com (aserv0122.oracle.com [141.146.126.236]) by userv0022.oracle.com (8.14.4/8.14.4) with ESMTP id w9D08eBa027485 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sat, 13 Oct 2018 00:08:41 GMT Received: from abhmp0004.oracle.com (abhmp0004.oracle.com [141.146.116.10]) by aserv0122.oracle.com (8.14.4/8.14.4) with ESMTP id w9D08eqG020410; Sat, 13 Oct 2018 00:08:40 GMT Received: from localhost (/10.159.251.254) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Sat, 13 Oct 2018 00:08:40 +0000 Subject: [PATCH 25/25] 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: Fri, 12 Oct 2018 17:08:39 -0700 Message-ID: <153938931898.8361.12558032149746338745.stgit@magnolia> In-Reply-To: <153938912912.8361.13446310416406388958.stgit@magnolia> References: <153938912912.8361.13446310416406388958.stgit@magnolia> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=9044 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-1810130000 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 redundantn functionality from XFS. Signed-off-by: Darrick J. Wong Reviewed-by: Dave Chinner --- fs/xfs/xfs_reflink.c | 20 -------------------- 1 file changed, 20 deletions(-) diff --git a/fs/xfs/xfs_reflink.c b/fs/xfs/xfs_reflink.c index 66a8ddb9c058..709735880efb 100644 --- a/fs/xfs/xfs_reflink.c +++ b/fs/xfs/xfs_reflink.c @@ -1307,8 +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); - bool is_dedupe = (remap_flags & RFR_SAME_DATA); - u64 blkmask = i_blocksize(inode_in) - 1; ssize_t ret; /* Lock both files against IO */ @@ -1336,24 +1334,6 @@ xfs_reflink_remap_prep( if (ret <= 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 (is_dedupe) { - *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)