Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp1048516ybl; Tue, 3 Dec 2019 00:25:16 -0800 (PST) X-Google-Smtp-Source: APXvYqz1vEtt/0PrCkrN4BusK8mKc3DEGLZJQB7NdmhYACLQEAWb8YwJP/ox812Pv4Jk102p/ysJ X-Received: by 2002:aca:f083:: with SMTP id o125mr2568292oih.122.1575361515952; Tue, 03 Dec 2019 00:25:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1575361515; cv=none; d=google.com; s=arc-20160816; b=tIIK0W3tRtr7lDvO4yfLOPcraNandmzLAKxU0td+vakZrLK/2ReTfbvu1b71AT5+P2 0Cx4IVwxrRiegNUYt82TXg+yqZbnsXNHJN87UpJMMQcVQSbsSeOtLFvVfPL1VdamFlSK AsWdviqnlb/6ZcLlAWuIFZ2SLmP0le716QuWKZUvgtev8IS3dnUvS0wm7+ZtqaTsiuK8 QMv+KyB6yuss0po84NCSZpxuydZjrNmE0vlL2nhrVUAuTFOuu6H1WMDmSO+WeRTCEj4j /VwWN05Pw0qprj9QhTvCCb/8pfUf7jusEjc3WVzWrdNKGIbBaMlKf8s2c/b0gWdaOUml uKLQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=31Wazc/ZTiWcb1CXcXJeEg0Mz0oNeqHL2X/90OnuYrM=; b=MgbK7aLdomGPPUli3x3n9556SyG9/JOr42aOG/hfaxVDbUZSlCSalwcXKwAfvFFvDp ViYjKcmx7wIb8hrVSVFdjuPs4q/aX7jonPVwMxzmPi0gkwMCiMiOvxW8sXixYSluyXHR zZ8cxyo8otRHD6Afg/rwWiPXlAAMV8zBdwYVqeRQHZNf+lnl7dbb4BIqJ2O6agjqXIN4 jJj+g35EhJjVc3f96liqAussuHVcQFMhhhdgwElQ3/fx8tubte3BU4NpbYmmku6VfgMG DSK5pyN9/Ryx4XlpPlYls589k+nwOYDdzu+3sUN9sQIfa8Ce/Ji726vNDoieagqQby2j HLLA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@osandov-com.20150623.gappssmtp.com header.s=20150623 header.b=j5o7BMK2; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i205si928582oih.277.2019.12.03.00.25.03; Tue, 03 Dec 2019 00:25:15 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@osandov-com.20150623.gappssmtp.com header.s=20150623 header.b=j5o7BMK2; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726707AbfLCIY3 (ORCPT + 99 others); Tue, 3 Dec 2019 03:24:29 -0500 Received: from mail-pj1-f65.google.com ([209.85.216.65]:36681 "EHLO mail-pj1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726443AbfLCIY3 (ORCPT ); Tue, 3 Dec 2019 03:24:29 -0500 Received: by mail-pj1-f65.google.com with SMTP id n96so1227648pjc.3 for ; Tue, 03 Dec 2019 00:24:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=osandov-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=31Wazc/ZTiWcb1CXcXJeEg0Mz0oNeqHL2X/90OnuYrM=; b=j5o7BMK2ZXxEEORVo5Na68Zpr7mBavPX+ck25DD6gnPsKPABMIXcAbM2H3RTO9fMl+ IaWSWEMvBEoy/0Aj9twf+jOTx5XyR47oDaKHx8hjubl0qldlet/ETiXtE0HUtGFbN3le NvE1fHb32TrJadjzdQN6kX9GxkNfb3TWo6iBbybqbpALisE8ldpCioerd6K3f6zIt3UH L+EKmTGvXBHE42tAyv7tzYIm6lmTdCaEow4pWBSDTn0QRItTXrxGinww8Y/jJOqggi3Y pzdGLRtmeMII/uJpJoV1Jf+b9ZCn/ouml/s1n2bAlOQHnxhFaJ8KVYgSsMnEbWTsPKh0 IDTA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=31Wazc/ZTiWcb1CXcXJeEg0Mz0oNeqHL2X/90OnuYrM=; b=O7zc9XAhn0RDGE9CaYdA3ZqpzaopmDUrfIbUmdLdtpqaowNOSqlRv9/7yvnNiYIgM3 zmAr1JQFkDMyPgff/7tNByCJjk17tcDh7fEZL/W44xnjtrC2s7PK7CV7rwTGvCiiIra+ GjlKvYsSSv7QsukPacOzS6UhueGONucXzGXr6AIlNw/gpJuapliAPpIB3rK5BfW47jil xumlpx5up6oOVEsWh2SAKRpcayw+LefQmruRDsv1BwH9nELXyFC5xQpO51m3pHMZmmXS 1dn0hjTVKibzf5mdHl3QZAJlk/eOc9oc3tOei3ZLeUK4GmLTZULSOOH/DRXj4AOxmTSo wrSQ== X-Gm-Message-State: APjAAAUI1ztfBJByoOQyH9HM/3bxRuV++Ct9l5L6raHvLPUnjhMfR0QA D9hqU6yE89T3LsyUaFPrtG4mmA== X-Received: by 2002:a17:90a:2469:: with SMTP id h96mr4132142pje.121.1575361468517; Tue, 03 Dec 2019 00:24:28 -0800 (PST) Received: from vader ([2620:10d:c090:180::c0f1]) by smtp.gmail.com with ESMTPSA id d22sm2347780pgg.52.2019.12.03.00.24.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 03 Dec 2019 00:24:27 -0800 (PST) Date: Tue, 3 Dec 2019 00:24:26 -0800 From: Omar Sandoval To: Yunfeng Ye Cc: clm@fb.com, josef@toxicpanda.com, dsterba@suse.com, linux-btrfs@vger.kernel.org, linux-kernel@vger.kernel.org, "hushiyuan@huawei.com" , "linfeilong@huawei.com" Subject: Re: [PATCH] btrfs: remove unused condition check in btrfs_page_mkwrite() Message-ID: <20191203082426.GC829117@vader> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Dec 03, 2019 at 04:16:43PM +0800, Yunfeng Ye wrote: > The condition '!ret2' is always true. so remove the unused condition > check. > > Signed-off-by: Yunfeng Ye For this sort of change, one should mention how the code got in this state. In this case, commit 717beb96d969 ("Btrfs: fix regression in btrfs_page_mkwrite() from vm_fault_t conversion") left behind the check after moving this code out of the goto. Ohter than that, Reviewed-by: Omar Sandoval > --- > fs/btrfs/inode.c | 11 ++++------- > 1 file changed, 4 insertions(+), 7 deletions(-) > > diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c > index 56032c518b26..eef2432597e2 100644 > --- a/fs/btrfs/inode.c > +++ b/fs/btrfs/inode.c > @@ -9073,7 +9073,6 @@ vm_fault_t btrfs_page_mkwrite(struct vm_fault *vmf) > ret = VM_FAULT_SIGBUS; > goto out_unlock; > } > - ret2 = 0; > > /* page is wholly or partially inside EOF */ > if (page_start + PAGE_SIZE > size) > @@ -9097,12 +9096,10 @@ vm_fault_t btrfs_page_mkwrite(struct vm_fault *vmf) > > unlock_extent_cached(io_tree, page_start, page_end, &cached_state); > > - if (!ret2) { > - btrfs_delalloc_release_extents(BTRFS_I(inode), PAGE_SIZE); > - sb_end_pagefault(inode->i_sb); > - extent_changeset_free(data_reserved); > - return VM_FAULT_LOCKED; > - } > + btrfs_delalloc_release_extents(BTRFS_I(inode), PAGE_SIZE); > + sb_end_pagefault(inode->i_sb); > + extent_changeset_free(data_reserved); > + return VM_FAULT_LOCKED; > > out_unlock: > unlock_page(page); > -- > 2.7.4 >