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 <adeason@sinenomine.net>
Reviewed-by: Cheyenne Wills <cwills@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
This commit is contained in:
Mark Vitale 2019-03-06 11:27:58 -05:00 committed by Benjamin Kaduk
parent 2a1a65faab
commit c5a9d4447d

View File

@ -158,7 +158,7 @@ CRTest(char *dname, char *ename, int count)
} }
if (code) { if (code) {
printf("code for '%s' is %d\n", tbuffer, code); printf("code for '%s' is %d\n", tbuffer, code);
return; break;
} }
} }
DFlush(); DFlush();