Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp1074194ybl; Tue, 3 Dec 2019 01:00:52 -0800 (PST) X-Google-Smtp-Source: APXvYqxB19zsut3Zpcw/nke9Kl2xGObk4IhntorHWMavZ6IBvzZF3JS0GRda26UCbQGL4ittbOK2 X-Received: by 2002:aca:a896:: with SMTP id r144mr2858672oie.142.1575363652280; Tue, 03 Dec 2019 01:00:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1575363652; cv=none; d=google.com; s=arc-20160816; b=AYdCB3+kaflwC3br93rAPaYGnkRG+w/znoEU3NMpkU2ysDi5p1SPskeV5p3G2y9qe7 i/c7JRzkF7LqxOiL76VJKYQi+ju0ZodPth4oDZ8oqj3v4XHXBbGxnbSMhhZhd+1PEf9/ 4/ffo98PZ37iTEwPBwJGcd6kAtzMhSwHv8SCFXec3lTYGfuVwoU+0EZX1MtzfJTymmSe pgwU0pmaELqGJ5WRKzC/aSNf3t7ViyKWyIF0LBny/KRILe/EbG4ISmpgdjnmwlRtG4Vj 4LgoOqpkGDkDWUO8W58rHetmF2I05lCSb17G7WXBKMnN7sS3nWwYTXVKr7Fd41SuJwWL lHpg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:mime-version:user-agent:date:message-id:subject :from:to; bh=sBegZVW5nWwm1Yeizfav1ZBE/Imd8NgdY4EdJnqs8Ms=; b=cFCBGwtnZjQiTgRE0/PgCBR5t8cDvg2MAsktzV6BDZIusW9HIlC4YQLh2pGlCRMELf VQ73Jqph6I/Al0LSWWuDuFhnD3EkdSS0cg+dCKbthcnrvNHEBRp/FMZcHbg4Ym1cXHqM PsDoSWlT9JfnfXPNw8D7xbaQ4zUSbTLpiBUM8bs8a9mYwdB1b3pNaqEm5Kyihp8I3X/j N5TB3OF5ECM0uYLR0p8Cpl0AwEo9xQNy9edm+3HIyPFV4GHIGrVBxSDAHBDLXFyUlidc feht8uEzClh4Nid5vcBTv5uNj8iEuKgx5N+gBfJVN369ZiyTRt3sR2igH5rPWLHpcBl2 3gQA== ARC-Authentication-Results: i=1; mx.google.com; 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 l19si950968oib.48.2019.12.03.01.00.39; Tue, 03 Dec 2019 01:00:52 -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; 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 S1726079AbfLCJAE (ORCPT + 99 others); Tue, 3 Dec 2019 04:00:04 -0500 Received: from szxga07-in.huawei.com ([45.249.212.35]:51698 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725829AbfLCJAE (ORCPT ); Tue, 3 Dec 2019 04:00:04 -0500 Received: from DGGEMS407-HUB.china.huawei.com (unknown [172.30.72.60]) by Forcepoint Email with ESMTP id 840A3E9970DE881E8608; Tue, 3 Dec 2019 17:00:02 +0800 (CST) Received: from [127.0.0.1] (10.177.251.225) by DGGEMS407-HUB.china.huawei.com (10.3.19.207) with Microsoft SMTP Server id 14.3.439.0; Tue, 3 Dec 2019 16:59:56 +0800 To: , , , , , "hushiyuan@huawei.com" , "linfeilong@huawei.com" From: Yunfeng Ye Subject: [PATCH v2] btrfs: remove unused condition check in btrfs_page_mkwrite() Message-ID: Date: Tue, 3 Dec 2019 16:59:25 +0800 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [10.177.251.225] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The condition '!ret2' is always true. 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, so remove the unused condition check. Signed-off-by: Yunfeng Ye Reviewed-by: Omar Sandoval --- v1 -> v2: - update the commit comment 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