]> err.no Git - linux-2.6/commitdiff
nfs: fix race in nfs_dirty_request
authorFred Isaman <iisaman@citi.umich.edu>
Thu, 1 May 2008 17:03:22 +0000 (20:03 +0300)
committerTrond Myklebust <Trond.Myklebust@netapp.com>
Fri, 16 May 2008 16:43:23 +0000 (09:43 -0700)
When called from nfs_flush_incompatible, the req is not locked, so
req->wb_page might be set to NULL before it is used by PageWriteback.

Signed-off-by: Fred Isaman <iisaman@citi.umich.edu>
Signed-off-by: Benny Halevy <bhalevy@panasas.com>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
fs/nfs/write.c

index 1ade11d1ba078c922e8dc24b0d2d98eec022d09f..6d8ace3e3259d9f643fbf1e92fc3c4f1c4dc40f0 100644 (file)
@@ -415,7 +415,7 @@ nfs_dirty_request(struct nfs_page *req)
 
        if (page == NULL || test_bit(PG_NEED_COMMIT, &req->wb_flags))
                return 0;
-       return !PageWriteback(req->wb_page);
+       return !PageWriteback(page);
 }
 
 #if defined(CONFIG_NFS_V3) || defined(CONFIG_NFS_V4)