ceph: fix dentry reference leak in dcache readdir
authorSage Weil <sage@newdream.net>
Mon, 12 Apr 2010 21:24:28 +0000 (14:24 -0700)
committerSage Weil <sage@newdream.net>
Mon, 12 Apr 2010 21:25:51 +0000 (14:25 -0700)
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>
fs/ceph/dir.c

index aed8fda3302497dcc1b9d6421ce6d881f58ee143..7505b4f1f5971dd37ba25c6b736be1deab22f743 100644 (file)
@@ -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++;