Leak in nlmsvc_testlock for async GETFL case
authorOleg Drokin <Oleg.Drokin@Sun.COM>
Sat, 12 Jan 2008 02:57:35 +0000 (21:57 -0500)
committerJ. Bruce Fields <bfields@citi.umich.edu>
Fri, 1 Feb 2008 21:42:07 +0000 (16:42 -0500)
Fix nlm_block leak for the case of supplied blocking lock info.

Signed-off-by: Oleg Drokin <green@linuxhacker.ru>
Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu>
fs/lockd/svclock.c

index 84c4d5e04ebbe0f8f49b999b5404d4325b5eaf7e..2f4d8fa666892b9fa8b41266a627608c55c1e8a0 100644 (file)
@@ -505,12 +505,12 @@ nlmsvc_testlock(struct svc_rqst *rqstp, struct nlm_file *file,
                        goto out;
                }
                if (block->b_flags & B_GOT_CALLBACK) {
+                       nlmsvc_unlink_block(block);
                        if (block->b_fl != NULL
                                        && block->b_fl->fl_type != F_UNLCK) {
                                lock->fl = *block->b_fl;
                                goto conf_lock;
                        } else {
-                               nlmsvc_unlink_block(block);
                                ret = nlm_granted;
                                goto out;
                        }