aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorTrond Myklebust <Trond.Myklebust@netapp.com>2010-10-04 17:59:08 -0400
committerTrond Myklebust <Trond.Myklebust@netapp.com>2010-10-19 19:41:55 -0400
commitb0ed9dbc24f1fd912b2dd08b995153cafc1d5b1c (patch)
treebb86bfd7dabdab7b3df4f24e12b7f90bc045b201 /fs
parentbc4866b6e0b44f8ea0df22a16e5927714beb4983 (diff)
NFSv4: Fix open recovery
NFSv4 open recovery is currently broken: since we do not clear the state->flags states before attempting recovery, we end up with the 'can_open_cached()' function triggering. This again leads to no OPEN call being put on the wire. Reported-by: Sachin Prabhu <sprabhu@redhat.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com> Cc: stable@kernel.org
Diffstat (limited to 'fs')
-rw-r--r--fs/nfs/nfs4proc.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c
index aee1bcc1fcc9..7f25246bf38c 100644
--- a/fs/nfs/nfs4proc.c
+++ b/fs/nfs/nfs4proc.c
@@ -1118,6 +1118,7 @@ static int nfs4_open_recover(struct nfs4_opendata *opendata, struct nfs4_state *
1118 clear_bit(NFS_DELEGATED_STATE, &state->flags); 1118 clear_bit(NFS_DELEGATED_STATE, &state->flags);
1119 smp_rmb(); 1119 smp_rmb();
1120 if (state->n_rdwr != 0) { 1120 if (state->n_rdwr != 0) {
1121 clear_bit(NFS_O_RDWR_STATE, &state->flags);
1121 ret = nfs4_open_recover_helper(opendata, FMODE_READ|FMODE_WRITE, &newstate); 1122 ret = nfs4_open_recover_helper(opendata, FMODE_READ|FMODE_WRITE, &newstate);
1122 if (ret != 0) 1123 if (ret != 0)
1123 return ret; 1124 return ret;
@@ -1125,6 +1126,7 @@ static int nfs4_open_recover(struct nfs4_opendata *opendata, struct nfs4_state *
1125 return -ESTALE; 1126 return -ESTALE;
1126 } 1127 }
1127 if (state->n_wronly != 0) { 1128 if (state->n_wronly != 0) {
1129 clear_bit(NFS_O_WRONLY_STATE, &state->flags);
1128 ret = nfs4_open_recover_helper(opendata, FMODE_WRITE, &newstate); 1130 ret = nfs4_open_recover_helper(opendata, FMODE_WRITE, &newstate);
1129 if (ret != 0) 1131 if (ret != 0)
1130 return ret; 1132 return ret;
@@ -1132,6 +1134,7 @@ static int nfs4_open_recover(struct nfs4_opendata *opendata, struct nfs4_state *
1132 return -ESTALE; 1134 return -ESTALE;
1133 } 1135 }
1134 if (state->n_rdonly != 0) { 1136 if (state->n_rdonly != 0) {
1137 clear_bit(NFS_O_RDONLY_STATE, &state->flags);
1135 ret = nfs4_open_recover_helper(opendata, FMODE_READ, &newstate); 1138 ret = nfs4_open_recover_helper(opendata, FMODE_READ, &newstate);
1136 if (ret != 0) 1139 if (ret != 0)
1137 return ret; 1140 return ret;