diff options
author | Trond Myklebust <trond.myklebust@primarydata.com> | 2015-10-01 17:17:06 -0400 |
---|---|---|
committer | Trond Myklebust <trond.myklebust@primarydata.com> | 2015-12-31 15:55:35 -0500 |
commit | 138a2935dc9783b131d9647c3bddb22ae5c84d77 (patch) | |
tree | c21379e9e3c162c65ee5a6145e6081baaae1dfd6 | |
parent | b20135d0b2431900a3a5395970ffb7e4f3767c8b (diff) |
NFS: Relax requirements in nfs_flush_incompatible
If two processes share the same credentials and NFSv4 open stateid, then
allow them both to dirty the same page, even if their nfs_open_context
differs.
Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
-rw-r--r-- | fs/nfs/internal.h | 6 | ||||
-rw-r--r-- | fs/nfs/pagelist.c | 6 | ||||
-rw-r--r-- | fs/nfs/write.c | 3 |
3 files changed, 8 insertions, 7 deletions
diff --git a/fs/nfs/internal.h b/fs/nfs/internal.h index 99a2919047e9..870e2ba7ba49 100644 --- a/fs/nfs/internal.h +++ b/fs/nfs/internal.h | |||
@@ -264,6 +264,12 @@ static inline bool nfs_pgio_has_mirroring(struct nfs_pageio_descriptor *desc) | |||
264 | return desc->pg_mirror_count > 1; | 264 | return desc->pg_mirror_count > 1; |
265 | } | 265 | } |
266 | 266 | ||
267 | static inline bool nfs_match_open_context(const struct nfs_open_context *ctx1, | ||
268 | const struct nfs_open_context *ctx2) | ||
269 | { | ||
270 | return ctx1->cred == ctx2->cred && ctx1->state == ctx2->state; | ||
271 | } | ||
272 | |||
267 | /* nfs2xdr.c */ | 273 | /* nfs2xdr.c */ |
268 | extern struct rpc_procinfo nfs_procedures[]; | 274 | extern struct rpc_procinfo nfs_procedures[]; |
269 | extern int nfs2_decode_dirent(struct xdr_stream *, | 275 | extern int nfs2_decode_dirent(struct xdr_stream *, |
diff --git a/fs/nfs/pagelist.c b/fs/nfs/pagelist.c index 452a011ba0d8..c3a78450a239 100644 --- a/fs/nfs/pagelist.c +++ b/fs/nfs/pagelist.c | |||
@@ -903,12 +903,6 @@ static void nfs_pageio_cleanup_mirroring(struct nfs_pageio_descriptor *pgio) | |||
903 | pgio->pg_mirrors_dynamic = NULL; | 903 | pgio->pg_mirrors_dynamic = NULL; |
904 | } | 904 | } |
905 | 905 | ||
906 | static bool nfs_match_open_context(const struct nfs_open_context *ctx1, | ||
907 | const struct nfs_open_context *ctx2) | ||
908 | { | ||
909 | return ctx1->cred == ctx2->cred && ctx1->state == ctx2->state; | ||
910 | } | ||
911 | |||
912 | static bool nfs_match_lock_context(const struct nfs_lock_context *l1, | 906 | static bool nfs_match_lock_context(const struct nfs_lock_context *l1, |
913 | const struct nfs_lock_context *l2) | 907 | const struct nfs_lock_context *l2) |
914 | { | 908 | { |
diff --git a/fs/nfs/write.c b/fs/nfs/write.c index 0aa8d6f23b4c..2c26e04d9396 100644 --- a/fs/nfs/write.c +++ b/fs/nfs/write.c | |||
@@ -1130,7 +1130,8 @@ int nfs_flush_incompatible(struct file *file, struct page *page) | |||
1130 | if (req == NULL) | 1130 | if (req == NULL) |
1131 | return 0; | 1131 | return 0; |
1132 | l_ctx = req->wb_lock_context; | 1132 | l_ctx = req->wb_lock_context; |
1133 | do_flush = req->wb_page != page || req->wb_context != ctx; | 1133 | do_flush = req->wb_page != page || |
1134 | !nfs_match_open_context(req->wb_context, ctx); | ||
1134 | /* for now, flush if more than 1 request in page_group */ | 1135 | /* for now, flush if more than 1 request in page_group */ |
1135 | do_flush |= req->wb_this_page != req; | 1136 | do_flush |= req->wb_this_page != req; |
1136 | if (l_ctx && flctx && | 1137 | if (l_ctx && flctx && |