Message ID | 20190301191153.104498-1-trond.myklebust@hammerspace.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | [1/2] NFSv4.1: Reinitialise sequence results before retransmitting a request | expand |
Hi, [This is an automated email] This commit has been processed because it contains a -stable tag. The stable tag indicates that it's relevant for the following trees: all The bot has tested the following trees: v4.20.13, v4.19.26, v4.14.104, v4.9.161, v4.4.176, v3.18.136. v4.20.13: Build OK! v4.19.26: Build OK! v4.14.104: Build OK! v4.9.161: Failed to apply! Possible dependencies: 172d9de15a0d ("NFS: Change nfs4_get_session() to take an nfs_client structure") 3be0f80b5fe9 ("NFSv4.1: Fix up replays of interrupted requests") 42e1cca7e91e ("NFS: Change nfs4_setup_sequence() to take an nfs_client structure") 6de7e12f53a1 ("NFS: Use nfs4_setup_sequence() everywhere") 7981c8a65914 ("NFS: Create a single nfs4_setup_sequence() function") efc6f4aa742d ("NFS: Move nfs4_get_session() into nfs4_session.h") v4.4.176: Failed to apply! Possible dependencies: 172d9de15a0d ("NFS: Change nfs4_get_session() to take an nfs_client structure") 3be0f80b5fe9 ("NFSv4.1: Fix up replays of interrupted requests") 42e1cca7e91e ("NFS: Change nfs4_setup_sequence() to take an nfs_client structure") 5f83d86cf531 ("NFSv4.x: Fix wraparound issues when validing the callback sequence id") 68d264cf02b0 ("NFS42: handle layoutstats stateid error") 6de7e12f53a1 ("NFS: Use nfs4_setup_sequence() everywhere") 80f9642724af ("NFSv4.x: Enforce the ca_maxresponsesize_cached on the back channel") 810d82e68301 ("NFSv4.x: Allow multiple callbacks in flight") 9a0fe86745b8 ("pNFS: Handle NFS4ERR_OLD_STATEID correctly in LAYOUTSTAT calls") efc6f4aa742d ("NFS: Move nfs4_get_session() into nfs4_session.h") f74a834a0e1b ("NFSv4.x: CB_SEQUENCE should return NFS4ERR_DELAY if still executing") v3.18.136: Failed to apply! Possible dependencies: 193e3aa2ccfb ("nfs41: introduce NFS_LAYOUT_RETURN_BEFORE_CLOSE") 3be0f80b5fe9 ("NFSv4.1: Fix up replays of interrupted requests") 4579d6b897ee ("nfs41: pass iomode through layoutreturn args") 6de7e12f53a1 ("NFS: Use nfs4_setup_sequence() everywhere") 9bf87482ddc6 ("nfs41: serialize first layoutget of a file") aa8a45ee974d ("nfs41: wait for LAYOUTRETURN before retrying LAYOUTGET") abcb7bfc9fde ("pNFS/flexfiles: add layoutstats tracking") c829013dca33 ("nfs41: add NFS_LAYOUT_RETRY_LAYOUTGET to layout header flags") ce6ab4f238cb ("nfs41: don't use a layout if it is marked for returning") d67ae825a59d ("pnfs/flexfiles: Add the FlexFile Layout Driver") e736a5b98c7a ("nfs41: clear NFS_LAYOUT_RETURN if layoutreturn is sent or failed to send") f40eb5d044e2 ("nfs41: make a helper function to send layoutreturn") How should we proceed with this patch? -- Thanks, Sasha
diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c index 77c6e2d3f3fc..5f8517d1a0a5 100644 --- a/fs/nfs/nfs4proc.c +++ b/fs/nfs/nfs4proc.c @@ -945,6 +945,13 @@ EXPORT_SYMBOL_GPL(nfs4_sequence_done); #endif /* !CONFIG_NFS_V4_1 */ +static void nfs41_sequence_res_init(struct nfs4_sequence_res *res) +{ + res->sr_timestamp = jiffies; + res->sr_status_flags = 0; + res->sr_status = 1; +} + static void nfs4_sequence_attach_slot(struct nfs4_sequence_args *args, struct nfs4_sequence_res *res, @@ -956,10 +963,6 @@ void nfs4_sequence_attach_slot(struct nfs4_sequence_args *args, args->sa_slot = slot; res->sr_slot = slot; - res->sr_timestamp = jiffies; - res->sr_status_flags = 0; - res->sr_status = 1; - } int nfs4_setup_sequence(struct nfs_client *client, @@ -998,6 +1001,7 @@ int nfs4_setup_sequence(struct nfs_client *client, trace_nfs4_setup_sequence(session, args); out_start: + nfs41_sequence_res_init(res); rpc_call_start(task); return 0;
If we have to retransmit a request, we should ensure that we reinitialise the sequence results structure, since in the event of a signal we need to treat the request as if it had not been sent. Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com> Cc: stable@vger.kernel.org --- fs/nfs/nfs4proc.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-)