Message ID | 20161216152446.23361-1-colin.king@canonical.com (mailing list archive) |
---|---|
State | Superseded |
Headers | show |
On Fri, Dec 16, 2016 at 03:24:46PM +0000, Colin King wrote: > From: Colin Ian King <colin.king@canonical.com> > > 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. -- To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
diff --git a/fs/btrfs/export.c b/fs/btrfs/export.c index 340d907..e90f781 100644 --- a/fs/btrfs/export.c +++ b/fs/btrfs/export.c @@ -235,7 +235,7 @@ static int btrfs_get_name(struct dentry *parent, char *name, int ret; u64 ino; - if (!dir || !inode) + if (!dir) return -EINVAL; if (!S_ISDIR(dir->i_mode))