]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
NFS: Fix buglet in fs/nfs/write.c
authorNeil Brown <neilb@suse.de>
Mon, 20 Mar 2006 18:44:04 +0000 (13:44 -0500)
committerTrond Myklebust <Trond.Myklebust@netapp.com>
Mon, 20 Mar 2006 18:44:04 +0000 (13:44 -0500)
I've been reading through fs/nfs/write.c trying to track down a bug
that seems to be related to pages loosing a refcount and getting
freed too early (you interested in detail??) and I spotted a little
bug which the following patch should fix.

Signed-off-by: Neil Brown <neilb@suse.de>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
fs/nfs/write.c

index 9449b6835509dae636154341e3257d23e0eaf1db..d6ad449041eb5703c2cd70d715d7fcaa8ee22fbd 100644 (file)
@@ -653,8 +653,11 @@ static struct nfs_page * nfs_update_request(struct nfs_open_context* ctx,
                                spin_unlock(&nfsi->req_lock);
                                error = nfs_wait_on_request(req);
                                nfs_release_request(req);
-                               if (error < 0)
+                               if (error < 0) {
+                                       if (new)
+                                               nfs_release_request(new);
                                        return ERR_PTR(error);
+                               }
                                continue;
                        }
                        spin_unlock(&nfsi->req_lock);