[Ocfs2-tools-devel] [PATCH 1/2] fsck.ocfs2: Print bold warning message when run with -F

Joel Becker Joel.Becker at oracle.com
Fri Jul 24 10:46:55 PDT 2009


On Thu, Jul 23, 2009 at 05:03:22PM -0700, Sunil Mushran wrote:
> Print a bold warning if the user runs fsck.ocfs2 with cluster check
> disabled. The man page has also been updated to highlight the risk
> when running with this check disabled.
> 
> Signed-off-by: Sunil Mushran <sunil.mushran at oracle.com>
> ---
>  fsck.ocfs2/fsck.c          |   16 +++++++++++++---
>  fsck.ocfs2/fsck.ocfs2.8.in |   11 ++++++-----
>  2 files changed, 19 insertions(+), 8 deletions(-)
> 
> diff --git a/fsck.ocfs2/fsck.c b/fsck.ocfs2/fsck.c
> index f8c8a33..3931756 100644
> --- a/fsck.ocfs2/fsck.c
> +++ b/fsck.ocfs2/fsck.c
> @@ -742,9 +742,6 @@ int main(int argc, char **argv)
>  		}
>  	}
>  
> -	if (ost->ost_skip_o2cb)
> -		printf("-F given, *not* checking with the cluster DLM.\n");
> -
>  	if (blksize % OCFS2_MIN_BLOCKSIZE) {
>  		fprintf(stderr, "Invalid blocksize: %"PRId64"\n", blksize);
>  		fsck_mask |= FSCK_USAGE;
> @@ -761,6 +758,19 @@ int main(int argc, char **argv)
>  
>  	filename = argv[optind];
>  
> +	if (ost->ost_skip_o2cb) {
> +		fprintf(stdout, "DANGER: YOU HAVE DISABLED THE CLUSTER CHECK. "
> +			"CONTINUE ONLY IF YOU ARE ABSOLUTELY\nSURE THAT NO "
> +			"OTHER NODE IS USING THIS FILE SYSTEM. IF UNSURE, "
> +			"ENTER NO.\n");

	We need a better term than "using this filesystem".  Remember,
the folks that used -F thought "using" meant software was running.  They
thought a mounted filesystem with no open files was "unused".  Perhaps
something like "ABSOLUTELY SURE THAT NO NODE HAS THIS FILESYSTEM MOUNTED
OR IS OTHERWISE ACCESSING IT".
	We also don't seem to check is_mounted in fsck.  Shouldn't we?

Joel

-- 

	Pitchers and catchers report.

Joel Becker
Principal Software Developer
Oracle
E-mail: joel.becker at oracle.com
Phone: (650) 506-8127



More information about the Ocfs2-tools-devel mailing list