From: nathan Date: Thu, 6 Jul 2006 18:27:20 +0000 (+0000) Subject: Branch b1_5 X-Git-Tag: v1_7_100~1^90~8^2~27 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=ee5847f80f8499bd52a53be5e6b551dd64b06ae4;p=fs%2Flustre-release.git Branch b1_5 b=8007 add some more debugging to find out why we lose MOUNTDATA on buffalo sometimes --- diff --git a/lustre/utils/lr_reader.c b/lustre/utils/lr_reader.c index a45b520..d9cab27 100644 --- a/lustre/utils/lr_reader.c +++ b/lustre/utils/lr_reader.c @@ -158,7 +158,7 @@ int main(int argc, char *const argv[]) printf("Feature compat=%#x\n", lsd.lsd_feature_compat); printf("Feature incompat=%#x\n", lsd.lsd_feature_incompat); printf("Feature rocompat=%#x\n", lsd.lsd_feature_rocompat); - printf("Last transaction %lu\n", lsd.lsd_last_transno); + printf("Last transaction %llu\n", lsd.lsd_last_transno); printf("ost index %u\n", lsd.lsd_ost_index); printf("mdt index %u\n", lsd.lsd_mdt_index); diff --git a/lustre/utils/mkfs_lustre.c b/lustre/utils/mkfs_lustre.c index 806b746..fbff71d 100644 --- a/lustre/utils/mkfs_lustre.c +++ b/lustre/utils/mkfs_lustre.c @@ -182,14 +182,13 @@ int run_command(char *cmd) /* Can't use popen because we need the rv of the command */ rc = system(cmd); - if (rc && fd >= 0) { + if ((rc || (verbose > 2)) && (fd >= 0)) { char buf[128]; FILE *fp; fp = fopen(log, "r"); if (fp) { while (fgets(buf, sizeof(buf), fp) != NULL) { - if (rc || verbose > 2) - printf(" %s", buf); + printf(" %s", buf); } fclose(fp); } @@ -738,11 +737,13 @@ int read_local_files(struct mkfs_opts *mop) /* Construct debugfs command line. */ memset(cmd, 0, sizeof(cmd)); - sprintf(cmd, - "debugfs -c -R 'rdump /%s %s' %s", + sprintf(cmd, "debugfs -c -R 'rdump /%s %s' %s", MOUNT_CONFIGS_DIR, tmpdir, dev); - run_command(cmd); + ret = run_command(cmd); + if (ret) + verrprint("%s: Unable to dump %s dir (%d)\n", + progname, MOUNT_CONFIGS_DIR); sprintf(filepnm, "%s/%s", tmpdir, MOUNT_DATA_FILE); filep = fopen(filepnm, "r"); @@ -753,8 +754,12 @@ int read_local_files(struct mkfs_opts *mop) /* COMPAT_146 */ /* Try to read pre-1.6 config from last_rcvd */ struct lr_server_data lsd; - verrprint("%s: Unable to read %s, trying last_rcvd\n", - progname, MOUNT_DATA_FILE); + verrprint("%s: Unable to read %s (%s).\n", + progname, MOUNT_DATA_FILE, strerror(errno)); + verrprint("Contents of %s:\n", MOUNT_CONFIGS_DIR); + sprintf(cmd, "ls -l %s", tmpdir); + run_command(cmd); + verrprint("Trying last_rcvd\n"); /* Construct debugfs command line. */ memset(cmd, 0, sizeof(cmd));