]> granicus.if.org Git - zfs/commit
Replace zed_file_create_dirs() with mkdirp()
authorChris Dunlap <cdunlap@llnl.gov>
Tue, 8 Apr 2014 22:31:36 +0000 (15:31 -0700)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Wed, 9 Apr 2014 20:32:54 +0000 (13:32 -0700)
commit6ac770b1961b9468daf0c69eae6515c608535789
tree073446e64b68d7fc66ccc0c015fc393be60c51c4
parent7368eb621e6c94dd8fd37020568f32c120afabf9
Replace zed_file_create_dirs() with mkdirp()

When processing directory components starting from the root dir,
zed_file_create_dirs() contained a bug in checking the return value of
mkdir().  A typo was made, and the test for (mkdir_errno != EEXIST) was
erroneously written as (mkdir_errno == EEXIST).  If some of the leading
directory components already existed, this bug would cause the routine
to exit before creating the remaining directory components.

Instead of fixing the above mkdir_errno test, this commit replaces
zed_file_create_dirs() with mkdirp().  This cleanup was already
planned, and zed_file_create_dirs() only existed because I didn't
realize mkdirp() was already in tree at the time.

Signed-off-by: Chris Dunlap <cdunlap@llnl.gov>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #2248
cmd/zed/zed_conf.c
cmd/zed/zed_file.c
cmd/zed/zed_file.h