Browse Source

ceph: fix dentry reference leak in dcache readdir

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>
Sage Weil 15 years ago
parent
commit
f5b066287c
1 changed files with 2 additions and 2 deletions
  1. 2 2
      fs/ceph/dir.c

+ 2 - 2
fs/ceph/dir.c

@@ -170,11 +170,11 @@ more:
 	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++;