Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

NFS4: Apply delay_retrans to async operations

The setting of delay_retrans is applied to synchronous RPC operations
because the retransmit count is stored in same struct nfs4_exception
that is passed each time an error is checked. However, for asynchronous
operations (READ, WRITE, LOCKU, CLOSE, DELEGRETURN), a new struct
nfs4_exception is made on the stack each time the task callback is
invoked. This means that the retransmit count is always zero and thus
delay_retrans never takes effect.

Apply delay_retrans to these operations by tracking and updating their
retransmit count.

Change-Id: Ieb33e046c2b277cb979caa3faca7f52faf0568c9
Signed-off-by: Joshua Watt <jpewhacker@gmail.com>
Reviewed-by: Benjamin Coddington <bcodding@redhat.com>
Signed-off-by: Anna Schumaker <anna.schumaker@oracle.com>

authored by

Joshua Watt and committed by
Anna Schumaker
7a84394f 8db4a1d1

+14
+13
fs/nfs/nfs4proc.c
··· 3636 3636 } lr; 3637 3637 struct nfs_fattr fattr; 3638 3638 unsigned long timestamp; 3639 + unsigned short retrans; 3639 3640 }; 3640 3641 3641 3642 static void nfs4_free_closedata(void *data) ··· 3665 3664 .state = state, 3666 3665 .inode = calldata->inode, 3667 3666 .stateid = &calldata->arg.stateid, 3667 + .retrans = calldata->retrans, 3668 3668 }; 3669 3669 3670 3670 if (!nfs4_sequence_done(task, &calldata->res.seq_res)) ··· 3713 3711 default: 3714 3712 task->tk_status = nfs4_async_handle_exception(task, 3715 3713 server, task->tk_status, &exception); 3714 + calldata->retrans = exception.retrans; 3716 3715 if (exception.retry) 3717 3716 goto out_restart; 3718 3717 } ··· 5596 5593 .inode = hdr->inode, 5597 5594 .state = hdr->args.context->state, 5598 5595 .stateid = &hdr->args.stateid, 5596 + .retrans = hdr->retrans, 5599 5597 }; 5600 5598 task->tk_status = nfs4_async_handle_exception(task, 5601 5599 server, task->tk_status, &exception); 5600 + hdr->retrans = exception.retrans; 5602 5601 if (exception.retry) { 5603 5602 rpc_restart_call_prepare(task); 5604 5603 return -EAGAIN; ··· 5714 5709 .inode = hdr->inode, 5715 5710 .state = hdr->args.context->state, 5716 5711 .stateid = &hdr->args.stateid, 5712 + .retrans = hdr->retrans, 5717 5713 }; 5718 5714 task->tk_status = nfs4_async_handle_exception(task, 5719 5715 NFS_SERVER(inode), task->tk_status, 5720 5716 &exception); 5717 + hdr->retrans = exception.retrans; 5721 5718 if (exception.retry) { 5722 5719 rpc_restart_call_prepare(task); 5723 5720 return -EAGAIN; ··· 6733 6726 struct nfs_fh fh; 6734 6727 nfs4_stateid stateid; 6735 6728 unsigned long timestamp; 6729 + unsigned short retrans; 6736 6730 struct { 6737 6731 struct nfs4_layoutreturn_args arg; 6738 6732 struct nfs4_layoutreturn_res res; ··· 6754 6746 .inode = data->inode, 6755 6747 .stateid = &data->stateid, 6756 6748 .task_is_privileged = data->args.seq_args.sa_privileged, 6749 + .retrans = data->retrans, 6757 6750 }; 6758 6751 6759 6752 if (!nfs4_sequence_done(task, &data->res.seq_res)) ··· 6826 6817 task->tk_status = nfs4_async_handle_exception(task, 6827 6818 data->res.server, task->tk_status, 6828 6819 &exception); 6820 + data->retrans = exception.retrans; 6829 6821 if (exception.retry) 6830 6822 goto out_restart; 6831 6823 } ··· 7103 7093 struct file_lock fl; 7104 7094 struct nfs_server *server; 7105 7095 unsigned long timestamp; 7096 + unsigned short retrans; 7106 7097 }; 7107 7098 7108 7099 static struct nfs4_unlockdata *nfs4_alloc_unlockdata(struct file_lock *fl, ··· 7158 7147 struct nfs4_exception exception = { 7159 7148 .inode = calldata->lsp->ls_state->inode, 7160 7149 .stateid = &calldata->arg.stateid, 7150 + .retrans = calldata->retrans, 7161 7151 }; 7162 7152 7163 7153 if (!nfs4_sequence_done(task, &calldata->res.seq_res)) ··· 7192 7180 task->tk_status = nfs4_async_handle_exception(task, 7193 7181 calldata->server, task->tk_status, 7194 7182 &exception); 7183 + calldata->retrans = exception.retrans; 7195 7184 if (exception.retry) 7196 7185 rpc_restart_call_prepare(task); 7197 7186 }
+1
include/linux/nfs_xdr.h
··· 1659 1659 void *netfs; 1660 1660 #endif 1661 1661 1662 + unsigned short retrans; 1662 1663 int pnfs_error; 1663 1664 int error; /* merge with pnfs_error */ 1664 1665 unsigned int good_bytes; /* boundary of good data */