diff options
author | Trond Myklebust <Trond.Myklebust@netapp.com> | 2010-06-25 16:35:53 -0400 |
---|---|---|
committer | Trond Myklebust <Trond.Myklebust@netapp.com> | 2010-07-30 14:41:56 -0400 |
commit | f11ac8db5d07b6e99d41ff4aa39d878ee5cef1c5 (patch) | |
tree | 4393cbc2653145ba3269d5143f5db7811a59698b /fs/nfs/pagelist.c | |
parent | 1f0e890dba5b0f543fea47732116b1c65d55614e (diff) |
NFSv4: Ensure that we track the NFSv4 lock state in read/write requests.
This patch fixes bugzilla entry 14501:
https://bugzilla.kernel.org/show_bug.cgi?id=14501
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'fs/nfs/pagelist.c')
-rw-r--r-- | fs/nfs/pagelist.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/fs/nfs/pagelist.c b/fs/nfs/pagelist.c index a3654e57b589..919490232e17 100644 --- a/fs/nfs/pagelist.c +++ b/fs/nfs/pagelist.c | |||
@@ -79,6 +79,7 @@ nfs_create_request(struct nfs_open_context *ctx, struct inode *inode, | |||
79 | req->wb_pgbase = offset; | 79 | req->wb_pgbase = offset; |
80 | req->wb_bytes = count; | 80 | req->wb_bytes = count; |
81 | req->wb_context = get_nfs_open_context(ctx); | 81 | req->wb_context = get_nfs_open_context(ctx); |
82 | req->wb_lock_context = nfs_get_lock_context(ctx); | ||
82 | kref_init(&req->wb_kref); | 83 | kref_init(&req->wb_kref); |
83 | return req; | 84 | return req; |
84 | } | 85 | } |
@@ -141,11 +142,16 @@ void nfs_clear_request(struct nfs_page *req) | |||
141 | { | 142 | { |
142 | struct page *page = req->wb_page; | 143 | struct page *page = req->wb_page; |
143 | struct nfs_open_context *ctx = req->wb_context; | 144 | struct nfs_open_context *ctx = req->wb_context; |
145 | struct nfs_lock_context *l_ctx = req->wb_lock_context; | ||
144 | 146 | ||
145 | if (page != NULL) { | 147 | if (page != NULL) { |
146 | page_cache_release(page); | 148 | page_cache_release(page); |
147 | req->wb_page = NULL; | 149 | req->wb_page = NULL; |
148 | } | 150 | } |
151 | if (l_ctx != NULL) { | ||
152 | nfs_put_lock_context(l_ctx); | ||
153 | req->wb_lock_context = NULL; | ||
154 | } | ||
149 | if (ctx != NULL) { | 155 | if (ctx != NULL) { |
150 | put_nfs_open_context(ctx); | 156 | put_nfs_open_context(ctx); |
151 | req->wb_context = NULL; | 157 | req->wb_context = NULL; |
@@ -235,7 +241,7 @@ static int nfs_can_coalesce_requests(struct nfs_page *prev, | |||
235 | { | 241 | { |
236 | if (req->wb_context->cred != prev->wb_context->cred) | 242 | if (req->wb_context->cred != prev->wb_context->cred) |
237 | return 0; | 243 | return 0; |
238 | if (req->wb_context->lockowner != prev->wb_context->lockowner) | 244 | if (req->wb_lock_context->lockowner != prev->wb_lock_context->lockowner) |
239 | return 0; | 245 | return 0; |
240 | if (req->wb_context->state != prev->wb_context->state) | 246 | if (req->wb_context->state != prev->wb_context->state) |
241 | return 0; | 247 | return 0; |