diff options
author | Trond Myklebust <trond.myklebust@primarydata.com> | 2015-02-13 21:03:16 -0500 |
---|---|---|
committer | Trond Myklebust <trond.myklebust@primarydata.com> | 2015-02-13 21:03:16 -0500 |
commit | f4086a3d789dbe18949862276d83b8f49fce6d2f (patch) | |
tree | 4b4c65765c66e00397b14b1839ea775cb73e851e | |
parent | 813b00d63f6ca1ed40a2f4f9c034d59bc424025e (diff) |
NFS: struct nfs_commit_info.lock must always point to inode->i_lock
Commit 411a99adffb4f (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: 411a99adffb4f ("nfs: clear_request_commit while holding i_lock")
Cc: stable@vger.kernel.org # 3.17.x
Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
-rw-r--r-- | fs/nfs/direct.c | 2 | ||||
-rw-r--r-- | include/linux/nfs_xdr.h | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/fs/nfs/direct.c b/fs/nfs/direct.c index 7077521acdf4..e907c8cf732e 100644 --- a/fs/nfs/direct.c +++ b/fs/nfs/direct.c | |||
@@ -283,7 +283,7 @@ static void nfs_direct_release_pages(struct page **pages, unsigned int npages) | |||
283 | void nfs_init_cinfo_from_dreq(struct nfs_commit_info *cinfo, | 283 | void nfs_init_cinfo_from_dreq(struct nfs_commit_info *cinfo, |
284 | struct nfs_direct_req *dreq) | 284 | struct nfs_direct_req *dreq) |
285 | { | 285 | { |
286 | cinfo->lock = &dreq->lock; | 286 | cinfo->lock = &dreq->inode->i_lock; |
287 | cinfo->mds = &dreq->mds_cinfo; | 287 | cinfo->mds = &dreq->mds_cinfo; |
288 | cinfo->ds = &dreq->ds_cinfo; | 288 | cinfo->ds = &dreq->ds_cinfo; |
289 | cinfo->dreq = dreq; | 289 | cinfo->dreq = dreq; |
diff --git a/include/linux/nfs_xdr.h b/include/linux/nfs_xdr.h index 38d96ba935c2..9a39132fda49 100644 --- a/include/linux/nfs_xdr.h +++ b/include/linux/nfs_xdr.h | |||
@@ -1351,7 +1351,7 @@ struct nfs_commit_completion_ops { | |||
1351 | }; | 1351 | }; |
1352 | 1352 | ||
1353 | struct nfs_commit_info { | 1353 | struct nfs_commit_info { |
1354 | spinlock_t *lock; | 1354 | spinlock_t *lock; /* inode->i_lock */ |
1355 | struct nfs_mds_commit_info *mds; | 1355 | struct nfs_mds_commit_info *mds; |
1356 | struct pnfs_ds_commit_info *ds; | 1356 | struct pnfs_ds_commit_info *ds; |
1357 | struct nfs_direct_req *dreq; /* O_DIRECT request */ | 1357 | struct nfs_direct_req *dreq; /* O_DIRECT request */ |