]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob - releases/2.6.36.2/nfsv4-fix-open-recovery.patch
Remove duplicated commits
[thirdparty/kernel/stable-queue.git] / releases / 2.6.36.2 / nfsv4-fix-open-recovery.patch
1 From b0ed9dbc24f1fd912b2dd08b995153cafc1d5b1c Mon Sep 17 00:00:00 2001
2 From: Trond Myklebust <Trond.Myklebust@netapp.com>
3 Date: Mon, 4 Oct 2010 17:59:08 -0400
4 Subject: NFSv4: Fix open recovery
5
6 From: Trond Myklebust <Trond.Myklebust@netapp.com>
7
8 commit b0ed9dbc24f1fd912b2dd08b995153cafc1d5b1c upstream.
9
10 NFSv4 open recovery is currently broken: since we do not clear the
11 state->flags states before attempting recovery, we end up with the
12 'can_open_cached()' function triggering. This again leads to no OPEN call
13 being put on the wire.
14
15 Reported-by: Sachin Prabhu <sprabhu@redhat.com>
16 Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
17 Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
18
19 ---
20 fs/nfs/nfs4proc.c | 3 +++
21 1 file changed, 3 insertions(+)
22
23 --- a/fs/nfs/nfs4proc.c
24 +++ b/fs/nfs/nfs4proc.c
25 @@ -1117,6 +1117,7 @@ static int nfs4_open_recover(struct nfs4
26 clear_bit(NFS_DELEGATED_STATE, &state->flags);
27 smp_rmb();
28 if (state->n_rdwr != 0) {
29 + clear_bit(NFS_O_RDWR_STATE, &state->flags);
30 ret = nfs4_open_recover_helper(opendata, FMODE_READ|FMODE_WRITE, &newstate);
31 if (ret != 0)
32 return ret;
33 @@ -1124,6 +1125,7 @@ static int nfs4_open_recover(struct nfs4
34 return -ESTALE;
35 }
36 if (state->n_wronly != 0) {
37 + clear_bit(NFS_O_WRONLY_STATE, &state->flags);
38 ret = nfs4_open_recover_helper(opendata, FMODE_WRITE, &newstate);
39 if (ret != 0)
40 return ret;
41 @@ -1131,6 +1133,7 @@ static int nfs4_open_recover(struct nfs4
42 return -ESTALE;
43 }
44 if (state->n_rdonly != 0) {
45 + clear_bit(NFS_O_RDONLY_STATE, &state->flags);
46 ret = nfs4_open_recover_helper(opendata, FMODE_READ, &newstate);
47 if (ret != 0)
48 return ret;