ceph: fix dentry reference leak in dcache readdir

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Linux Kernel Mailing List
Date: Wednesday, April 14, 2010 - 6:59 pm

Gitweb:     http://git.kernel.org/linus/f5b066287c74b624583b993395a65d03a6487b3a
Commit:     f5b066287c74b624583b993395a65d03a6487b3a
Parent:     2844a76a25a2fc2f5025cf128c95a14d86146d33
Author:     Sage Weil <sage@newdream.net>
AuthorDate: Mon Apr 12 14:24:28 2010 -0700
Committer:  Sage Weil <sage@newdream.net>
CommitDate: Mon Apr 12 14:25:51 2010 -0700

    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>
---
 fs/ceph/dir.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/fs/ceph/dir.c b/fs/ceph/dir.c
index aed8fda..7505b4f 100644
--- a/fs/ceph/dir.c
+++ b/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++;
 
--
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
ceph: fix dentry reference leak in dcache readdir, Linux Kernel Mailing ..., (Wed Apr 14, 6:59 pm)