Commit a7e49f6f authored by Trond Myklebust's avatar Trond Myklebust Committed by Luis Henriques

NFS: struct nfs_commit_info.lock must always point to inode->i_lock

commit f4086a3d upstream.

Commit 411a99ad (nfs: clear_request_commit while holding i_lock)
assumes that the nfs_commit_info always points to the inode->i_lock.
For historical reasons, that is not the case for O_DIRECT writes.

Cc: Weston Andros Adamson <dros@primarydata.com>
Fixes: 411a99ad ("nfs: clear_request_commit while holding i_lock")
Signed-off-by: default avatarTrond Myklebust <trond.myklebust@primarydata.com>
Signed-off-by: default avatarLuis Henriques <luis.henriques@canonical.com>
parent 00dbf22b
......@@ -246,7 +246,7 @@ static void nfs_direct_release_pages(struct page **pages, unsigned int npages)
void nfs_init_cinfo_from_dreq(struct nfs_commit_info *cinfo,
struct nfs_direct_req *dreq)
{
cinfo->lock = &dreq->lock;
cinfo->lock = &dreq->inode->i_lock;
cinfo->mds = &dreq->mds_cinfo;
cinfo->ds = &dreq->ds_cinfo;
cinfo->dreq = dreq;
......
......@@ -1319,7 +1319,7 @@ struct nfs_commit_completion_ops {
};
struct nfs_commit_info {
spinlock_t *lock;
spinlock_t *lock; /* inode->i_lock */
struct nfs_mds_commit_info *mds;
struct pnfs_ds_commit_info *ds;
struct nfs_direct_req *dreq; /* O_DIRECT request */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment