aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfs/nfs4state.c
diff options
context:
space:
mode:
authorTrond Myklebust <Trond.Myklebust@netapp.com>2007-10-18 18:03:27 -0400
committerTrond Myklebust <Trond.Myklebust@netapp.com>2007-10-19 17:19:25 -0400
commita49c3c7736a2e77931dabc5bc4a83fb4b2da013e (patch)
tree1921900be210540ee53a4011c9e8f781deb0367e /fs/nfs/nfs4state.c
parent565277f63c616e11c37309a1e98c052d18ebbb55 (diff)
NFSv4: Ensure that we wait for the CLOSE request to complete
Otherwise, we do end up breaking close-to-open semantics. We also end up breaking some of the silly-rename tests in Connectathon on some setups. Please refer to the bug-report at http://bugzilla.linux-nfs.org/show_bug.cgi?id=150 Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'fs/nfs/nfs4state.c')
-rw-r--r--fs/nfs/nfs4state.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/fs/nfs/nfs4state.c b/fs/nfs/nfs4state.c
index bfb36261cecb..23a9a36556bf 100644
--- a/fs/nfs/nfs4state.c
+++ b/fs/nfs/nfs4state.c
@@ -425,7 +425,7 @@ void nfs4_put_open_state(struct nfs4_state *state)
425/* 425/*
426 * Close the current file. 426 * Close the current file.
427 */ 427 */
428void nfs4_close_state(struct path *path, struct nfs4_state *state, mode_t mode) 428static void __nfs4_close(struct path *path, struct nfs4_state *state, mode_t mode, int wait)
429{ 429{
430 struct nfs4_state_owner *owner = state->owner; 430 struct nfs4_state_owner *owner = state->owner;
431 int call_close = 0; 431 int call_close = 0;
@@ -466,7 +466,17 @@ void nfs4_close_state(struct path *path, struct nfs4_state *state, mode_t mode)
466 nfs4_put_open_state(state); 466 nfs4_put_open_state(state);
467 nfs4_put_state_owner(owner); 467 nfs4_put_state_owner(owner);
468 } else 468 } else
469 nfs4_do_close(path, state); 469 nfs4_do_close(path, state, wait);
470}
471
472void nfs4_close_state(struct path *path, struct nfs4_state *state, mode_t mode)
473{
474 __nfs4_close(path, state, mode, 0);
475}
476
477void nfs4_close_sync(struct path *path, struct nfs4_state *state, mode_t mode)
478{
479 __nfs4_close(path, state, mode, 1);
470} 480}
471 481
472/* 482/*