diff options
author | Sunil Mushran <sunil.mushran@oracle.com> | 2009-11-18 03:29:19 +0300 |
---|---|---|
committer | Joel Becker <joel.becker@oracle.com> | 2009-12-03 03:49:26 +0300 |
commit | f6656d26d17b2598f43cd41be088853fa2a03397 (patch) | |
tree | 5fdf95fdfab4302e28d9f00cf89ea4785ea9325c /fs/ocfs2/cluster/quorum.c | |
parent | 57b09bb5e492c37c1e4273fe4e435ffd1d2ddbe0 (diff) | |
download | linux-f6656d26d17b2598f43cd41be088853fa2a03397.tar.xz |
ocfs2/cluster: Make fence method configurable - v2
By default, o2cb fences the box by calling emergency_restart(). While this
scheme works well in production, it comes in the way during testing as it
does not let the tester take stack/core dumps for analysis.
This patch allows user to dynamically change the fence method to panic() by:
# echo "panic" > /sys/kernel/config/cluster/<clustername>/fence_method
Signed-off-by: Sunil Mushran <sunil.mushran@oracle.com>
Signed-off-by: Joel Becker <joel.becker@oracle.com>
Diffstat (limited to 'fs/ocfs2/cluster/quorum.c')
-rw-r--r-- | fs/ocfs2/cluster/quorum.c | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/fs/ocfs2/cluster/quorum.c b/fs/ocfs2/cluster/quorum.c index bbacf7da48a4..639024033fce 100644 --- a/fs/ocfs2/cluster/quorum.c +++ b/fs/ocfs2/cluster/quorum.c @@ -74,8 +74,20 @@ static void o2quo_fence_self(void) * threads can still schedule, etc, etc */ o2hb_stop_all_regions(); - printk("ocfs2 is very sorry to be fencing this system by restarting\n"); - emergency_restart(); + switch (o2nm_single_cluster->cl_fence_method) { + case O2NM_FENCE_PANIC: + panic("*** ocfs2 is very sorry to be fencing this system by " + "panicing ***\n"); + break; + default: + WARN_ON(o2nm_single_cluster->cl_fence_method >= + O2NM_FENCE_METHODS); + case O2NM_FENCE_RESET: + printk(KERN_ERR "*** ocfs2 is very sorry to be fencing this " + "system by restarting ***\n"); + emergency_restart(); + break; + }; } /* Indicate that a timeout occured on a hearbeat region write. The |