Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp1165751ybl; Thu, 22 Aug 2019 10:15:48 -0700 (PDT) X-Google-Smtp-Source: APXvYqxY1RrH/XCrWMScgXtAzEsfib5itMSRfS5yqWm/SjFelyLqC98rWMhaJAIgi8eOxyArRkQ1 X-Received: by 2002:a63:a66:: with SMTP id z38mr252182pgk.247.1566494148381; Thu, 22 Aug 2019 10:15:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1566494148; cv=none; d=google.com; s=arc-20160816; b=wz22tcav0mEwBIKu8w9jt1P37xW29TSUspVvF2K0vZDnXnvl68XKXIZNEXuu/II9Nh I62JD3sgajuCsW1yuxLXFYZoaG5EkwGHXL9i5CsiL4RtO9CGKuuN7KgYf036YcnAALde pYjLU0KAOw+/I5YjJX+hLp/nhwLIiFEzPUcBEi7gmN0EBdVzx4hGK2u1HKCYKxr0hZ7T bjPRD6DVken53YJqTg5aysQywvNrwTVLn9ACfNeK335VvHoex2AS4T+k3tngGTIDNDyY mU4BXXyLvkBAlDier7aOB0NebNhADANo7/MeSYo/FV2ZQ/1F5JPz09xBLwtrrT81QBPs kh8g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:mail-followup-to :message-id:subject:cc:to:from:date; bh=wxi4dorvzSih3OrK0X1QNotMV+2CkVuHVHwY7NntXxU=; b=mbQMcK3Mdj2zFiNa3JoOZNH3S+L0QPE97lseLEKow2JP2SSj7KjDhM1wKLHVzdoqx5 0BkJ1PcTW2ci8OXqA5zOav9TysmeXooV/+FNsrLmRtZSIqiMo5P/IN8HmA0n9W8jFRKA BijJrAEL586Px9/7NPALFXn6G7bLkg7EnUJ2I5sAhBj2xNqfXNw2ZGDCC6vQu/lo8GN1 56mMNc5a828knxdsPr3LCaqvtv+pyYtWuBmbEt5eyZcGTL3vkqAe2a4KbszPzc168mgl DHmKIxmI2bgWgXyjzoaCUkzxrMvVvl2QZYzyVFrIMeGKL7pUi8ikC1OQ5QmVKViK5BeO yIxg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-ext4-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-ext4-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 x10si191665pjt.98.2019.08.22.10.15.30; Thu, 22 Aug 2019 10:15:48 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-ext4-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-ext4-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732152AbfHVPOw (ORCPT + 99 others); Thu, 22 Aug 2019 11:14:52 -0400 Received: from outgoing-auth-1.mit.edu ([18.9.28.11]:36692 "EHLO outgoing.mit.edu" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1732150AbfHVPOv (ORCPT ); Thu, 22 Aug 2019 11:14:51 -0400 Received: from callcc.thunk.org (guestnat-104-133-0-111.corp.google.com [104.133.0.111] (may be forged)) (authenticated bits=0) (User authenticated as tytso@ATHENA.MIT.EDU) by outgoing.mit.edu (8.14.7/8.12.4) with ESMTP id x7MFEiSG024985 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 22 Aug 2019 11:14:46 -0400 Received: by callcc.thunk.org (Postfix, from userid 15806) id A983042049E; Thu, 22 Aug 2019 11:14:44 -0400 (EDT) Date: Thu, 22 Aug 2019 11:14:44 -0400 From: "Theodore Y. Ts'o" To: Austin Kim Cc: adilger.kernel@dilger.ca, linux-ext4@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] ext4: remove unreachable statement inside __es_insert_extent() Message-ID: <20190822151444.GA7550@mit.edu> Mail-Followup-To: "Theodore Y. Ts'o" , Austin Kim , adilger.kernel@dilger.ca, linux-ext4@vger.kernel.org, linux-kernel@vger.kernel.org References: <20190822063743.GA36528@LGEARND20B15> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190822063743.GA36528@LGEARND20B15> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-ext4-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org On Thu, Aug 22, 2019 at 03:37:43PM +0900, Austin Kim wrote: > __es_insert_extent() never returns -EINVAL after BUG is executed. > So remove unreachable code. > --- > fs/ext4/extents_status.c | 1 - > 1 file changed, 1 deletion(-) > > diff --git a/fs/ext4/extents_status.c b/fs/ext4/extents_status.c > index a959adc..7f97360 100644 > --- a/fs/ext4/extents_status.c > +++ b/fs/ext4/extents_status.c > @@ -781,7 +781,6 @@ static int __es_insert_extent(struct inode *inode, struct extent_status *newes) > p = &(*p)->rb_right; > } else { > BUG(); > - return -EINVAL; This would not be safe in the case of !CONFIG_BUG. (See init/Kconfig) It's fair to argue that we shouldn't have CONFIG_BUG --- or !CONFIG_BUG should still cause the kernel to stop without actually printing the full BUG information, for those tiny kernel applications which are really worried about kernel text space. It also would be fair to argue that we should remove the unreachable annotation for BUG(), or even, add a *reachable* annotation to catch code where something something terribly might happen if the kernel is built with !CONFIG_BUG and we trip against a bug. But this is a much higher level issue than your sending individual paches subsystems. Regards, - Ted