Use d_is_positive(dentry) or d_is_negative(dentry) rather than testing
dentry->d_inode as the dentry may cover another layer that has an inode when
the top layer doesn't or may hold a 0,0 chardev that's actually a whiteout.
Signed-off-by: David Howells <dhowells@redhat.com>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
         *    security_path hooks as a deleted dentry except without an inode
         *    allocated.
         */
-       if (d_unlinked(path->dentry) && path->dentry->d_inode &&
+       if (d_unlinked(path->dentry) && d_is_positive(path->dentry) &&
            !(flags & PATH_MEDIATE_DELETED)) {
                        error = -ENOENT;
                        goto out;