Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions debian/changelog
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
ltsm (0.9.2) unstable; urgency=low

* Increased buffersize to 16 MiB

-- Samuel Hasert <s.hasert@gsi.de> Mon, 15 Sep 2025 11:33:05 +0200

ltsm (0.9.1) unstable; urgency=low

* Finalize remove of FSQ project.
Expand Down
3 changes: 3 additions & 0 deletions rpm/ltsm.spec
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,9 @@ rm -rf %{buildroot}

%changelog

* Mon Sep 15 2025 Samuel Hasert <s.hasert@gsi.de> 0.9.2
- Increased buffersize to 16 MiB

* Thu Jul 28 2022 Thomas Stibor <t.stibor@gsi.de> 0.9.0-1
- Remove FSQ to keep LTSM as a Lustre TSM copytool project.

Expand Down
16 changes: 14 additions & 2 deletions src/lib/common.c
Original file line number Diff line number Diff line change
Expand Up @@ -152,12 +152,19 @@ int crc32file(const char *filename, uint32_t *crc32result)
FILE *file;
size_t cur_read;
uint32_t crc32sum = 0;
unsigned char buf[TSM_BUF_LENGTH] = {0};
unsigned char* buf = malloc(TSM_BUF_LENGTH); // reserve memory on heap because stack too small
if (!buf) {
rc = errno;
CT_ERROR(rc, "malloc");

return rc;
}

file = fopen(filename, "r");
if (file == NULL) {
rc = -errno;
CT_ERROR(rc, "fopen failed on '%s'", filename);
if (buf) free(buf);

return rc;
}
Expand All @@ -180,11 +187,16 @@ int crc32file(const char *filename, uint32_t *crc32result)
if (rc_minor) {
rc_minor = -errno;
CT_ERROR(rc_minor, "fclose failed on '%s'", filename);
if (buf) free(buf);

return rc_minor;
}

*crc32result = crc32sum;
if (!rc) {
*crc32result = crc32sum;
}

if (buf) free(buf);

return rc;
}
Expand Down
2 changes: 1 addition & 1 deletion src/lib/common.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
#endif

#ifndef TSM_BUF_LENGTH
#define TSM_BUF_LENGTH 262144 /* 256 KiB. */
#define TSM_BUF_LENGTH 16777216 /* 16 MiB */
#endif

#ifndef MAX_OPTIONS_LENGTH
Expand Down
5 changes: 4 additions & 1 deletion src/ltsmc.c
Original file line number Diff line number Diff line change
Expand Up @@ -493,7 +493,7 @@ int main(int argc, char *argv[])
goto cleanup_tsm;
}

char buf[TSM_BUF_LENGTH] = {0};
char* buf = malloc(TSM_BUF_LENGTH);
size_t size;
do {
size = fread(buf, 1, TSM_BUF_LENGTH, stdin);
Expand All @@ -515,9 +515,12 @@ int main(int argc, char *argv[])
if (rc)
CT_ERROR(errno, "tsm_fclose failed");

free(buf);

goto cleanup_tsm;
}


session.progress = progress_callback;

rc = tsm_connect(&login, &session);
Expand Down