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>
This commit is contained in:
@@ -689,7 +689,9 @@ int nfs_flush_incompatible(struct file *file, struct page *page)
|
||||
req = nfs_page_find_request(page);
|
||||
if (req == NULL)
|
||||
return 0;
|
||||
do_flush = req->wb_page != page || req->wb_context != ctx;
|
||||
do_flush = req->wb_page != page || req->wb_context != ctx ||
|
||||
req->wb_lock_context->lockowner != current->files ||
|
||||
req->wb_lock_context->pid != current->tgid;
|
||||
nfs_release_request(req);
|
||||
if (!do_flush)
|
||||
return 0;
|
||||
@@ -813,6 +815,7 @@ static int nfs_write_rpcsetup(struct nfs_page *req,
|
||||
data->args.pages = data->pagevec;
|
||||
data->args.count = count;
|
||||
data->args.context = get_nfs_open_context(req->wb_context);
|
||||
data->args.lock_context = req->wb_lock_context;
|
||||
data->args.stable = NFS_UNSTABLE;
|
||||
if (how & FLUSH_STABLE) {
|
||||
data->args.stable = NFS_DATA_SYNC;
|
||||
|
||||
Reference in New Issue
Block a user