diff options
author | Trond Myklebust <Trond.Myklebust@netapp.com> | 2006-03-20 13:44:50 -0500 |
---|---|---|
committer | Trond Myklebust <Trond.Myklebust@netapp.com> | 2006-03-20 13:44:50 -0500 |
commit | deb7d638262019cbac5d15ab74ffd1c29242c7cb (patch) | |
tree | 88095acd2d455b594f4cec08702aa9691faff2a0 /fs/nfs/write.c | |
parent | 1dd761e9070aa2e543df3db41bd75ed4b8f2fab9 (diff) |
NFS: Fix a race with PG_private and nfs_release_page()
We don't need to set PG_private for readahead pages, since they never get
unlocked while I/O is in progress. However there is a small race in
nfs_readpage_release() whereby the page may be unlocked, and have
PG_private set.
Fix is to have PG_private set only for the case of writes...
Also fix a bug in nfs_clear_page_writeback(): Don't attempt to clear the
radix_tree tag if we've already deleted the radix tree entry.
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'fs/nfs/write.c')
-rw-r--r-- | fs/nfs/write.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/fs/nfs/write.c b/fs/nfs/write.c index 647e3217c2e1..d9e5ee594572 100644 --- a/fs/nfs/write.c +++ b/fs/nfs/write.c | |||
@@ -429,6 +429,7 @@ static int nfs_inode_add_request(struct inode *inode, struct nfs_page *req) | |||
429 | if (nfs_have_delegation(inode, FMODE_WRITE)) | 429 | if (nfs_have_delegation(inode, FMODE_WRITE)) |
430 | nfsi->change_attr++; | 430 | nfsi->change_attr++; |
431 | } | 431 | } |
432 | SetPagePrivate(req->wb_page); | ||
432 | nfsi->npages++; | 433 | nfsi->npages++; |
433 | atomic_inc(&req->wb_count); | 434 | atomic_inc(&req->wb_count); |
434 | return 0; | 435 | return 0; |
@@ -445,6 +446,7 @@ static void nfs_inode_remove_request(struct nfs_page *req) | |||
445 | BUG_ON (!NFS_WBACK_BUSY(req)); | 446 | BUG_ON (!NFS_WBACK_BUSY(req)); |
446 | 447 | ||
447 | spin_lock(&nfsi->req_lock); | 448 | spin_lock(&nfsi->req_lock); |
449 | ClearPagePrivate(req->wb_page); | ||
448 | radix_tree_delete(&nfsi->nfs_page_tree, req->wb_index); | 450 | radix_tree_delete(&nfsi->nfs_page_tree, req->wb_index); |
449 | nfsi->npages--; | 451 | nfsi->npages--; |
450 | if (!nfsi->npages) { | 452 | if (!nfsi->npages) { |