From: Wally Wang Date: Tue, 8 Sep 2015 16:56:48 +0000 (-0700) Subject: LU-6391 llite: Add client mount opt to ignore suppress_pings X-Git-Tag: 2.8.51~47 X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=commitdiff_plain;h=6707ed7038dd6208cc6e1e56d88fba8eec5e92cb LU-6391 llite: Add client mount opt to ignore suppress_pings When Lustre servers enable 'suppress_pings', all clients will stop pinging. However, some clients may not have external mechanism to notify Lustre servers for node death and therefore need to preserve the Lustre ping. This patch provides a mount option 'always_ping' so that the client will not stop pinging even if the server has enabled 'suppress_pings'. Signed-off-by: Wally Wang Change-Id: Ia7b45e8d2dbb53f02157ef2ab1d327d9483c2455 Reviewed-on: http://review.whamcloud.com/14127 Tested-by: Jenkins Reviewed-by: Li Wei Tested-by: Maloo Reviewed-by: Chris Horn Reviewed-by: Lai Siyao Reviewed-by: Oleg Drokin --- diff --git a/lustre/doc/mount.lustre.8 b/lustre/doc/mount.lustre.8 index 210c0c8..027dc4e 100644 --- a/lustre/doc/mount.lustre.8 +++ b/lustre/doc/mount.lustre.8 @@ -88,6 +88,9 @@ manual page. .BI noacl Disable Access Control List support. .TP +.BI always_ping +Force a client to keep pinging even if servers have enabled suppress_pings. +.TP .BI verbose Enable mount/umount console messages. .TP diff --git a/lustre/llite/llite_internal.h b/lustre/llite/llite_internal.h index ad5e417..7149327 100644 --- a/lustre/llite/llite_internal.h +++ b/lustre/llite/llite_internal.h @@ -441,6 +441,8 @@ enum stats_track_type { #define LL_SBI_USER_FID2PATH 0x40000 /* allow fid2path by unprivileged users */ #define LL_SBI_XATTR_CACHE 0x80000 /* support for xattr cache */ #define LL_SBI_NOROOTSQUASH 0x100000 /* do not apply root squash */ +#define LL_SBI_ALWAYS_PING 0x200000 /* always ping even if server + * suppress_pings */ #define LL_SBI_FLAGS { \ "nolck", \ @@ -464,6 +466,7 @@ enum stats_track_type { "user_fid2path",\ "xattr_cache", \ "norootsquash", \ + "always_ping", \ } #define RCE_HASHES 32 diff --git a/lustre/llite/llite_lib.c b/lustre/llite/llite_lib.c index 097394a..7ecc93c 100644 --- a/lustre/llite/llite_lib.c +++ b/lustre/llite/llite_lib.c @@ -252,6 +252,10 @@ static int client_common_fill_super(struct super_block *sb, char *md, char *dt, if (sbi->ll_flags & LL_SBI_RMT_CLIENT) data->ocd_connect_flags |= OBD_CONNECT_RMT_CLIENT_FORCE; + /* always ping even if server suppress_pings */ + if (sbi->ll_flags & LL_SBI_ALWAYS_PING) + data->ocd_connect_flags &= ~OBD_CONNECT_PINGLESS; + data->ocd_brw_size = MD_MAX_BRW_SIZE; err = obd_connect(NULL, &sbi->ll_md_exp, obd, &sbi->ll_sb_uuid, data, NULL); @@ -425,6 +429,10 @@ static int client_common_fill_super(struct super_block *sb, char *md, char *dt, if (sbi->ll_flags & LL_SBI_RMT_CLIENT) data->ocd_connect_flags |= OBD_CONNECT_RMT_CLIENT_FORCE; + /* always ping even if server suppress_pings */ + if (sbi->ll_flags & LL_SBI_ALWAYS_PING) + data->ocd_connect_flags &= ~OBD_CONNECT_PINGLESS; + CDEBUG(D_RPCTRACE, "ocd_connect_flags: "LPX64" ocd_version: %d " "ocd_grant: %d\n", data->ocd_connect_flags, data->ocd_version, data->ocd_grant); @@ -908,6 +916,11 @@ static int ll_options(char *options, int *flags) *flags &= ~tmp; goto next; } + tmp = ll_set_opt("always_ping", s1, LL_SBI_ALWAYS_PING); + if (tmp) { + *flags |= tmp; + goto next; + } LCONSOLE_ERROR_MSG(0x152, "Unknown option '%s', won't mount.\n", s1); RETURN(-EINVAL); @@ -2535,6 +2548,9 @@ int ll_show_options(struct seq_file *seq, struct vfsmount *vfs) if (sbi->ll_flags & LL_SBI_USER_FID2PATH) seq_puts(seq, ",user_fid2path"); + if (sbi->ll_flags & LL_SBI_ALWAYS_PING) + seq_puts(seq, ",always_ping"); + RETURN(0); }