Whamcloud - gitweb
Branch b1_4_mountconf
authornathan <nathan>
Tue, 7 Feb 2006 19:31:26 +0000 (19:31 +0000)
committernathan <nathan>
Tue, 7 Feb 2006 19:31:26 +0000 (19:31 +0000)
- b=9860 change COMMON_LR to an incompat flag
- add server name to config markers
- b=9861 add lov stripe info when MDT is added
- b=9861 add workaround for dealing with extents to mkfs.lustre

16 files changed:
lustre/include/linux/lustre_disk.h
lustre/include/linux/lustre_idl.h
lustre/mds/handler.c
lustre/mds/mds_fs.c
lustre/mds/mds_internal.h
lustre/mgc/mgc_internal.h [deleted file]
lustre/mgc/mgc_llog.c [deleted file]
lustre/mgc/mgc_lock.c [deleted file]
lustre/mgc/mgc_request.c
lustre/mgs/mgs_llog.c
lustre/obdclass/obd_config.c
lustre/obdclass/obd_mount.c
lustre/obdfilter/filter.c
lustre/obdfilter/filter_internal.h
lustre/utils/llog_reader.c
lustre/utils/mkfs_lustre.c

index 86de45f..e31b78a 100644 (file)
@@ -72,6 +72,8 @@ static inline char *mt_str(enum ldd_mount_type mt)
 #define MTI_NIDS_MAX 64
 #endif
 
+#define LDD_SIZE 4096
+
 #define LDD_INCOMPAT_SUPP 0
 #define LDD_ROCOMPAT_SUPP 0
 
@@ -94,16 +96,20 @@ struct lustre_disk_data {
         lnet_nid_t ldd_mgsnid[MTI_NIDS_MAX];  /* mgs nid list; lmd can 
                                                  override */
         lnet_nid_t ldd_failnid[MTI_NIDS_MAX]; /* server failover nids */
+        /* COMPAT_146 */
+        __u8       ldd_uuid[40];        /* server UUID */
+        /* end COMPAT_146 */
         char       ldd_mount_opts[2048]; /* target fs mount opts */
         
         /* Below here is required for writing mdt, ost,or client logs,
            and is ignored after that. */
-        __u8  ldd_uuid[40];        /* server UUID */
+        /* FIXME Everything should be removed from here and set via ioctls */
         int   ldd_stripe_sz;
         int   ldd_stripe_count;
         int   ldd_stripe_pattern;
         int   ldd_stripe_offset;
         int   ldd_timeout;               /* obd timeout */
+        __u8  ldd_padding[LDD_SIZE - 3296];
 };
         
 #define IS_MDT(data)   ((data)->ldd_flags & LDD_F_SV_TYPE_MDT)
@@ -153,16 +159,12 @@ struct lustre_mount_data {
                                          _device_ mount options) */
 };
 
-#define LMD_FLG_MNTCNF       0x0001  /* Mountconf compat */
 #define LMD_FLG_CLIENT       0x0002  /* Mounting a client only */
 #define LMD_FLG_RECOVER      0x0004  /* Allow recovery */
 #define LMD_FLG_NOSVC        0x0008  /* Only start MGS/MGC for servers, 
                                         no other services */
 
-/* 2nd half is for old clients */
-#define lmd_is_client(x) \
-        (((x)->lmd_flags & LMD_FLG_CLIENT) || \
-        (!((x)->lmd_flags & LMD_FLG_MNTCNF))) 
+#define lmd_is_client(x) ((x)->lmd_flags & LMD_FLG_CLIENT) 
 
 /****************** mkfs command *********************/
 
