usr.sbin/makefs: Fix "-o D" option when intermediate directories exist
authorTomohiro Kusumi <tkusumi@netbsd.org>
Mon, 12 Jun 2023 08:44:12 +0000 (01:44 -0700)
committerTomohiro Kusumi <tkusumi@netbsd.org>
Tue, 13 Jun 2023 06:05:27 +0000 (23:05 -0700)
commitac97ce6029a0c983cde2e0412a236b7aa455a770
treed2d0201b8c92f9a0216efbd339288e7c4326af3b
parentc845ed148c617fbf9ea7cc2f62aa5ead71f1846d
usr.sbin/makefs: Fix "-o D" option when intermediate directories exist

HAMMER2_DELETE_FILE assumes a given inode is a directory containing
dirent whose name is destroy.path. Therefore ioctl caller side needs
to split path components and only pass the last component along with
its direct parent directory inode.

It currently worked only when a target file path is the last component
without intermediate directories (no intermediate '/').

hammer2_ioc_destroy_t::path should be renamed to "name", as it
doesn't allow a file "path".
usr.sbin/makefs/hammer2.c
usr.sbin/makefs/hammer2/hammer2_inode.c