]> git.baikalelectronics.ru Git - kernel.git/commit
nfsd: Reset cb_status in nfsd4_cb_prepare() at retrying
authorKinglong Mee <kinglongmee@gmail.com>
Tue, 2 Jun 2015 10:59:19 +0000 (18:59 +0800)
committerJ. Bruce Fields <bfields@redhat.com>
Thu, 4 Jun 2015 20:43:39 +0000 (16:43 -0400)
commitebe046c813c91d9bbacab869e12ae75611df1fdc
tree836c4bdd07589865f8200b851994b75cada9fbc7
parent9a5026dc775a881292224d3394634089b2484e31
nfsd: Reset cb_status in nfsd4_cb_prepare() at retrying

nfsd enters a infinite loop and prints message every 10 seconds:

May 31 18:33:52 test-server kernel: Error sending entire callback!
May 31 18:34:01 test-server kernel: Error sending entire callback!

This is caused by a cb_layoutreturn getting error -10008
(NFS4ERR_DELAY), the client crashing, and then nfsd entering the
infinite loop:

  bc_sendto --> call_timeout --> nfsd4_cb_done --> nfsd4_cb_layout_done
  with error -10008 --> rpc_delay(task, HZ/100) --> bc_sendto ...

Reproduced using xfstests 074 with nfs client's kdump on,
CONFIG_DEFAULT_HUNG_TASK_TIMEOUT set, and client's blkmapd down:

1. nfs client's write operation will get the layout of file,
   and then send getdeviceinfo,
2. but layout segment is not recorded by client because blkmapd is down,
3. client writes data by sending WRITE to server,
4. nfs server recalls the layout of the file before WRITE,
5. network error causes the client reset the session and return NFS4ERR_DELAY,
6. so client's WRITE operation is waiting the reply.
   If the task hangs 120s, the client will crash.
7. so that, the next bc_sendto will fail with TIMEOUT,
   and cb_status is NFS4ERR_DELAY.

Signed-off-by: Kinglong Mee <kinglongmee@gmail.com>
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
fs/nfsd/nfs4callback.c