X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=blobdiff_plain;f=lustre%2Futils%2Flfs.c;h=1f0f905da1c680264b1df34cdea9a3e2b06212f8;hp=b11f16b61975cee749978114f4a85ba452a600a3;hb=62ef9c949753;hpb=84d5f6b6d92b097684110de51e8a3ce022ee7220 diff --git a/lustre/utils/lfs.c b/lustre/utils/lfs.c index b11f16b..1f0f905 100644 --- a/lustre/utils/lfs.c +++ b/lustre/utils/lfs.c @@ -73,6 +73,7 @@ #include #include #include +#include #include #include "obdctl.h" @@ -2224,8 +2225,13 @@ static int lfs_flushctx(int argc, char **argv) } } - if (kdestroy) - system("kdestroy > /dev/null"); + if (kdestroy) { + int rc; + if ((rc = system("kdestroy > /dev/null")) != 0) { + rc = WEXITSTATUS(rc); + fprintf(stderr, "error destroying tickets: %d, continuing\n", rc); + } + } if (optind >= argc) { /* flush for all mounted lustre fs. */ @@ -2342,7 +2348,8 @@ static int lfs_changelog(int argc, char **argv) endrec = strtoll(argv[optind++], NULL, 10); rc = llapi_changelog_start(&changelog_priv, - follow ? CHANGELOG_FLAG_FOLLOW : 0, + CHANGELOG_FLAG_BLOCK | + (follow ? CHANGELOG_FLAG_FOLLOW : 0), mdd, startrec); if (rc < 0) { fprintf(stderr, "Can't start changelog: %s\n", @@ -2351,14 +2358,22 @@ static int lfs_changelog(int argc, char **argv) } while ((rc = llapi_changelog_recv(changelog_priv, &rec)) == 0) { + time_t secs; + struct tm ts; + if (endrec && rec->cr_index > endrec) break; if (rec->cr_index < startrec) continue; - printf(LPU64" %02d%-5s "LPU64" 0x%x t="DFID, - rec->cr_index, rec->cr_type, - changelog_type2str(rec->cr_type), rec->cr_time, + secs = rec->cr_time >> 30; + gmtime_r(&secs, &ts); + printf(LPU64" %02d%-5s %02d:%02d:%02d.%06d %04d.%02d.%02d " + "0x%x t="DFID, rec->cr_index, rec->cr_type, + changelog_type2str(rec->cr_type), + ts.tm_hour, ts.tm_min, ts.tm_sec, + (int)(rec->cr_time & ((1<<30) - 1)), + ts.tm_year+1900, ts.tm_mon+1, ts.tm_mday, rec->cr_flags & CLF_FLAGMASK, PFID(&rec->cr_tfid)); if (rec->cr_namelen) /* namespace rec includes parent and filename */