From: Christopher J. Morrone Date: Mon, 27 Feb 2012 00:06:29 +0000 (-0800) Subject: LU-1095 debug: Standardize, suppress mount/umount messages X-Git-Tag: 2.2.52~36 X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=commitdiff_plain;h=4286ba6bc22412381f351b3c4cdb1dd3519fc1bd LU-1095 debug: Standardize, suppress mount/umount messages Standardize mount/umount console message to include profile name, and optionally suppress them with the 'quiet' mount option. We have been using private namespaces for testing and mounting then umounting the FS as needed for each job. In this context these messages end up causing alot of syslog noise. Signed-off-by: Christopher J. Morrone Change-Id: I7514f6016c337a358e5e31146644810dff292d02 Reviewed-on: http://review.whamcloud.com/2199 Tested-by: Hudson Tested-by: Maloo Reviewed-by: Yu Jian Reviewed-by: Oleg Drokin --- diff --git a/lustre/doc/mount.lustre.8 b/lustre/doc/mount.lustre.8 index b2514fb..969a450 100644 --- a/lustre/doc/mount.lustre.8 +++ b/lustre/doc/mount.lustre.8 @@ -87,6 +87,12 @@ manual page. .TP .BI noacl Disable Access Control List support. +.TP +.BI verbose +Enable mount/umount console messages. +.TP +.BI noverbose +Disable mount/umount console messages. .PP In addition to the standard mount options and backing disk type (e.g. ext3) options listed in diff --git a/lustre/llite/llite_internal.h b/lustre/llite/llite_internal.h index eb54145..ab3cdf1 100644 --- a/lustre/llite/llite_internal.h +++ b/lustre/llite/llite_internal.h @@ -379,6 +379,7 @@ enum stats_track_type { #define LL_SBI_32BIT_API 0x2000 /* generate 32 bit inodes. */ #define LL_SBI_64BIT_HASH 0x4000 /* support 64-bits dir hash/offset */ #define LL_SBI_AGL_ENABLED 0x8000 /* enable agl */ +#define LL_SBI_VERBOSE 0x10000 /* verbose mount/umount */ /* default value for ll_sb_info->contention_time */ #define SBI_DEFAULT_CONTENTION_SECONDS 60 diff --git a/lustre/llite/llite_lib.c b/lustre/llite/llite_lib.c index 13ba855..8bc0c5e 100644 --- a/lustre/llite/llite_lib.c +++ b/lustre/llite/llite_lib.c @@ -122,6 +122,7 @@ static struct ll_sb_info *ll_init_sbi(void) cfs_list_add_tail(&sbi->ll_list, &ll_super_blocks); cfs_spin_unlock(&ll_sb_lock); + sbi->ll_flags |= LL_SBI_VERBOSE; #ifdef ENABLE_CHECKSUM sbi->ll_flags |= LL_SBI_CHECKSUM; #endif @@ -824,7 +825,16 @@ static int ll_options(char *options, int *flags) *flags |= tmp; goto next; } - + tmp = ll_set_opt("verbose", s1, LL_SBI_VERBOSE); + if (tmp) { + *flags |= tmp; + goto next; + } + tmp = ll_set_opt("noverbose", s1, LL_SBI_VERBOSE); + if (tmp) { + *flags &= ~tmp; + goto next; + } LCONSOLE_ERROR_MSG(0x152, "Unknown option '%s', won't mount.\n", s1); RETURN(-EINVAL); @@ -997,8 +1007,8 @@ out_free: OBD_FREE(dt, strlen(lprof->lp_dt) + instlen + 2); if (err) ll_put_super(sb); - else - LCONSOLE_WARN("Client %s has started\n", profilenm); + else if (sbi->ll_flags & LL_SBI_VERBOSE) + LCONSOLE_WARN("Mounted %s\n", profilenm); OBD_FREE_PTR(cfg); RETURN(err); @@ -1050,6 +1060,9 @@ void ll_put_super(struct super_block *sb) class_manual_cleanup(obd); } + if (sbi->ll_flags & LL_SBI_VERBOSE) + LCONSOLE_WARN("Unmounted %s\n", profilenm ? profilenm : ""); + if (profilenm) class_del_profile(profilenm); @@ -1065,8 +1078,6 @@ void ll_put_super(struct super_block *sb) cl_env_cache_purge(~0); - LCONSOLE_WARN("client %p umount complete\n", cfg.cfg_instance); - cfs_module_put(THIS_MODULE); EXIT; @@ -2046,6 +2057,7 @@ void ll_umount_begin(struct super_block *sb) int ll_remount_fs(struct super_block *sb, int *flags, char *data) { struct ll_sb_info *sbi = ll_s2sbi(sb); + char *profilenm = get_profile_name(sb); int err; __u32 read_only; @@ -2056,8 +2068,9 @@ int ll_remount_fs(struct super_block *sb, int *flags, char *data) KEY_READ_ONLY, sizeof(read_only), &read_only, NULL); if (err) { - CERROR("Failed to change the read-only flag during " - "remount: %d\n", err); + LCONSOLE_WARN("Failed to remount %s %s (%d)\n", + profilenm, read_only ? + "read-only" : "read-write", err); return err; } @@ -2065,6 +2078,10 @@ int ll_remount_fs(struct super_block *sb, int *flags, char *data) sb->s_flags |= MS_RDONLY; else sb->s_flags &= ~MS_RDONLY; + + if (sbi->ll_flags & LL_SBI_VERBOSE) + LCONSOLE_WARN("Remounted %s %s\n", profilenm, + read_only ? "read-only" : "read-write"); } return 0; }