From c5a9d4447d69d72de3304781194fa392a7c6e1d8 Mon Sep 17 00:00:00 2001 From: Mark Vitale Date: Wed, 6 Mar 2019 11:27:58 -0500 Subject: [PATCH] dir: dtest should flush on error when creating directories The dtest -f subcommand (CRTest()) exits immediately if there is an error while adding files. This may create an empty, incomplete, or corrupt directory object on disk because we neglected to call DFlush before exiting. Always call DFlush from CRTest() whether it fails or succeeds. Change-Id: Ia7b4ad00ea6f4f9f788cd75ae726bdadb60ee9c3 Reviewed-on: https://gerrit.openafs.org/13796 Reviewed-by: Andrew Deason Reviewed-by: Cheyenne Wills Reviewed-by: Benjamin Kaduk Reviewed-by: Michael Meffie Tested-by: BuildBot --- src/dir/test/dtest.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/dir/test/dtest.c b/src/dir/test/dtest.c index e6e3875e35..20eeb5ae26 100644 --- a/src/dir/test/dtest.c +++ b/src/dir/test/dtest.c @@ -158,7 +158,7 @@ CRTest(char *dname, char *ename, int count) } if (code) { printf("code for '%s' is %d\n", tbuffer, code); - return; + break; } } DFlush();