Function in question: static struct xfs_inode * xfs_filestream_get_parent( struct xfs_inode *ip) { struct inode *inode = VFS_I(ip), *dir = NULL; struct dentry *dentry, *parent; dentry = d_find_alias(inode); if (!dentry) goto out; parent = dget_parent(dentry); if (!parent) goto out_dput; dir = igrab(d_inode(parent)); dput(parent); out_dput: dput(dentry); out: return dir ? XFS_I(dir) : NULL; } 1) dget_parent(dentry) never returns NULL; if you have IS_ROOT(dentry) you get an equivalent of dget(dentry). What do you want returned in that case? 2) why bother with dget_parent() in the first place? What's wrong with spin_lock(&dentry->d_lock); // stabilizes ->d_parent dir = igrab(dentry->d_parent->d_inode); spin_unlock(&dentry->d_lock); or, if you intended NULL for root, spin_lock(&dentry->d_lock); // stabilizes ->d_parent if (!IS_ROOT(dentry)) dir = igrab(dentry->d_parent->d_inode); spin_unlock(&dentry->d_lock); Is there anything subtle I'm missing here?