From a9650116ab7ccea22a5a8852e7894f28d17edabd Mon Sep 17 00:00:00 2001 From: Andreas Dilger Date: Tue, 23 Nov 2010 14:17:32 -0700 Subject: [PATCH] b=14836 Fail if "lfs setstripe" has positional parameters Since 1.6.1 it has been possible to use named options -c/-i/-s to specify the layout parameters for "lfs setstripe". Since 1.8.0 the use of the old positional parameters has generated a warning that they are deprecated. The code was set to fail building at 2.1.0.0, so this needs to be resolved before moving to a release build. Instead of simply removing the conditional code, change "lfs setstripe" to return an error if positional parameters are used. That would avoid the confusion of creating files with names of the old {size}, {offset}, and {count} parameters, instead of returning a meaningful error to the user. --- lustre/utils/lfs.c | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/lustre/utils/lfs.c b/lustre/utils/lfs.c index 996fbe8..20f2d60 100644 --- a/lustre/utils/lfs.c +++ b/lustre/utils/lfs.c @@ -292,18 +292,12 @@ static int lfs_setstripe(int argc, char **argv) st_offset = -1; st_count = 0; -#if LUSTRE_VERSION < OBD_OCD_VERSION(2,1,0,0) +#if LUSTRE_VERSION < OBD_OCD_VERSION(2,4,50,0) if (argc == 5 && argv[1][0] != '-' && isnumber(argv[2]) && isnumber(argv[3]) && isnumber(argv[4])) { - fprintf(stderr, "warning: deprecated usage of setstripe " + fprintf(stderr, "error: obsolete usage of setstripe " "positional parameters. Use -c, -i, -s instead.\n"); - /* for compatibility with the existing positional parameter - * usage */ - fname = argv[1]; - stripe_size_arg = argv[2]; - stripe_off_arg = argv[3]; - stripe_count_arg = argv[4]; - optind = 4; + return CMD_HELP; } else #else #warning "remove obsolete positional parameter code" -- 1.8.3.1