@@ -191,19 +193,21 @@ struct mkfs_opts {
 #error "Can't have LR_CLIENT_START < LR_SERVER_SIZE"
 #endif
 /* This limit is arbitrary (32k clients on x86), but it is convenient to use
- * 2^n * PAGE_SIZE * 8 for the number of bits that fit an order-n allocation. */#define LR_MAX_CLIENTS (PAGE_SIZE * 8)
+ * 2^n * PAGE_SIZE * 8 for the number of bits that fit an order-n allocation. */
 #define LR_MAX_CLIENTS (PAGE_SIZE * 8)
                                                                                 
+/* COMPAT_146 */
 #define OBD_COMPAT_OST          0x00000002 /* this is an OST (temporary) */
 #define OBD_COMPAT_MDT          0x00000004 /* this is an MDT (temporary) */
-#define OBD_COMPAT_COMMON_LR    0x00000008 /* common last_rvcd format */
-                                                                                
+/* end COMPAT_146 */
+
 #define OBD_ROCOMPAT_LOVOBJID   0x00000001 /* MDS handles LOV_OBJID file */
 #define OBD_ROCOMPAT_CROW       0x00000002 /* OST will CROW create objects */
                                                                                 
 #define OBD_INCOMPAT_GROUPS     0x00000001 /* OST handles group subdirs */
-#define OBD_INCOMPAT_OST        0x00000002 /* this is an OST (permanent) */
-#define OBD_INCOMPAT_MDT        0x00000004 /* this is an MDT (permanent) */
+#define OBD_INCOMPAT_OST        0x00000002 /* this is an OST */
+#define OBD_INCOMPAT_MDT        0x00000004 /* this is an MDT */
+#define OBD_INCOMPAT_COMMON_LR  0x00000008 /* common last_rvcd format */
 
 
 /* Data stored per server at the head of the last_rcvd file.  In le32 order.
@@ -230,7 +234,7 @@ struct lr_server_data {
 
 /* Data stored per client in the last_rcvd file.  In le32 order. */
 struct lsd_client_data {
-        __u8 lcd_uuid[40];      /* client UUID */
+        __u8  lcd_uuid[40];      /* client UUID */
         __u64 lcd_last_transno; /* last completed transaction ID */
         __u64 lcd_last_xid;     /* xid for the last transaction */
         __u32 lcd_last_result;  /* result from last RPC */
@@ -240,14 +244,9 @@ struct lsd_client_data {
         __u64 lcd_last_close_xid;     /* xid for the last transaction */
         __u32 lcd_last_close_result;  /* result from last RPC */
         __u32 lcd_last_close_data;    /* per-op data */
-        __u8 lcd_padding[LR_CLIENT_SIZE - 88];
+        __u8  lcd_padding[LR_CLIENT_SIZE - 88];
 };
 
-/*
-#define MDS_ROCOMPAT_LOVOBJID   0x00000001
-#define MDS_ROCOMPAT_SUPP       (MDS_ROCOMPAT_LOVOBJID)
-#define MDS_INCOMPAT_SUPP       (0)
-*/
 
 #ifdef __KERNEL__
 /****************** superblock additional info *********************/
index 71f19fe..26215f0 100644 (file)
@@ -1021,6 +1021,7 @@ struct cfg_marker {
         __u32             cm_step;  /* aka config version */
         __u32             cm_flags;
         __u32             cm_timestamp;
+        char              cm_svname[16];
         char              cm_comment[40];
 };
 
index 09386fd..34ee819 100644 (file)
@@ -1712,10 +1712,10 @@ int mds_update_server_data(struct obd_device *obd, int force_sync)
 
         lsd->lsd_last_transno = cpu_to_le64(mds->mds_last_transno);
 
-        if (!(lsd->lsd_feature_compat & cpu_to_le32(OBD_COMPAT_COMMON_LR))) {
+        if (!(lsd->lsd_feature_incompat & cpu_to_le32(OBD_INCOMPAT_COMMON_LR))){
                 /* Swap to the old mds_server_data format, in case
                    someone wants to revert to a pre-1.6 lustre */
-                CDEBUG(D_INFO, "writing old last_rcvd format\n");
+                CDEBUG(D_WARNING, "writing old last_rcvd format\n");
                 /* malloc new struct instead of swap in-place because 
                    we don't have a lock on the last_trasno or mount count -
                    someone may modify it while we're here, and we don't want
index 7d9aa91..4b358a8 100644 (file)
@@ -246,7 +246,7 @@ static int mds_init_server_data(struct obd_device *obd, struct file *file)
                 lsd->lsd_client_start = cpu_to_le32(LR_CLIENT_START);
                 lsd->lsd_client_size = cpu_to_le16(LR_CLIENT_SIZE);
                 lsd->lsd_feature_rocompat = cpu_to_le32(OBD_ROCOMPAT_LOVOBJID);
-                lsd->lsd_feature_compat = cpu_to_le32(OBD_COMPAT_COMMON_LR);
+                lsd->lsd_feature_incompat = cpu_to_le32(MDT_INCOMPAT_SUPP);
         } else {
                 rc = fsfilt_read_record(obd, file, lsd, sizeof(*lsd), &off);
                 if (rc) {
@@ -275,13 +275,13 @@ static int mds_init_server_data(struct obd_device *obd, struct file *file)
                 GOTO(err_msd, rc = -EINVAL);
         }
 
-        if (!(lsd->lsd_feature_compat & cpu_to_le32(OBD_COMPAT_COMMON_LR))) {
+        if (!(lsd->lsd_feature_incompat & cpu_to_le32(OBD_INCOMPAT_COMMON_LR))){
                 CDEBUG(D_WARNING, "using old last_rcvd format\n");
                 lsd->lsd_mount_count = lsd->lsd_last_transno;
                 lsd->lsd_last_transno = lsd->lsd_unused;
                 /* If we update the last_rcvd, we can never go back to 
                    an old install, so leave this in the old format for now.
-                lsd->lsd_feature_compat |= cpu_to_le32(LR_COMPAT_COMMON_LR);
+                lsd->lsd_feature_incompat |= cpu_to_le32(LR_INCOMPAT_COMMON_LR);
                 */
         }
 
index 9c04bd5..38eb3c9 100644 (file)
@@ -9,8 +9,7 @@
 #include <linux/lustre_disk.h>
 
 #define MDT_ROCOMPAT_SUPP       (OBD_ROCOMPAT_LOVOBJID)
-
-#define MDT_INCOMPAT_SUPP       (OBD_INCOMPAT_MDT)
+#define MDT_INCOMPAT_SUPP       (OBD_INCOMPAT_MDT | OBD_INCOMPAT_COMMON_LR)
 
 /* Data stored per client in the last_rcvd file.  In le32 order. */
 struct mds_client_data {
diff --git a/lustre/mgc/mgc_internal.h b/lustre/mgc/mgc_internal.h
deleted file mode 100644 (file)
index 26da3e0..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
-/* -*- mode: c; c-basic-offset: 8; indent-tabs-mode: nil; -*-
- * vim:expandtab:shiftwidth=8:tabstop=8:
- */
-
-#ifndef MGC_INTERNAL_H
-#define MGC_INTERNAL_H
-
-
-#endif
diff --git a/lustre/mgc/mgc_llog.c b/lustre/mgc/mgc_llog.c
deleted file mode 100644 (file)
index 16cac74..0000000
+++ /dev/null
@@ -1,49 +0,0 @@
-/* -*- mode: c; c-basic-offset: 8; indent-tabs-mode: nil; -*-
- * vim:expandtab:shiftwidth=8:tabstop=8:
- *
- *  Copyright (C) 2001-2005 Cluster File Systems, Inc.
- *   Author LinSongTao <lincent@clusterfs.com>
- *
- *   This file is part of Lustre, http://www.lustre.org
- *
- *   Lustre is free software; you can redistribute it and/or
- *   modify it under the terms of version 2 of the GNU General Public
- *   License as published by the Free Software Foundation.
- *
- *   Lustre is distributed in the hope that it will be useful,
- *   but WITHOUT ANY WARRANTY; without even the implied warranty of
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *   GNU General Public License for more details.
- *
- *   You should have received a copy of the GNU General Public License
- *   along with Lustre; if not, write to the Free Software
- *   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- *
- *  For testing and management it is treated as an obd_device,
- *  although * it does not export a full OBD method table (the
- *  requests are coming * in over the wire, so object target modules
- *  do not have a full * method table.)
- */
-#ifndef EXPORT_SYMTAB
-# define EXPORT_SYMTAB
-#endif
-#define DEBUG_SUBSYSTEM S_MGC
-
-#ifdef __KERNEL__
-# include <linux/module.h>
-# include <linux/pagemap.h>
-# include <linux/miscdevice.h>
-# include <linux/init.h>
-#else
-# include <liblustre.h>
-#endif
-
-#include <linux/obd_class.h>
-#include <linux/lustre_dlm.h>
-#include <linux/lustre_log.h>
-#include <linux/lustre_fsfilt.h>
-#include <linux/lustre_disk.h>
-
-#include "mgc_internal.h"
-
-                                    //REMOVE ME
diff --git a/lustre/mgc/mgc_lock.c b/lustre/mgc/mgc_lock.c
deleted file mode 100644 (file)
index 69e7ceb..0000000
+++ /dev/null
@@ -1,48 +0,0 @@
-/* -*- mode: c; c-basic-offset: 8; indent-tabs-mode: nil; -*-
- * vim:expandtab:shiftwidth=8:tabstop=8:
- *
- *  Copyright (C) 2001-2005 Cluster File Systems, Inc.
- *   Author LinSongTao <lincent@clusterfs.com>
- *
- *   This file is part of Lustre, http://www.lustre.org
- *
- *   Lustre is free software; you can redistribute it and/or
- *   modify it under the terms of version 2 of the GNU General Public
- *   License as published by the Free Software Foundation.
- *
- *   Lustre is distributed in the hope that it will be useful,
- *   but WITHOUT ANY WARRANTY; without even the implied warranty of
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *   GNU General Public License for more details.
- *
- *   You should have received a copy of the GNU General Public License
- *   along with Lustre; if not, write to the Free Software
- *   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- *
- *  For testing and management it is treated as an obd_device,
- *  although * it does not export a full OBD method table (the
- *  requests are coming * in over the wire, so object target modules
- *  do not have a full * method table.)
- */
-#ifndef EXPORT_SYMTAB
-# define EXPORT_SYMTAB
-#endif
-#define DEBUG_SUBSYSTEM S_MGC
-
-#ifdef __KERNEL__
-# include <linux/module.h>
-# include <linux/pagemap.h>
-# include <linux/miscdevice.h>
-# include <linux/init.h>
-#else
-# include <liblustre.h>
-#endif
-
-#include <linux/obd_class.h>
-#include <linux/lustre_dlm.h>
-#include <linux/lustre_log.h>
-#include <linux/lustre_fsfilt.h>
-#include <linux/lustre_disk.h>
-
-#include "mgc_internal.h"
-
index a491614..471cec8 100644 (file)
@@ -47,8 +47,6 @@
 #include <linux/lustre_disk.h>
 #include <linux/lustre_mgs.h>
 
-#include "mgc_internal.h"
-
 
 int mgc_logname2resid(char *logname, struct ldlm_res_id *res_id)
 {
index 9fcce2e..a7359d7 100644 (file)
@@ -512,7 +512,8 @@ static inline int record_mount_opt(struct obd_device *obd,
 }                
 
 static int record_marker(struct obd_device *obd, struct llog_handle *llh,
-                         struct fs_db *db, __u32 flags, char *comment)
+                         struct fs_db *db, __u32 flags,
+                         char *svname, char *comment)
 {
         struct cfg_marker marker;
         struct lustre_cfg_bufs bufs;
@@ -525,6 +526,7 @@ static int record_marker(struct obd_device *obd, struct llog_handle *llh,
                 db->fd_gen++;
         marker.cm_step = db->fd_gen;
         marker.cm_flags = flags;
+        strncpy(marker.cm_svname, svname, sizeof(marker.cm_svname)); 
         strncpy(marker.cm_comment, comment, sizeof(marker.cm_comment)); 
         lustre_cfg_bufs_reset(&bufs, NULL);
         lustre_cfg_bufs_set(&bufs, 1, &marker, sizeof(marker));
@@ -536,6 +538,14 @@ static int record_marker(struct obd_device *obd, struct llog_handle *llh,
         return rc;
 }
 
+static inline int record_param(struct obd_device *obd, struct llog_handle *llh,
+                               char *devname, 
+                               char *s1, char *s2, char *s3, char *s4)
+{
+        return record_base(obd,llh,devname,0,LCFG_PARAM,s1,s2,s3,s4);
+}
+
+
 static int record_start_log(struct obd_device *obd, 
                             struct llog_handle **llh, char *name)
 {
@@ -639,10 +649,10 @@ static int mgs_write_log_lov(struct obd_device *obd, struct fs_db *db,
         /* This should always be the first entry in a log.
         rc = mgs_clear_log(obd, logname); */
         rc = record_start_log(obd, &llh, logname);
-        rc = record_marker(obd, llh, db, CM_START, "lov setup"); 
+        rc = record_marker(obd, llh, db, CM_START, mti->mti_svname,"lov setup"); 
         rc = record_attach(obd, llh, lovname, "lov", uuid);
         rc = record_lov_setup(obd, llh, lovname, lovdesc);
-        rc = record_marker(obd, llh, db, CM_END, "lov setup"); 
+        rc = record_marker(obd, llh, db, CM_END, mti->mti_svname, "lov setup"); 
         rc = record_end_log(obd, &llh);
         
         OBD_FREE(lovdesc, sizeof(*lovdesc));
@@ -654,6 +664,7 @@ static int mgs_write_log_mdt(struct obd_device *obd, struct fs_db *db,
 {
         struct llog_handle *llh = NULL;
         char *cliname, *mdcname, *lovname, *nodeuuid, *mdcuuid;
+        char *s1, *s2, *s3, *s4, *s5;
         lnet_nid_t nid;
         int rc, i, first_log = 0;
         ENTRY;
@@ -692,14 +703,35 @@ static int mgs_write_log_mdt(struct obd_device *obd, struct fs_db *db,
         setup /dev/loop2 ldiskfs mdsA errors=remount-ro,user_xattr
         */
         rc = record_start_log(obd, &llh, mti->mti_svname);
-        rc = record_marker(obd, llh, db, CM_START, "add mdt"); 
+        rc = record_marker(obd, llh, db, CM_START, mti->mti_svname, "add mdt"); 
+
+        /* FIXME this should just be added via a MGS ioctl 
+           OBD_IOC_LOV_SETSTRIPE / LL_IOC_LOV_SETSTRIPE */
+        if (!first_log) {
+                /* Fix lov settings if they were set by something other
+                   than the MDT */
+                OBD_ALLOC(s1, 256);
+                if (s1) {
+                        s2 = sprintf(s1, "default_stripe_size="LPU64,
+                                     mti->mti_stripe_size) + s1 + 1;
+                        s3 = sprintf(s2, "default_stripe_count=%u",
+                                     mti->mti_stripe_count) + s2 + 1;
+                        s4 = sprintf(s3, "default_stripe_offset="LPU64,
+                                     mti->mti_stripe_offset) + s3 + 1;
+                        s5 =  sprintf(s4, "default_stripe_pattern=%u",
+                                mti->mti_stripe_pattern) + s4 + 1;
+                        LASSERT(s5 - s1 < 256);
+                        record_param(obd, llh, lovname, s1, s2, s3, s4);
+                }
+        }
+        
         rc = record_mount_opt(obd, llh, mti->mti_svname, lovname, 0);
         rc = record_attach(obd, llh, mti->mti_svname, LUSTRE_MDS_NAME, 
                            mti->mti_uuid);
-        rc = record_setup(obd,llh,mti->mti_svname,
-                          "dev"/*ignored*/,"type"/*ignored*/,
+        rc = record_setup(obd, llh, mti->mti_svname,
+                          "dev"/*ignored*/, "type"/*ignored*/,
                           mti->mti_svname, 0/*options*/);
-        rc = record_marker(obd, llh, db, CM_END, "add mdt"); 
+        rc = record_marker(obd, llh, db, CM_END, mti->mti_svname, "add mdt"); 
         rc = record_end_log(obd, &llh);
 
         if (mti->mti_flags & LDD_F_UPGRADE14) 
@@ -727,7 +759,12 @@ static int mgs_write_log_mdt(struct obd_device *obd, struct fs_db *db,
         #14 L mount_option 0:  1:client  2:lov1  3:MDC_uml1_mdsA_MNT_client
         */
         rc = record_start_log(obd, &llh, cliname);
-        rc = record_marker(obd, llh, db, CM_START, "add mdc"); 
+        rc = record_marker(obd, llh, db, CM_START, mti->mti_svname, "add mdc");
+        if (!first_log && s1) {
+                /* Record new lov settings */
+                record_param(obd, llh, lovname, s1, s2, s3, s4);
+                OBD_FREE(s1, 256);
+        }
         for (i = 0; i < mti->mti_nid_count; i++) {
                 CDEBUG(D_MGS, "add nid %s\n", libcfs_nid2str(mti->mti_nids[i]));
                 rc = record_add_uuid(obd, llh, mti->mti_nids[i], nodeuuid);
@@ -741,7 +778,7 @@ static int mgs_write_log_mdt(struct obd_device *obd, struct fs_db *db,
                 rc = record_add_conn(obd, llh, mdcname, libcfs_nid2str(nid));
         }
         rc = record_mount_opt(obd, llh, cliname, lovname, mdcname);
-        rc = record_marker(obd, llh, db, CM_END, "add mdc"); 
+        rc = record_marker(obd, llh, db, CM_END, mti->mti_svname, "add mdc"); 
         rc = record_end_log(obd, &llh);
 
         name_destroy(mdcuuid);
@@ -786,7 +823,7 @@ static int mgs_write_log_osc(struct obd_device *obd, struct fs_db *db,
         #08 L lov_modify_tgts add 0:lov1  1:ost1_UUID  2(index):0  3(gen):1
         */
         rc = record_start_log(obd, &llh, logname);
-        rc = record_marker(obd, llh, db, CM_START, "add osc"); 
+        rc = record_marker(obd, llh, db, CM_START, mti->mti_svname, "add osc"); 
         for (i = 0; i < mti->mti_nid_count; i++) {
                 CDEBUG(D_MGS, "add nid %s\n", libcfs_nid2str(mti->mti_nids[i]));
                 rc = record_add_uuid(obd, llh, mti->mti_nids[i], nodeuuid);
@@ -801,7 +838,7 @@ static int mgs_write_log_osc(struct obd_device *obd, struct fs_db *db,
         }
         snprintf(index, sizeof(index), "%d", mti->mti_stripe_index);
         rc = record_lov_add(obd, llh, lovname, mti->mti_uuid, index, "1");
-        rc = record_marker(obd, llh, db, CM_END, "add osc"); 
+        rc = record_marker(obd, llh, db, CM_END, mti->mti_svname, "add osc"); 
         rc = record_end_log(obd, &llh);
         
         name_destroy(lovuuid);
@@ -843,7 +880,7 @@ static int mgs_write_log_ost(struct obd_device *obd, struct fs_db *db,
         setup /dev/loop2 ldiskfs f|n errors=remount-ro,user_xattr
         */
         rc = record_start_log(obd, &llh, mti->mti_svname);
-        rc = record_marker(obd, llh, db, CM_START, "add ost"); 
+        rc = record_marker(obd, llh, db, CM_START, mti->mti_svname, "add ost"); 
         if (*mti->mti_uuid == 0) 
                 snprintf(mti->mti_uuid, sizeof(mti->mti_uuid),
                          "%s_UUID", mti->mti_svname);
@@ -852,7 +889,7 @@ static int mgs_write_log_ost(struct obd_device *obd, struct fs_db *db,
         rc = record_setup(obd,llh,mti->mti_svname,
                           "dev"/*ignored*/,"type"/*ignored*/,
                           "f", 0/*options*/);
-        rc = record_marker(obd, llh, db, CM_END, "add ost"); 
+        rc = record_marker(obd, llh, db, CM_END, mti->mti_svname, "add ost"); 
         rc = record_end_log(obd, &llh);
         
         if (mti->mti_flags & LDD_F_UPGRADE14) 
@@ -1008,12 +1045,15 @@ int mgs_upgrade_logs_14(struct obd_device *obd, struct fs_db *db,
 
                 /* Mark the client log so we know we updated (fd_gen == 1) */
                 rc = record_start_log(obd, &llh, cliname);
-                rc = record_marker(obd, llh, db, CM_START, "upgrade from 1.4"); 
+                rc = record_marker(obd, llh, db, CM_START, "client",
+                                   "upgrade from 1.4"); 
                 /* FIXME find the old lovname and mdcname */
                 /* old: mount_option 0:  1:client  2:lov1  3:MDC_uml1_mdsA_MNT_client */
                 /* new: mount_option 0:  1:lustre-client  2:lustre-clilov  3:lustre-MDT0000-mdc */
-                rc = record_mount_opt(obd, llh, cliname, "lov1", "MDC_uml1_mdsA_MNT_client");
-                rc = record_marker(obd, llh, db, CM_END, "upgrade to 1.6"); 
+                rc = record_mount_opt(obd, llh, cliname, "lov1", 
+                                      "MDC_uml1_mdsA_MNT_client");
+                rc = record_marker(obd, llh, db, CM_END, "client", 
+                                   "upgrade to 1.6"); 
                 rc = record_end_log(obd, &llh);
                 name_destroy(cliname);
         }
index c8c039d..bbf0c49 100644 (file)
@@ -654,8 +654,8 @@ int class_process_config(struct lustre_cfg *lcfg)
         case LCFG_MARKER: {
                 struct cfg_marker *marker;
                 marker = lustre_cfg_buf(lcfg, 1);
-                CDEBUG(D_IOCTL, "marker %d (%#x) %s\n", marker->cm_step,
-                       marker->cm_flags, marker->cm_comment);
+                CDEBUG(D_IOCTL, "marker %d (%#x) %.16s %s\n", marker->cm_step,
+                       marker->cm_flags, marker->cm_svname, marker->cm_comment);
                 GOTO(out, err = 0);
         }
         }
index 97c4374..ac0bcd5 100644 (file)
@@ -300,6 +300,7 @@ static int ldd_parse(struct lvfs_run_ctxt *mount_ctxt,
         rc = 0;
 
         if (ldd->ldd_magic != LDD_MAGIC) {
+                /* FIXME add swabbing support */
                 CERROR("Bad magic in %s: %x!=%x\n", MOUNT_DATA_FILE, 
                        ldd->ldd_magic, LDD_MAGIC);
                 GOTO(out_close, rc = -EINVAL);
@@ -1462,7 +1463,7 @@ static int lmd_parse(char *options, struct lustre_mount_data *lmd)
         lmd->lmd_magic = LMD_MAGIC;
 
         /* default flags */
-        lmd->lmd_flags |= LMD_FLG_MNTCNF | LMD_FLG_RECOVER;
+        lmd->lmd_flags |= LMD_FLG_RECOVER;
 
         s1 = options;
         while(*s1) {
@@ -1504,7 +1505,7 @@ static int lmd_parse(char *options, struct lustre_mount_data *lmd)
         }
 
         s1 = devname;
-        /* Get MGS nids if client mount */
+        /* Get MGS nids if client mount:  uml1@tcp:uml2@tcp:/fsname-client */
         while ((s2 = strchr(s1, ':'))) {
                 lnet_nid_t nid;
                 *s2 = 0;
index 9442f87..cef34da 100644 (file)
@@ -399,7 +399,7 @@ static int filter_init_server_data(struct obd_device *obd, struct file * filp)
                 fsd->lsd_client_size = cpu_to_le16(LR_CLIENT_SIZE);
                 fsd->lsd_subdir_count = cpu_to_le16(FILTER_SUBDIR_COUNT);
                 filter->fo_subdir_count = FILTER_SUBDIR_COUNT;
-                fsd->lsd_feature_compat = cpu_to_le32(OBD_COMPAT_COMMON_LR);
+                fsd->lsd_feature_incompat = cpu_to_le32(FILTER_INCOMPAT_SUPP);
         } else {
                 rc = fsfilt_read_record(obd, filp, fsd, sizeof(*fsd), &off);
                 if (rc) {
index 29059e8..b55e889 100644 (file)
@@ -25,7 +25,8 @@
 
 #define FILTER_RECOVERY_TIMEOUT (obd_timeout * 5 * HZ / 2) /* *waves hands* */
 
-#define FILTER_INCOMPAT_SUPP   (OBD_INCOMPAT_GROUPS)
+#define FILTER_INCOMPAT_SUPP (OBD_INCOMPAT_GROUPS | OBD_INCOMPAT_OST | \
+                              OBD_INCOMPAT_COMMON_LR)
 
 #define FILTER_GRANT_CHUNK (2ULL * PTLRPC_MAX_BRW_SIZE)
 #define GRANT_FOR_LLOG(obd) 16
index 7141919..116d01a 100644 (file)
@@ -326,8 +326,8 @@ void print_lustre_cfg(struct lustre_cfg *lcfg)
         }
         case(LCFG_MARKER):{
                 struct cfg_marker *marker = lustre_cfg_buf(lcfg, 1);
-                printf("marker %d (flags=%#x) '%s'", marker->cm_step,
-                       marker->cm_flags, marker->cm_comment);
+                printf("marker %d (flags=%#x) %.16s '%s'", marker->cm_step,
+                       marker->cm_flags, marker->cm_svname, marker->cm_comment);
                 break;
         }
         default:
index 879f4bc..dda6968 100644 (file)
@@ -285,10 +285,12 @@ static int file_in_dev(char *file_name, char *dev_name)
         FILE *fp;
         char debugfs_cmd[256];
         unsigned int inode_num;
+        int i;
 
         /* Construct debugfs command line. */
         memset(debugfs_cmd, 0, sizeof(debugfs_cmd));
-        sprintf(debugfs_cmd, "debugfs -c -R 'stat %s' %s 2>&1 | egrep Inode",
+        sprintf(debugfs_cmd,
+                "debugfs -c -R 'stat %s' %s 2>&1 | egrep '(Inode|unsupported)'",
                 file_name, dev_name);
 
         fp = popen(debugfs_cmd, "r");
@@ -301,7 +303,16 @@ static int file_in_dev(char *file_name, char *dev_name)
                 pclose(fp);
                 return 1;
         }
-
+        i = fread(debugfs_cmd, 1, sizeof(debugfs_cmd), fp);
+        if (i) {
+                /* Filesystem has unsupported feature */
+                vprint("%.*s", i, debugfs_cmd);
+                /* in all likelihood, the "unsupported feature" is
+                  'extents', which older debugfs does not understand.  
+                  Use e2fsprogs-1.38-cfs1 or later, available from 
+                  ftp://ftp.lustre.org/pub/lustre/other/e2fsprogs/ */
+                return -1;
+        }
         pclose(fp);
         return 0;
 }
@@ -309,15 +320,18 @@ static int file_in_dev(char *file_name, char *dev_name)
 /* Check whether the device has already been fomatted by mkfs.lustre */
 static int is_lustre_target(struct mkfs_opts *mop)
 {
+        int rc;
         /* Check whether there exist MOUNT_DATA_FILE,
            LAST_RCVD or CATLIST in the device. */
         vprint("checking for existing Lustre data\n");
         
-        if (file_in_dev(MOUNT_DATA_FILE, mop->mo_device)
-            || file_in_dev(LAST_RCVD, mop->mo_device)
-            || file_in_dev(CATLIST, mop->mo_device)) { 
+        if ((rc = file_in_dev(MOUNT_DATA_FILE, mop->mo_device))
+            || (rc = file_in_dev(LAST_RCVD, mop->mo_device))
+            || (rc = file_in_dev(CATLIST, mop->mo_device))) { 
                 vprint("found Lustre data\n");
-                return 1; 
+                /* in the -1 case, 'extents' means this really IS a lustre
+                   target */
+                return rc; 
         }
 
         return 0; /* The device is not a lustre target. */