From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934662AbcLTQ2L (ORCPT ); Tue, 20 Dec 2016 11:28:11 -0500 Received: from mx2.suse.de ([195.135.220.15]:54105 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933840AbcLTQ2J (ORCPT ); Tue, 20 Dec 2016 11:28:09 -0500 Date: Tue, 20 Dec 2016 17:27:52 +0100 From: David Sterba To: Colin King Cc: Chris Mason , Josef Bacik , David Sterba , linux-btrfs@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH][V2] btrfs: remove redundant inode null check Message-ID: <20161220162752.GO3620@twin.jikos.cz> Reply-To: dsterba@suse.cz Mail-Followup-To: dsterba@suse.cz, Colin King , Chris Mason , Josef Bacik , David Sterba , linux-btrfs@vger.kernel.org, linux-kernel@vger.kernel.org References: <20161220161837.24391-1-colin.king@canonical.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20161220161837.24391-1-colin.king@canonical.com> User-Agent: Mutt/1.5.23.1 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Dec 20, 2016 at 04:18:37PM +0000, Colin King wrote: > From: Colin Ian King > > The check for a null inode is redundant since the function > is a callback for exportfs, which will itself crash if > dentry->d_inode or parent->d_inode is NULL. Removing the > null check makes this consistent with other file systems. > > Also remove the redundant null dir check too. > > Found with static analysis by CoverityScan, CID 1389472 > > Kudos to Jeff Mahoney for reviewing and explaining the error in > my original patch (most of this explanation went into the above > commit message) and David Sterba for pointing out that the dir > check is also redundant. > > Signed-off-by: Colin Ian King Reviewed-by: David Sterba Added to cleanups queue, thanks.