Whamcloud - gitweb
LU-3768 tunefs: make tunefs.lustre work correctly for MGS 53/7353/4
authorEmoly Liu <emoly.liu@intel.com>
Sun, 2 Jun 2013 07:35:18 +0000 (15:35 +0800)
committerOleg Drokin <oleg.drokin@intel.com>
Tue, 3 Sep 2013 05:55:58 +0000 (05:55 +0000)
Since LDD_F_NEED_INDEX flag is unset for a stand-alone MGS during
mkfs.lustre, when running tunefs.lustre on that MGS, it always says
"'----index' only valid for MDT,OST". To fix that, this patch is to
- print that error message only for mkfs.lustre
- fix the typo '----index' in the error message.

Signed-off-by: Liu Ying <emoly.liu@intel.com>
Change-Id: I4fa00dc554521c03671602ff9b2bbaca02c6a581
Reviewed-on: http://review.whamcloud.com/7353
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Bobi Jam <bobijam@gmail.com>
Reviewed-by: Niu Yawei <yawei.niu@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
lustre/utils/mkfs_lustre.c

index fa36098..646a767 100644 (file)
@@ -626,11 +626,13 @@ int main(int argc, char *const argv[])
 
        /* Stand alone MGS doesn't need a index */
        if (!IS_MDT(ldd) && IS_MGS(ldd)) {
 
        /* Stand alone MGS doesn't need a index */
        if (!IS_MDT(ldd) && IS_MGS(ldd)) {
+#ifndef TUNEFS /* mkfs.lustre */
                /* But if --index was specified flag an error */
                if (!(mop.mo_ldd.ldd_flags & LDD_F_NEED_INDEX)) {
                /* But if --index was specified flag an error */
                if (!(mop.mo_ldd.ldd_flags & LDD_F_NEED_INDEX)) {
-                       badopt("--index", "MDT,OST");
+                       badopt("index", "MDT,OST");
                        goto out;
                }
                        goto out;
                }
+#endif
                mop.mo_ldd.ldd_flags &= ~LDD_F_NEED_INDEX;
        }
 
                mop.mo_ldd.ldd_flags &= ~LDD_F_NEED_INDEX;
        }