Re: [PATCH] btrfs: remove redundant inode null check

From: David Sterba
Date: Tue Dec 20 2016 - 10:47:19 EST


On Fri, Dec 16, 2016 at 03:24:46PM +0000, Colin King wrote:
> From: Colin Ian King <colin.king@xxxxxxxxxxxxx>
>
> 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.

This also means that the if (!dir) check is redundant. I've looked up
the call chain and haven't seen any instance that would lead to a NULL
dir down in the filesystem callback. So please remove both.