Whamcloud - gitweb
LU-13142 lod: cleanup layout checking
[fs/lustre-release.git] / lustre / utils / lfs.c
index da2477e..9a4a194 100644 (file)
@@ -3255,6 +3255,12 @@ static int lfs_setstripe_internal(int argc, char **argv,
                        migration_block = true;
                        break;
                case 'C':
                        migration_block = true;
                        break;
                case 'C':
+                       if (lsa.lsa_pattern == LLAPI_LAYOUT_MDT) {
+                               fprintf(stderr,
+                                       "%s %s: -C|--overstripe-count incompatible with DoM layout\n",
+                                       progname, argv[0]);
+                               goto usage_error;
+                       }
                        lsa.lsa_pattern = LLAPI_LAYOUT_OVERSTRIPING;
                        /* fall through */
                case 'c':
                        lsa.lsa_pattern = LLAPI_LAYOUT_OVERSTRIPING;
                        /* fall through */
                case 'c':
@@ -3480,6 +3486,12 @@ static int lfs_setstripe_internal(int argc, char **argv,
                                fprintf(stderr, "warning: '--ost-list' is "
                                        "deprecated, use '--ost' instead\n");
 #endif
                                fprintf(stderr, "warning: '--ost-list' is "
                                        "deprecated, use '--ost' instead\n");
 #endif
+                       if (lsa.lsa_pattern == LLAPI_LAYOUT_MDT) {
+                               fprintf(stderr,
+                                       "%s %s: -o|--ost incompatible with DoM layout\n",
+                                       progname, argv[0]);
+                               goto usage_error;
+                       }
                        /* -o allows overstriping, and must note it because
                         * parse_targets is shared with MDT striping, which
                         * does not allow duplicates
                        /* -o allows overstriping, and must note it because
                         * parse_targets is shared with MDT striping, which
                         * does not allow duplicates