X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=blobdiff_plain;f=lustre%2Futils%2Flhsmtool_posix.c;h=60077d846750206e5639738d8ecf2c588123cae1;hp=c25ed12e72cf1bcc72effa4f7f33a5e8c3ef11a2;hb=b87e99adf44b80308f341cbf143374034f627ab9;hpb=a70e10cdd43f2139cb9f95b96fbaa860ec0b2b7a diff --git a/lustre/utils/lhsmtool_posix.c b/lustre/utils/lhsmtool_posix.c index c25ed12..60077d8 100644 --- a/lustre/utils/lhsmtool_posix.c +++ b/lustre/utils/lhsmtool_posix.c @@ -88,7 +88,7 @@ struct options { struct options opt = { .o_copy_attrs = 1, .o_shadow_tree = 1, - .o_verbose = LLAPI_MSG_WARN, + .o_verbose = LLAPI_MSG_INFO, .o_copy_xattrs = 1, .o_report_int = REPORT_INTERVAL_DEFAULT, .o_chunk_size = ONE_MB, @@ -583,8 +583,9 @@ static int ct_copy_data(struct hsm_copyaction_private *hcp, const char *src, errno = 0; /* Don't read beyond a given extent */ - rlen = (hai->hai_extent.length == -1LL) ? - src_st.st_size : hai->hai_extent.length; + rlen = min(hai->hai_extent.length, src_st.st_size); + + CT_DEBUG("Going to copy "LPU64" bytes %s -> %s\n", rlen, src, dst); while (wpos < rlen) { int chunk = (rlen - wpos > opt.o_chunk_size) ? @@ -1748,6 +1749,8 @@ static int ct_run(void) } } + setbuf(stdout, NULL); + rc = llapi_hsm_copytool_register(&ctdata, opt.o_mnt, 0, opt.o_archive_cnt, opt.o_archive_id); if (rc < 0) {