From patchwork Thu Oct 11 04:15:26 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: 10636033 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 57F6416B1 for ; Thu, 11 Oct 2018 04:15:35 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3DC702A61E for ; Thu, 11 Oct 2018 04:15:35 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 321BE2A651; Thu, 11 Oct 2018 04:15:35 +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 BE6512A61E for ; Thu, 11 Oct 2018 04:15:34 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 6BA686B029B; Thu, 11 Oct 2018 00:15:31 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 641606B029C; Thu, 11 Oct 2018 00:15:31 -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 4E2A36B029E; Thu, 11 Oct 2018 00:15:31 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-qt1-f198.google.com (mail-qt1-f198.google.com [209.85.160.198]) by kanga.kvack.org (Postfix) with ESMTP id 1AE346B029C for ; Thu, 11 Oct 2018 00:15:31 -0400 (EDT) Received: by mail-qt1-f198.google.com with SMTP id k21-v6so7361759qtj.23 for ; Wed, 10 Oct 2018 21:15:31 -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=GtHOAv/QF0y7KDuBC7HZvhRe0zfnNWbV0kEOmXhecBY=; b=VLzUsGDJrk0+oBrxJNZDvK2oWgJgZ4xgbcP8HLUc+m63VV3B482ykYeqrSY21o35lV c2WJELv8MnaQJWR1EtQWasvlVVjhM8J+S0rzA/2d7zDpUrb5kX5VnFiq4C8qxVfY74Qd JyapHQJeD2k//Ecuh7StqgJe7FjLA6sFZmudvH4Zeg68r4Q1RHINakoGeUpRxcrNOuW+ kS307u1sW8NGIuUr3EeFrSVspuHeCOfHHLGSBa44j+AGCnwUwz3P2PZqV6D1Ksk5ipPS nW2+FaEprgVoXjtI02c/vdTKIoDMpb4ka+NdnN1CMrU8qpg1cnjd4DhNwczhufJ+M5IB fX3w== X-Gm-Message-State: ABuFfoiCwGzHCco560NzNDYL9WSj0Kb7qMoJuL8F8zgSmYKaP+jqL+5T Ic7QI+RxbKF+z/bw0oOOPuApH2QYTAAplF4kLOOo9hv36Ql04V+gCk4MVi4c5MbjfszrLUwfROD ufQUPLkCPggca9cEKoSXYfLaoBdB/vK8L06UugyGGTwYs7rCYwXSjhhZWnTONh0WL5w== X-Received: by 2002:a0c:b04b:: with SMTP id l11-v6mr29834244qvc.139.1539231330893; Wed, 10 Oct 2018 21:15:30 -0700 (PDT) X-Google-Smtp-Source: ACcGV61sUNMEldl3gfzgD4jiFovFtw7RZGZizwxjws5BxbGnqPmzISwILwvllaAAUDzgWIU2nShp X-Received: by 2002:a0c:b04b:: with SMTP id l11-v6mr29834226qvc.139.1539231330476; Wed, 10 Oct 2018 21:15:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539231330; cv=none; d=google.com; s=arc-20160816; b=wt/OgrOVATJI32RJ649UY+MByL+/WOvbtko1jkP/Q1er5wtEVfJEGzcwdhz7wMCToB X3zhIkIFdZc8DXIOFIMMZFs9c4/Rm8VOPCtUw+1GOjK0qBJjSIw3cU0JeFWCPYsiD95O +k7d3fHtpeE4frBj+Cj3j9g+k26Eln1NQznd9/7FoDt+zbptCvVgmPsK9Zs8PyESpykg r31MfsZnVKWyV60MGhZTNSn0S6QE6wPaiFqJux5YNLzBJ4VkEFhNp5ps+VQvdLYuXywx eCEOgxtQK83rupqhFyGqYxU5fKbbPPRRnqDeZMf1pzOxS7iFHkxCjC4AscE6RzPLqwOb KXiw== 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=GtHOAv/QF0y7KDuBC7HZvhRe0zfnNWbV0kEOmXhecBY=; b=oC3FQAFZfsfCLuGUseLV9qM5KVYnjd2M1+I9pbqcg65Q5gsTmYfLNlYW2C4c5G06Tg dLfoOX/jWTQzlbyC5K4+XRCBn0QHV3w6GvePfbYlVV2gVLgAVJX5ikn61fDO32WQ73kD DhlgYeG5xSIZxAPjqfxGtqQ4V8g/XnLf9YpwphtoOemo3g3JYsSCGrJev8kZ29/Hj35L FHSXxzCXqSlCn/XwkhXsWulcJ6rLd8XcZQp658rmLp+3xyYEJFvPVcDXeBeAOCeKJF/N 8rZYKH+8iVzCIy2xeqhw3v7IBWM8JzchVwbXpeQmLqhfebfmA3jE4ls67SYgF7ea2uRl m8AA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2018-07-02 header.b=jiaPMQek; spf=pass (google.com: domain of darrick.wong@oracle.com designates 156.151.31.85 as permitted sender) smtp.mailfrom=darrick.wong@oracle.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Received: from userp2120.oracle.com (userp2120.oracle.com. [156.151.31.85]) by mx.google.com with ESMTPS id t29-v6si2029355qvc.47.2018.10.10.21.15.30 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 10 Oct 2018 21:15:30 -0700 (PDT) Received-SPF: pass (google.com: domain of darrick.wong@oracle.com designates 156.151.31.85 as permitted sender) client-ip=156.151.31.85; Authentication-Results: mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2018-07-02 header.b=jiaPMQek; spf=pass (google.com: domain of darrick.wong@oracle.com designates 156.151.31.85 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 (userp2120.oracle.com [127.0.0.1]) by userp2120.oracle.com (8.16.0.22/8.16.0.22) with SMTP id w9B4DsHP002714; Thu, 11 Oct 2018 04:15:29 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=GtHOAv/QF0y7KDuBC7HZvhRe0zfnNWbV0kEOmXhecBY=; b=jiaPMQekkirLHjdnXajmGlZYaH6AI90VeT9yzBHvNtkNFPFeOMCGxenmXX8If2+YeXQX QrOaiy1nnibe1CJ9gHV/8yR/ibiw2qh4XqgJtD9k5H2qu+pD8jvp+dpmsAV2B1FRWlZt 5CLbIyDNqL+lhms66iPnQ29ghqBQJtqR9URBwyVgSjGHKeTUCjRDZouV3Za/mNOX2vom 7tzCyt1CqRTl8OrrJaocWA7rGoZGR2Uk4xMgVcJ5Yf64Yfsc5Zw4wmkhVlh7e0KQEQ5J pcNS4WJtPiT863q3yPY5PseJfOvUocfrdP+3CBejMb/wtQm9vY9U6L3WQgnrfFuGzut/ nA== Received: from aserv0022.oracle.com (aserv0022.oracle.com [141.146.126.234]) by userp2120.oracle.com with ESMTP id 2mxnpr996g-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 11 Oct 2018 04:15:29 +0000 Received: from aserv0121.oracle.com (aserv0121.oracle.com [141.146.126.235]) by aserv0022.oracle.com (8.14.4/8.14.4) with ESMTP id w9B4FSHv023078 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 11 Oct 2018 04:15:28 GMT Received: from abhmp0008.oracle.com (abhmp0008.oracle.com [141.146.116.14]) by aserv0121.oracle.com (8.14.4/8.13.8) with ESMTP id w9B4FS0j010121; Thu, 11 Oct 2018 04:15:28 GMT Received: from localhost (/10.159.132.249) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Thu, 11 Oct 2018 04:15:27 +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, linux-fsdevel@vger.kernel.org, ocfs2-devel@oss.oracle.com Date: Wed, 10 Oct 2018 21:15:26 -0700 Message-ID: <153923132645.5546.97372209609060021.stgit@magnolia> In-Reply-To: <153923113649.5546.9840926895953408273.stgit@magnolia> References: <153923113649.5546.9840926895953408273.stgit@magnolia> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=9042 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-1810110040 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 12a1fe92454e..4450443f1148 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)