]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob - releases/2.6.36.2/nfsv4-don-t-call-nfs4_state_mark_reclaim_reboot-from-error-handlers.patch
fixes for 4.19
[thirdparty/kernel/stable-queue.git] / releases / 2.6.36.2 / nfsv4-don-t-call-nfs4_state_mark_reclaim_reboot-from-error-handlers.patch
1 From ae1007d37e00144b72906a4bdc47d517ae91bcc1 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: Don't call nfs4_state_mark_reclaim_reboot() from error handlers
5
6 From: Trond Myklebust <Trond.Myklebust@netapp.com>
7
8 commit ae1007d37e00144b72906a4bdc47d517ae91bcc1 upstream.
9
10 In the case of a server reboot, the state recovery thread starts by calling
11 nfs4_state_end_reclaim_reboot() in order to avoid edge conditions when
12 the server reboots while the client is in the middle of recovery.
13
14 However, if the client has already marked the nfs4_state as requiring
15 reboot recovery, then the above behaviour will cause the recovery thread to
16 treat the open as if it was part of such an edge condition: the open will
17 be recovered as if it was part of a lease expiration (and all the locks
18 will be lost).
19 Fix is to remove the call to nfs4_state_mark_reclaim_reboot from
20 nfs4_async_handle_error(), and nfs4_handle_exception(). Instead we leave it
21 to the recovery thread to do this for us.
22
23 Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
24 Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
25
26 ---
27 fs/nfs/nfs4proc.c | 6 ------
28 1 file changed, 6 deletions(-)
29
30 --- a/fs/nfs/nfs4proc.c
31 +++ b/fs/nfs/nfs4proc.c
32 @@ -255,9 +255,6 @@ static int nfs4_handle_exception(const s
33 nfs4_state_mark_reclaim_nograce(clp, state);
34 goto do_state_recovery;
35 case -NFS4ERR_STALE_STATEID:
36 - if (state == NULL)
37 - break;
38 - nfs4_state_mark_reclaim_reboot(clp, state);
39 case -NFS4ERR_STALE_CLIENTID:
40 case -NFS4ERR_EXPIRED:
41 goto do_state_recovery;
42 @@ -3490,9 +3487,6 @@ nfs4_async_handle_error(struct rpc_task
43 nfs4_state_mark_reclaim_nograce(clp, state);
44 goto do_state_recovery;
45 case -NFS4ERR_STALE_STATEID:
46 - if (state == NULL)
47 - break;
48 - nfs4_state_mark_reclaim_reboot(clp, state);
49 case -NFS4ERR_STALE_CLIENTID:
50 case -NFS4ERR_EXPIRED:
51 goto do_state_recovery;