Skip to content

Commit

Permalink
ceph: fix dentry reference leak in dcache readdir
Browse files Browse the repository at this point in the history
When filldir returned an error (e.g. buffer full for a large directory),
we would leak a dentry reference, causing an oops on umount.

Signed-off-by: Sage Weil <sage@newdream.net>
  • Loading branch information
Sage Weil committed Apr 12, 2010
1 parent 2844a76 commit f5b0662
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions fs/ceph/dir.c
Original file line number Diff line number Diff line change
Expand Up @@ -170,11 +170,11 @@ static int __dcache_readdir(struct file *filp,
spin_lock(&inode->i_lock);
spin_lock(&dcache_lock);

last = dentry;

if (err < 0)
goto out_unlock;

last = dentry;

p = p->prev;
filp->f_pos++;

Expand Down

0 comments on commit f5b0662

Please sign in to comment.