Re: [PATCH] EXPORTFS: handle NULL returns from fh_to_dentry()/fh_to_parent()

David Howells
2008-12-09T10:31:11Z

J. Bruce Fields <bfields@fieldses.org> wrote:

> + if (!result)
> + result = ERR_PTR(-ESTALE);
> if (IS_ERR(result))
> return result;

This is why I think this is a bad idea. This adds an extra conditional test
and branch. In fact, the way you've done it means you have to do the extra
branch whatever[*]; it might be better to have the if-statement you added
return directly.

[*] assuming gcc doesn't manage to be clever enough to omit the second test if
the first is true.

David