From 4838a97de940c5f4152e60086bb709f18e5b27a3 Mon Sep 17 00:00:00 2001 From: Evan Lezar Date: Wed, 18 Jan 2023 16:45:17 +0100 Subject: [PATCH 1/2] Ignore check for existing files when creating non-empty files When creating files the check for existence is skipped if any data is specified to write to the file. This ensures that new file contents are always written. This fixes a bug where, for example, the application-profiles file was not updated correctly for multiple GPUs. Signed-off-by: Evan Lezar --- src/utils.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/utils.c b/src/utils.c index 8fe32e4b..8ff6f269 100644 --- a/src/utils.c +++ b/src/utils.c @@ -524,7 +524,7 @@ file_create(struct error *err, const char *path, const char *data, uid_t uid, gi int rv = -1; // We check whether the file already exists with the required mode and skip the creation. - if (file_mode(err, path, &perm) == 0) { + if (data == NULL && file_mode(err, path, &perm) == 0) { if (perm == mode) { log_errf("The path %s alreay exists with the required mode; skipping create", path); return (0); From 733ac8d8422897817323a189b6c3592587836c1a Mon Sep 17 00:00:00 2001 From: Evan Lezar Date: Wed, 18 Jan 2023 16:52:20 +0100 Subject: [PATCH 2/2] Bump version to 1.12.0-rc.4 Signed-off-by: Evan Lezar --- pkg/deb/changelog | 6 ++++++ pkg/rpm/SPECS/libnvidia-container.spec | 3 +++ src/nvc.h | 4 ++-- 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/pkg/deb/changelog b/pkg/deb/changelog index 911f1316..b32867b2 100644 --- a/pkg/deb/changelog +++ b/pkg/deb/changelog @@ -1,3 +1,9 @@ +libnvidia-container (1.12.0~rc.4-1) experimental; urgency=medium + + * Fix bug when checking whether files exist on file creation from 1.12.0-rc.2 + + -- NVIDIA CORPORATION Wed, 18 Jan 2023 16:50:59 +0100 + libnvidia-container (1.12.0~rc.3-1) experimental; urgency=medium * Bump version to 1.12.0-rc.3 diff --git a/pkg/rpm/SPECS/libnvidia-container.spec b/pkg/rpm/SPECS/libnvidia-container.spec index 95d871e4..cb463e73 100644 --- a/pkg/rpm/SPECS/libnvidia-container.spec +++ b/pkg/rpm/SPECS/libnvidia-container.spec @@ -99,6 +99,9 @@ This package contains command-line tools that facilitate using the library. %{_bindir}/* %changelog +* Wed Jan 18 2023 NVIDIA CORPORATION 1.12.0-0.1.rc.4 +- Fix bug when checking whether files exist on file creation from 1.12.0-rc.2 + * Fri Dec 09 2022 NVIDIA CORPORATION 1.12.0-0.1.rc.3 - Bump version to 1.12.0-rc.3 diff --git a/src/nvc.h b/src/nvc.h index 7acfa899..4f5652d3 100644 --- a/src/nvc.h +++ b/src/nvc.h @@ -33,8 +33,8 @@ extern "C" { // For stable releases, this should be defined as empty. // For release candidates, this should be defined with the format "rc.1" // The version string should also be updated accordingly, using a ~ separator where applicable. -#define NVC_TAG "rc.3" -#define NVC_VERSION "1.12.0~rc.3" +#define NVC_TAG "rc.4" +#define NVC_VERSION "1.12.0~rc.4" #define NVC_ARG_MAX 256