Project

General

Profile

Actions

Bug #3352

open

HAMMER2 ioctl(HAMMER2IOC_DESTROY) is broken

Added by tkusumi 10 months ago.

Status:
New
Priority:
Normal
Assignee:
-
Category:
-
Target version:
Start date:
06/21/2023
Due date:
% Done:

0%

Estimated time:

Description

1. hammer2(8) destroy directive - This succeeds with "ok" message, but after unmount + mount, the same file is still there.

The reason is because it currently just unlinks dirent chain from parent directory (ip) chain,
and returns without modifying parent directory which can cause flusher to flush.
Both VOP_NREMOVE and VOP_NRMDIR modify dip, but this one does not.

# mount_hammer2 /dev/vn0 /mnt
# hammer2 destroy /mnt/src/Makefile
/mnt/src/Makefile    ok
# hammer2 destroy /mnt/src/Makefile
/mnt/src/Makefile    No such file or directory
# umount /mnt
# mount_hammer2 /dev/vn0 /mnt
# hammer2 destroy /mnt/src/Makefile
/mnt/src/Makefile    ok
# hammer2 destroy /mnt/src/Makefile
/mnt/src/Makefile    No such file or directory

2. hammer2(8) destroy-inum directive - This simply fails. It seems hammer2_chain_lookup() can't find the chain via inode number.

# mount_hammer2 /dev/vn0 /mnt
# ls -li /mnt/src/README
1104 -rw-r--r--  1 root  wheel  10989 Jun 21 00:58 /mnt/src/README
# hammer2 -s /mnt destroy-inum 1104
deleting inodes on /mnt
    1104 No such file or directory
# hammer2 -s /mnt destroy-inum 0x450
deleting inodes on /mnt
    1104 No such file or directory

No data to display

Actions

Also available in: Atom PDF