drbd: ->d_parent is never NULL or negative
authorAl Viro <viro@zeniv.linux.org.uk>
Sun, 29 May 2016 18:52:22 +0000 (14:52 -0400)
committerAl Viro <viro@zeniv.linux.org.uk>
Sun, 29 May 2016 20:21:55 +0000 (16:21 -0400)
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
drivers/block/drbd/drbd_debugfs.c
security/inode.c

index 4de95bbff4860b2d39ad6fc40cbf95ab849929b1..71cdce707ff2303141cd98e4fef8d143514fee53 100644 (file)
@@ -430,9 +430,6 @@ static int drbd_single_open(struct file *file, int (*show)(struct seq_file *, vo
        /* Are we still linked,
         * or has debugfs_remove() already been called? */
        parent = file->f_path.dentry->d_parent;
-       /* not sure if this can happen: */
-       if (!parent || d_really_is_negative(parent))
-               goto out;
        /* serialize with d_delete() */
        inode_lock(d_inode(parent));
        /* Make sure the object is still alive */
@@ -445,7 +442,6 @@ static int drbd_single_open(struct file *file, int (*show)(struct seq_file *, vo
                if (ret)
                        kref_put(kref, release);
        }
-out:
        return ret;
 }
 
index 28414b0207ce58f1fdd8503da0f61a39ba5c7cfe..526f82269cb09ca2fdae3860602187aa53f15039 100644 (file)
@@ -191,10 +191,6 @@ void securityfs_remove(struct dentry *dentry)
        if (!dentry || IS_ERR(dentry))
                return;
 
-       parent = dentry->d_parent;
-       if (!parent || d_really_is_negative(parent))
-               return;
-
        inode_lock(d_inode(parent));
        if (simple_positive(dentry)) {
                if (d_is_dir(dentry))