* [PATCH 1/2] nfsd: add fault injection for CB_PATH_DOWN
@ 2012-05-24 19:42 Weston Andros Adamson
2012-06-05 20:19 ` J. Bruce Fields
0 siblings, 1 reply; 4+ messages in thread
From: Weston Andros Adamson @ 2012-05-24 19:42 UTC (permalink / raw)
To: bfields; +Cc: linux-nfs, Weston Andros Adamson
This fault injection hook causes all SEQUENCE operation replies to have the
SEQ4_STATUS_CB_PATH_DOWN flag set until the client calls BIND_CONN_TO_SESSION
or creates a new session.
Signed-off-by: Weston Andros Adamson <dros@netapp.com>
---
fs/nfsd/fault_inject.c | 4 ++++
fs/nfsd/fault_inject.h | 2 ++
fs/nfsd/nfs4state.c | 20 ++++++++++++++++++++
3 files changed, 26 insertions(+), 0 deletions(-)
diff --git a/fs/nfsd/fault_inject.c b/fs/nfsd/fault_inject.c
index e6c3815..ab81144 100644
--- a/fs/nfsd/fault_inject.c
+++ b/fs/nfsd/fault_inject.c
@@ -38,6 +38,10 @@ static struct nfsd_fault_inject_op inject_ops[] = {
.file = "recall_delegations",
.func = nfsd_recall_delegations,
},
+ {
+ .file = "kill_backchannel",
+ .func = nfsd_kill_backchannel,
+ },
};
static long int NUM_INJECT_OPS = sizeof(inject_ops) / sizeof(struct nfsd_fault_inject_op);
diff --git a/fs/nfsd/fault_inject.h b/fs/nfsd/fault_inject.h
index 90bd057..b058e03 100644
--- a/fs/nfsd/fault_inject.h
+++ b/fs/nfsd/fault_inject.h
@@ -15,6 +15,7 @@ void nfsd_forget_locks(u64);
void nfsd_forget_openowners(u64);
void nfsd_forget_delegations(u64);
void nfsd_recall_delegations(u64);
+void nfsd_kill_backchannel(u64);
#else /* CONFIG_NFSD_FAULT_INJECTION */
static inline int nfsd_fault_inject_init(void) { return 0; }
static inline void nfsd_fault_inject_cleanup(void) {}
@@ -23,6 +24,7 @@ static inline void nfsd_forget_locks(u64 num) {}
static inline void nfsd_forget_openowners(u64 num) {}
static inline void nfsd_forget_delegations(u64 num) {}
static inline void nfsd_recall_delegations(u64 num) {}
+static inline void nfsd_kill_backchannel(u64 num) {}
#endif /* CONFIG_NFSD_FAULT_INJECTION */
#endif /* LINUX_NFSD_FAULT_INJECT_H */
diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c
index 21266c7..9afc902 100644
--- a/fs/nfsd/nfs4state.c
+++ b/fs/nfsd/nfs4state.c
@@ -4737,6 +4737,26 @@ void nfsd_recall_delegations(u64 num)
printk(KERN_INFO "NFSD: Recalled %d delegations", count);
}
+/*
+ * Force SEQUENCE operations to have SEQ4_STATUS_CB_PATH_DOWN flag set
+ * until backchannel is reestablished by BIND_CONN_TO_SESSION or
+ * DESTROY_SESSION/CREATE_SESSION with SP4_NONE.
+ *
+ * The argument 'num' is ignored, any value will trigger the fault on
+ * all clients.
+ */
+void nfsd_kill_backchannel(u64 num)
+{
+ struct nfs4_client *clp, *next;
+
+ nfs4_lock_state();
+ list_for_each_entry_safe(clp, next, &client_lru, cl_lru) {
+ clp->cl_cb_state = NFSD4_CB_DOWN;
+ }
+ nfs4_unlock_state();
+
+ printk(KERN_INFO "NFSD: killed backchannel");
+}
#endif /* CONFIG_NFSD_FAULT_INJECTION */
/* initialization to perform at module load time: */
--
1.7.4.4
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH 1/2] nfsd: add fault injection for CB_PATH_DOWN
2012-05-24 19:42 Weston Andros Adamson
@ 2012-06-05 20:19 ` J. Bruce Fields
2012-06-05 20:47 ` Adamson, Dros
0 siblings, 1 reply; 4+ messages in thread
From: J. Bruce Fields @ 2012-06-05 20:19 UTC (permalink / raw)
To: Weston Andros Adamson; +Cc: linux-nfs
On Thu, May 24, 2012 at 03:42:16PM -0400, Weston Andros Adamson wrote:
> This fault injection hook causes all SEQUENCE operation replies to have the
> SEQ4_STATUS_CB_PATH_DOWN flag set until the client calls BIND_CONN_TO_SESSION
> or creates a new session.
I'm not necessarily opposed, but why do you need this? In what
"real-life" situation could a client see the CB_PATH_DOWN flag
unexpectedly set?
--b.
>
> Signed-off-by: Weston Andros Adamson <dros@netapp.com>
> ---
> fs/nfsd/fault_inject.c | 4 ++++
> fs/nfsd/fault_inject.h | 2 ++
> fs/nfsd/nfs4state.c | 20 ++++++++++++++++++++
> 3 files changed, 26 insertions(+), 0 deletions(-)
>
> diff --git a/fs/nfsd/fault_inject.c b/fs/nfsd/fault_inject.c
> index e6c3815..ab81144 100644
> --- a/fs/nfsd/fault_inject.c
> +++ b/fs/nfsd/fault_inject.c
> @@ -38,6 +38,10 @@ static struct nfsd_fault_inject_op inject_ops[] = {
> .file = "recall_delegations",
> .func = nfsd_recall_delegations,
> },
> + {
> + .file = "kill_backchannel",
> + .func = nfsd_kill_backchannel,
> + },
> };
>
> static long int NUM_INJECT_OPS = sizeof(inject_ops) / sizeof(struct nfsd_fault_inject_op);
> diff --git a/fs/nfsd/fault_inject.h b/fs/nfsd/fault_inject.h
> index 90bd057..b058e03 100644
> --- a/fs/nfsd/fault_inject.h
> +++ b/fs/nfsd/fault_inject.h
> @@ -15,6 +15,7 @@ void nfsd_forget_locks(u64);
> void nfsd_forget_openowners(u64);
> void nfsd_forget_delegations(u64);
> void nfsd_recall_delegations(u64);
> +void nfsd_kill_backchannel(u64);
> #else /* CONFIG_NFSD_FAULT_INJECTION */
> static inline int nfsd_fault_inject_init(void) { return 0; }
> static inline void nfsd_fault_inject_cleanup(void) {}
> @@ -23,6 +24,7 @@ static inline void nfsd_forget_locks(u64 num) {}
> static inline void nfsd_forget_openowners(u64 num) {}
> static inline void nfsd_forget_delegations(u64 num) {}
> static inline void nfsd_recall_delegations(u64 num) {}
> +static inline void nfsd_kill_backchannel(u64 num) {}
> #endif /* CONFIG_NFSD_FAULT_INJECTION */
>
> #endif /* LINUX_NFSD_FAULT_INJECT_H */
> diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c
> index 21266c7..9afc902 100644
> --- a/fs/nfsd/nfs4state.c
> +++ b/fs/nfsd/nfs4state.c
> @@ -4737,6 +4737,26 @@ void nfsd_recall_delegations(u64 num)
> printk(KERN_INFO "NFSD: Recalled %d delegations", count);
> }
>
> +/*
> + * Force SEQUENCE operations to have SEQ4_STATUS_CB_PATH_DOWN flag set
> + * until backchannel is reestablished by BIND_CONN_TO_SESSION or
> + * DESTROY_SESSION/CREATE_SESSION with SP4_NONE.
> + *
> + * The argument 'num' is ignored, any value will trigger the fault on
> + * all clients.
> + */
> +void nfsd_kill_backchannel(u64 num)
> +{
> + struct nfs4_client *clp, *next;
> +
> + nfs4_lock_state();
> + list_for_each_entry_safe(clp, next, &client_lru, cl_lru) {
> + clp->cl_cb_state = NFSD4_CB_DOWN;
> + }
> + nfs4_unlock_state();
> +
> + printk(KERN_INFO "NFSD: killed backchannel");
> +}
> #endif /* CONFIG_NFSD_FAULT_INJECTION */
>
> /* initialization to perform at module load time: */
> --
> 1.7.4.4
>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH 1/2] nfsd: add fault injection for CB_PATH_DOWN
2012-06-05 20:19 ` J. Bruce Fields
@ 2012-06-05 20:47 ` Adamson, Dros
0 siblings, 0 replies; 4+ messages in thread
From: Adamson, Dros @ 2012-06-05 20:47 UTC (permalink / raw)
To: J. Bruce Fields; +Cc: <linux-nfs@vger.kernel.org>
[-- Attachment #1: Type: text/plain, Size: 3892 bytes --]
On Jun 5, 2012, at 4:19 PM, J. Bruce Fields wrote:
> On Thu, May 24, 2012 at 03:42:16PM -0400, Weston Andros Adamson wrote:
>> This fault injection hook causes all SEQUENCE operation replies to have the
>> SEQ4_STATUS_CB_PATH_DOWN flag set until the client calls BIND_CONN_TO_SESSION
>> or creates a new session.
>
> I'm not necessarily opposed, but why do you need this? In what
> "real-life" situation could a client see the CB_PATH_DOWN flag
> unexpectedly set?
We need this to test the client's handling of the SEQ4_STATUS_CB_PATH_DOWN flag :)
Real world scenarios are hard to come by at this point since the linux client always uses one TCP connection (for both fore and back channel), but handling this error condition should be useful for future work (session trunking, if the client ever uses a different connection for back channel).
Also, if nfsd's probe callback fails for whatever reason the CB_PATH_DOWN flag will be set.
Really, we want the client to be able to handle this error condition and this was the easiest way to test it.
-dros
>
> --b.
>
>>
>> Signed-off-by: Weston Andros Adamson <dros@netapp.com>
>> ---
>> fs/nfsd/fault_inject.c | 4 ++++
>> fs/nfsd/fault_inject.h | 2 ++
>> fs/nfsd/nfs4state.c | 20 ++++++++++++++++++++
>> 3 files changed, 26 insertions(+), 0 deletions(-)
>>
>> diff --git a/fs/nfsd/fault_inject.c b/fs/nfsd/fault_inject.c
>> index e6c3815..ab81144 100644
>> --- a/fs/nfsd/fault_inject.c
>> +++ b/fs/nfsd/fault_inject.c
>> @@ -38,6 +38,10 @@ static struct nfsd_fault_inject_op inject_ops[] = {
>> .file = "recall_delegations",
>> .func = nfsd_recall_delegations,
>> },
>> + {
>> + .file = "kill_backchannel",
>> + .func = nfsd_kill_backchannel,
>> + },
>> };
>>
>> static long int NUM_INJECT_OPS = sizeof(inject_ops) / sizeof(struct nfsd_fault_inject_op);
>> diff --git a/fs/nfsd/fault_inject.h b/fs/nfsd/fault_inject.h
>> index 90bd057..b058e03 100644
>> --- a/fs/nfsd/fault_inject.h
>> +++ b/fs/nfsd/fault_inject.h
>> @@ -15,6 +15,7 @@ void nfsd_forget_locks(u64);
>> void nfsd_forget_openowners(u64);
>> void nfsd_forget_delegations(u64);
>> void nfsd_recall_delegations(u64);
>> +void nfsd_kill_backchannel(u64);
>> #else /* CONFIG_NFSD_FAULT_INJECTION */
>> static inline int nfsd_fault_inject_init(void) { return 0; }
>> static inline void nfsd_fault_inject_cleanup(void) {}
>> @@ -23,6 +24,7 @@ static inline void nfsd_forget_locks(u64 num) {}
>> static inline void nfsd_forget_openowners(u64 num) {}
>> static inline void nfsd_forget_delegations(u64 num) {}
>> static inline void nfsd_recall_delegations(u64 num) {}
>> +static inline void nfsd_kill_backchannel(u64 num) {}
>> #endif /* CONFIG_NFSD_FAULT_INJECTION */
>>
>> #endif /* LINUX_NFSD_FAULT_INJECT_H */
>> diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c
>> index 21266c7..9afc902 100644
>> --- a/fs/nfsd/nfs4state.c
>> +++ b/fs/nfsd/nfs4state.c
>> @@ -4737,6 +4737,26 @@ void nfsd_recall_delegations(u64 num)
>> printk(KERN_INFO "NFSD: Recalled %d delegations", count);
>> }
>>
>> +/*
>> + * Force SEQUENCE operations to have SEQ4_STATUS_CB_PATH_DOWN flag set
>> + * until backchannel is reestablished by BIND_CONN_TO_SESSION or
>> + * DESTROY_SESSION/CREATE_SESSION with SP4_NONE.
>> + *
>> + * The argument 'num' is ignored, any value will trigger the fault on
>> + * all clients.
>> + */
>> +void nfsd_kill_backchannel(u64 num)
>> +{
>> + struct nfs4_client *clp, *next;
>> +
>> + nfs4_lock_state();
>> + list_for_each_entry_safe(clp, next, &client_lru, cl_lru) {
>> + clp->cl_cb_state = NFSD4_CB_DOWN;
>> + }
>> + nfs4_unlock_state();
>> +
>> + printk(KERN_INFO "NFSD: killed backchannel");
>> +}
>> #endif /* CONFIG_NFSD_FAULT_INJECTION */
>>
>> /* initialization to perform at module load time: */
>> --
>> 1.7.4.4
>>
[-- Attachment #2: smime.p7s --]
[-- Type: application/pkcs7-signature, Size: 1374 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH 1/2] nfsd: add fault injection for CB_PATH_DOWN
[not found] <547166089.245.1338929508008.JavaMail.root@thunderbeast.private.linuxbox.com>
@ 2012-06-05 20:56 ` Matt W. Benjamin
0 siblings, 0 replies; 4+ messages in thread
From: Matt W. Benjamin @ 2012-06-05 20:56 UTC (permalink / raw)
To: Dros Adamson; +Cc: linux-nfs, J. Bruce Fields
That rings a bell...
----- "Dros Adamson" <Weston.Adamson@netapp.com> wrote:
>
> but handling this error condition should be useful for
> future work (session trunking, if the client ever uses a different
> connection for back channel).
--
Matt Benjamin
The Linux Box
206 South Fifth Ave. Suite 150
Ann Arbor, MI 48104
http://linuxbox.com
tel. 734-761-4689
fax. 734-769-8938
cel. 734-216-5309
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2012-06-05 21:02 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <547166089.245.1338929508008.JavaMail.root@thunderbeast.private.linuxbox.com>
2012-06-05 20:56 ` [PATCH 1/2] nfsd: add fault injection for CB_PATH_DOWN Matt W. Benjamin
2012-05-24 19:42 Weston Andros Adamson
2012-06-05 20:19 ` J. Bruce Fields
2012-06-05 20:47 ` Adamson, Dros
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).