From db3b77987c187387da7a214d013a1a55a0480c56 Mon Sep 17 00:00:00 2001 From: Maxim Belkin Date: Fri, 2 Oct 2020 11:05:38 -0500 Subject: [PATCH 1/2] src/shifter_core.c: respect cache block size --- src/shifter_core.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/shifter_core.c b/src/shifter_core.c index 364daf64..452774b1 100644 --- a/src/shifter_core.c +++ b/src/shifter_core.c @@ -1643,9 +1643,11 @@ int setupPerNodeCacheBackingStore(VolMapPerNodeCacheConfig *cache, const char *b } args = (char **) _malloc(sizeof(char *) * 4); args[0] = _strdup(udiConfig->mkfsXfsPath); - args[1] = _strdup("-d"); - args[2] = alloc_strgenf("name=%s,file=1,size=%lu", buffer, cache->cacheSize); - args[3] = NULL; + args[1] = _strdup("-b"); + args[2] = alloc_strgenf("size=%lu", cache->blockSize); + args[3] = _strdup("-d"); + args[4] = alloc_strgenf("name=%s,file=1,size=%lu", buffer, cache->cacheSize); + args[5] = NULL; ret = forkAndExecvSilent(args); for (argPtr = args; argPtr && *argPtr; argPtr++) { free(*argPtr); From 11348dec55694337a0976bb8780de6ba97ab9d35 Mon Sep 17 00:00:00 2001 From: Maxim Belkin Date: Thu, 8 Oct 2020 17:39:59 -0500 Subject: [PATCH 2/2] src/test/test_shifter_core.cpp: fix test for setupPerNodeCacheBackingStore --- src/test/test_shifter_core.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/test/test_shifter_core.cpp b/src/test/test_shifter_core.cpp index 7c4b20a8..b5cd4958 100644 --- a/src/test/test_shifter_core.cpp +++ b/src/test/test_shifter_core.cpp @@ -604,6 +604,7 @@ IGNORE_TEST(ShifterCoreTestGroup, setupPerNodeCacheBackingStore_tests) { cache->fstype = strdup("xfs"); cache->cacheSize = 200 * 1024 * 1024; // 200mb + cache->blockSize = 4096; // 4 KiB if (access("/sbin/mkfs.xfs", X_OK) == 0) { config->target_uid = getuid();