Skip to content

Commit

Permalink
vfs: delete surplus inode NULL check
Browse files Browse the repository at this point in the history
Each iteration of d_delete we reload inode from dentry->d_inode and
then call S_ISDIR(inode-i_mode), so inode cannot possibly be NULL
shortly afterwards unless something went horribly wrong.

Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
  • Loading branch information
Alan Cox authored and Al Viro committed Sep 27, 2012
1 parent 2903ff0 commit 1fe0c02
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion fs/dcache.c
Original file line number Diff line number Diff line change
Expand Up @@ -2109,7 +2109,7 @@ void d_delete(struct dentry * dentry)
inode = dentry->d_inode;
isdir = S_ISDIR(inode->i_mode);
if (dentry->d_count == 1) {
if (inode && !spin_trylock(&inode->i_lock)) {
if (!spin_trylock(&inode->i_lock)) {
spin_unlock(&dentry->d_lock);
cpu_relax();
goto again;
Expand Down

0 comments on commit 1fe0c02

Please sign in to comment.