2de31a7d | 22-Jun-2023 |
Tomohiro Kusumi <tkusumi@netbsd.org> |
usr.sbin/makefs/hammer2: Allow broken symlink when populating
Symlinks need to be tested with lstat(2). Using stat(2) for sanity doesn't allow creation of a broken symlink whose source is also a bro
usr.sbin/makefs/hammer2: Allow broken symlink when populating
Symlinks need to be tested with lstat(2). Using stat(2) for sanity doesn't allow creation of a broken symlink whose source is also a broken symlink.
show more ...
|
1dc6036f | 20-Jun-2023 |
Tomohiro Kusumi <tkusumi@netbsd.org> |
usr.sbin/makefs/hammer2: Fix use-after-free caused by unmodified inode
Fix another bug only seen on OpenBSD.
Unlike regular makefs usage for image creation, ioctl commands don't always modify all i
usr.sbin/makefs/hammer2: Fix use-after-free caused by unmodified inode
Fix another bug only seen on OpenBSD.
Unlike regular makefs usage for image creation, ioctl commands don't always modify all in-memory inodes. These unmodified inodes get freed in makefs vflush() via hammer2_inode_drop() on unmount before PFS sync, but they need to outlive chains.
Add per-PFS reclaim list to keep all inodes intact during unmount process until PFS is ready to be freed.
show more ...
|
ba024da8 | 20-Jun-2023 |
Tomohiro Kusumi <tkusumi@netbsd.org> |
usr.sbin/makefs/hammer2: Remove redundant hammer2_inode_modify()
The inode setxxx ioctls don't need hammer2_inode_modify() for intermediate directories.
The inode destroy ioctl needs hammer2_inode_
usr.sbin/makefs/hammer2: Remove redundant hammer2_inode_modify()
The inode setxxx ioctls don't need hammer2_inode_modify() for intermediate directories.
The inode destroy ioctl needs hammer2_inode_modify() at least for a direct parent directory of destroy target.
show more ...
|
bca6a9a0 | 19-Jun-2023 |
Tomohiro Kusumi <tkusumi@netbsd.org> |
usr.sbin/makefs/hammer2: Fix minor -Wchar-subscripts warning on NetBSD
Also fix local variable name from 6857f034386455e55e5ca87b75b84db5fcc3522e.
-- warning: array subscript has type 'char' [-Wcha
usr.sbin/makefs/hammer2: Fix minor -Wchar-subscripts warning on NetBSD
Also fix local variable name from 6857f034386455e55e5ca87b75b84db5fcc3522e.
-- warning: array subscript has type 'char' [-Wchar-subscripts] 1694 | } else if (isdigit(comp_level_str[0])) {
show more ...
|
6857f034 | 19-Jun-2023 |
Tomohiro Kusumi <tkusumi@netbsd.org> |
usr.sbin/makefs/hammer2: Trim redundant / in input path
HAMMER2 ioctl commands in makefs(8) that need to resolve input path components fail if the path contains consecutive or leading or tailing /.
usr.sbin/makefs/hammer2: Trim redundant / in input path
HAMMER2 ioctl commands in makefs(8) that need to resolve input path components fail if the path contains consecutive or leading or tailing /. Trim these /'s, instead of just trailing ones.
show more ...
|
70e962f7 | 19-Jun-2023 |
Tomohiro Kusumi <tkusumi@netbsd.org> |
usr.sbin/makefs/hammer2: Fix assert bug when running ioctl commands
The dir pointer should be NULL when running HAMMER2 ioctl command with "--" for directory, and in that case assert(dir!=NULL) in c
usr.sbin/makefs/hammer2: Fix assert bug when running ioctl commands
The dir pointer should be NULL when running HAMMER2 ioctl command with "--" for directory, and in that case assert(dir!=NULL) in common paths are wrong.
Only seen this on OpenBSD which means only OpenBSD had NULL for an uninitialized pointer in stack.
-- assertion "dir != NULL" failed: file "hammer2.c", line 269, function "hammer2_makefs" assertion "dir != NULL" failed: file "hammer2.c", line 658, function "hammer2_validate"
show more ...
|
4fe5868f | 18-Jun-2023 |
Tomohiro Kusumi <tkusumi@netbsd.org> |
usr.sbin/makefs/hammer2: Fix -Wunused-but-set-variable warnings on Linux
Local variables *iroot and lhc are set but never used. Also fix sys/vfs/hammer2/hammer2_ioctl.c which is basically the same f
usr.sbin/makefs/hammer2: Fix -Wunused-but-set-variable warnings on Linux
Local variables *iroot and lhc are set but never used. Also fix sys/vfs/hammer2/hammer2_ioctl.c which is basically the same file.
Also remove "Get the clid" comment in the next line which didn't make sense since 6f445d15835c6677a0a79c8d168ef44d0b9b22c3 in 2018.
show more ...
|
465e1141 | 17-Jun-2023 |
Tomohiro Kusumi <tkusumi@netbsd.org> |
usr.sbin/makefs: Add HAMMER2 offline inode setcheck|setcomp support
This commit adds "setcheck" and "setcomp" commands to "-o I" option. `image-file` argument is a valid HAMMER2 image file or block
usr.sbin/makefs: Add HAMMER2 offline inode setcheck|setcomp support
This commit adds "setcheck" and "setcomp" commands to "-o I" option. `image-file` argument is a valid HAMMER2 image file or block device. `directory` argument is unused, but needs to be a valid path or "--".
e.g. $ makefs -t hammer2 -o I=setcheck:/path/to/file:sha192 /dev/adx -- $ makefs -t hammer2 -o I=setcomp:/path/to/file:zlib:6 /path/to/hammer2.img --
"setcheck" takes `:<inode_path>:<check_algo>` string after command name. "setcomp" takes `:<inode_path>:<comp_algo>[:<comp_level>]` string after command name. These are equivalent to hammer2(8) setcheck and setcomp directives.
show more ...
|
f804c425 | 16-Jun-2023 |
Tomohiro Kusumi <tkusumi@netbsd.org> |
usr.sbin/makefs: Add HAMMER2 offline inode get support
The offline inode takes HAMMER2 specific "-o I" option. `image-file` argument is a valid HAMMER2 image file or block device. `directory` argume
usr.sbin/makefs: Add HAMMER2 offline inode get support
The offline inode takes HAMMER2 specific "-o I" option. `image-file` argument is a valid HAMMER2 image file or block device. `directory` argument is unused, but needs to be a valid path or "--".
e.g. $ makefs -t hammer2 -o I=get:/path/to/file /dev/adx -- $ makefs -t hammer2 -o I=get:/path/to/file /path/to/hammer2.img --
The "-o I" option requires inode command name argument, which is currently only "get". "get" takes `:<inode_path>` string after command name. "get" is equivalent to hammer2(8) printinode directive.
show more ...
|
f72350ac | 15-Jun-2023 |
Tomohiro Kusumi <tkusumi@netbsd.org> |
usr.sbin/makefs: Add offline HAMMER2IOC_VERSION_GET support
The offline version get uses existing "-o V" option with no argument. `image-file` argument is a valid HAMMER2 image file or block device.
usr.sbin/makefs: Add offline HAMMER2IOC_VERSION_GET support
The offline version get uses existing "-o V" option with no argument. `image-file` argument is a valid HAMMER2 image file or block device. `directory` argument is unused, but needs to be a valid path or "--".
e.g. $ makefs -t hammer2 -o V /dev/adx -- $ makefs -t hammer2 -o V /path/to/hammer2.img --
There is no hammer2(8) directive for this as it's internally used.
show more ...
|
9a149651 | 15-Jun-2023 |
Tomohiro Kusumi <tkusumi@netbsd.org> |
usr.sbin/makefs: Introduce hammer2_makefs_options_t::ioctl_cmd flag
rather than having boolean flag for each ioctl command since now that many of the hammer2(8) ioctls are implemented. |
06d1ac82 | 14-Jun-2023 |
Tomohiro Kusumi <tkusumi@netbsd.org> |
usr.sbin/makefs: Minor cleanup |
ac97ce60 | 12-Jun-2023 |
Tomohiro Kusumi <tkusumi@netbsd.org> |
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 s
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".
show more ...
|
c845ed14 | 11-Jun-2023 |
Tomohiro Kusumi <tkusumi@netbsd.org> |
usr.sbin/makefs: Fix makefs(8) man page on -m option
-m and -o m are different options (latter is HAMMER2 specific), and this context refers to -o m option. |
3999233b | 10-Jun-2023 |
Tomohiro Kusumi <tkusumi@netbsd.org> |
usr.sbin/makefs: Add HAMMER2 offline PFS get|lookup|create|delete|snapshot support
The offline PFS takes HAMMER2 specific "-o P" option. `image-file` argument is a valid HAMMER2 image file or block
usr.sbin/makefs: Add HAMMER2 offline PFS get|lookup|create|delete|snapshot support
The offline PFS takes HAMMER2 specific "-o P" option. `image-file` argument is a valid HAMMER2 image file or block device. `directory` argument is unused, but needs to be a valid path or "--".
e.g. $ makefs -t hammer2 -o P=get /dev/adx -- $ makefs -t hammer2 -o P=lookup:name /path/to/hammer2.img -- $ makefs -t hammer2 -o P=create:name /dev/adx -- $ makefs -t hammer2 -o P=delete:name /path/to/hammer2.img -- $ makefs -t hammer2 -o P=snapshot:name /dev/adx -- $ makefs -t hammer2 -o P=snapshot /path/to/hammer2.img --
The "-o P" option requires PFS command name argument, which are "get" (alias "list"), "lookup", "create", "delete" and "snapshot". lookup, create and delete take `:<pfs_name>` string after command name. snapshot takes optional `:<pfs_name>` string after command name.
Use -m option (default "DATA") to specify target PFS for snapshot.
show more ...
|
b4807901 | 09-Jun-2023 |
Tomohiro Kusumi <tkusumi@netbsd.org> |
usr.sbin/makefs: Minor fix / cleanup |
48ed4577 | 09-Jun-2023 |
Tomohiro Kusumi <tkusumi@netbsd.org> |
usr.sbin/makefs: Add HAMMER2 emergency mode support
The "-o E" option sets emergency mode flag. This can be used in conjunction with other operations, but there is no point in using this option for
usr.sbin/makefs: Add HAMMER2 emergency mode support
The "-o E" option sets emergency mode flag. This can be used in conjunction with other operations, but there is no point in using this option for regular usage.
show more ...
|
917508cd | 08-Jun-2023 |
Tomohiro Kusumi <tkusumi@netbsd.org> |
usr.sbin/makefs: Add HAMMER2 offline destroy support
The offline destroy takes HAMMER2 specific "-o D" option. `image-file` argument is a valid HAMMER2 image file or block device. `directory` argume
usr.sbin/makefs: Add HAMMER2 offline destroy support
The offline destroy takes HAMMER2 specific "-o D" option. `image-file` argument is a valid HAMMER2 image file or block device. `directory` argument is unused, but needs to be a valid path or "--".
e.g. $ makefs -t hammer2 -o D=/a.out /dev/adx -- $ makefs -t hammer2 -o D=1234 /path/to/hammer2.img --
The "-o D" option reuires file path or inode number argument. - If it's a file path, optarg must start with '/'. - If it's an inum, optarg must start with "0x" or '0'-'9'. Note that destroy by inum seems broken not only in makefs, but also in real HAMMER2 ioctl.
show more ...
|
3bbcb743 | 08-Jun-2023 |
Tomohiro Kusumi <tkusumi@netbsd.org> |
usr.sbin/makefs/hammer2: Minor cleanup |
afa5234b | 07-Jun-2023 |
Tomohiro Kusumi <tkusumi@netbsd.org> |
usr.sbin/makefs: Add HAMMER2 offline growfs support
The offline growfs takes HAMMER2 specific "-o G" option. `image-file` argument is a valid HAMMER2 image file or block device. `directory` argument
usr.sbin/makefs: Add HAMMER2 offline growfs support
The offline growfs takes HAMMER2 specific "-o G" option. `image-file` argument is a valid HAMMER2 image file or block device. `directory` argument is unused, but needs to be a valid path or "--".
e.g. $ makefs -t hammer2 -o G /dev/adx -- $ makefs -t hammer2 -o G /path/to/hammer2.img --
By default expands volume to image file or block device size. If -s option is specified, use that size. No shrink support in the same way hammer2(8) growfs doesn't.
show more ...
|
961db90e | 07-Jun-2023 |
Tomohiro Kusumi <tkusumi@netbsd.org> |
usr.sbin/makefs: Sync with sys/vfs/hammer2
Sync with following sys/vfs/hammer2 commits.
$ git log --pretty="%h %s" 01a24a934a5d6fd384584e1d72f1f9dd25bb98d3.. -- sys/vfs/hammer2/ 0f90a2c50b sys/vfs/
usr.sbin/makefs: Sync with sys/vfs/hammer2
Sync with following sys/vfs/hammer2 commits.
$ git log --pretty="%h %s" 01a24a934a5d6fd384584e1d72f1f9dd25bb98d3.. -- sys/vfs/hammer2/ 0f90a2c50b sys/vfs/hammer2: Fail ioctl(HAMMER2IOC_GROWFS) if size > devvp size a3364d7fa7 sys/vfs/hammer2: Change growfs kprintf format %jd -> %016jx for hammer2_off_t
show more ...
|
a63188c8 | 03-Jun-2023 |
Tomohiro Kusumi <tkusumi@netbsd.org> |
usr.sbin/makefs: Add HAMMER2 offline bulkfree support
Since makefs HAMMER2 implements the entire HAMMER2 logic in userspace with selected vops using single threaded xops, it's actually trivial to su
usr.sbin/makefs: Add HAMMER2 offline bulkfree support
Since makefs HAMMER2 implements the entire HAMMER2 logic in userspace with selected vops using single threaded xops, it's actually trivial to support other operations, e.g. HAMMER2 ioctls.
This commit adds bulkfree (free unreferenced blocks by scanning the entire data chains from vchain) option to makefs. Unlike the existing hammer2(8) "bulkfree" directive which requires live filesystem, this option enables offline bulkfree against unmounted HAMMER2 image.
The offline bulkfree takes HAMMER2 specific "-o B" option. When this option is specified, makefs runs offline bulkfree against `image-file` argument instead of creating one, hence it must be a valid HAMMER2 image. `image-file` can be either a regular file or block device. Unlike normal use case, `directory` argument is unused, but it's still required. It can be any valid path or simply "--".
e.g. $ makefs -t hammer2 -o B /dev/adx -- $ makefs -t hammer2 -o B /path/to/hammer2.img --
Technically, all HAMMER2 ioctls can be implemented in makefs as offline version, but "bulkfree" and "growfs" are probably the only hammer2(8) directives that make sense to exist as offline version.
Note that the limitation regarding OOM mentioned in 2d60b848f2 also applies to bulkfree, i.e. makefs(8) could fail with partially written `image-file` if it contains insane number of files or directories.
show more ...
|
01a24a93 | 02-Jun-2023 |
Tomohiro Kusumi <tkusumi@netbsd.org> |
usr.sbin/makefs: Sync with sys/vfs/hammer2
Sync with following sys/vfs/hammer2 commits.
$ git log --pretty="%h %s" 6966bebf98ca11fee72e5ba9849224a5049211dd.. -- sys/vfs/hammer2/ 23d820f091 sys/vfs/
usr.sbin/makefs: Sync with sys/vfs/hammer2
Sync with following sys/vfs/hammer2 commits.
$ git log --pretty="%h %s" 6966bebf98ca11fee72e5ba9849224a5049211dd.. -- sys/vfs/hammer2/ 23d820f091 sys/vfs/hammer2: Use howmany() to calculate bulkfree bmap size e12df3bcd3 sys/vfs/hammer2: Fix comment on bmradix in freemap 8d92096877 sys/vfs/hammer2: Remove obsolete comments in freemap f517f709f2 sys/vfs/hammer2: Remove redundant NULL chain test in bulkfree c4cc6dbe36 sys/vfs/hammer2: Remove obsolete code/comment in freemap a4cea70ee4 sys/vfs/hammer2: Fix 53b767003a to use plural 53b767003a sys/vfs/hammer2: Fix multiple "radii" -> "radix"
show more ...
|
6966bebf | 06-May-2023 |
Tomohiro Kusumi <tkusumi@netbsd.org> |
usr.sbin/makefs: Sync with sys/vfs/hammer2
Sync with following sys/vfs/hammer2 commits.
$ git log --pretty="%h %s" a0373a75974db9f2e5b8420fcc1111337d553f30.. -- sys/vfs/hammer2/ cbf2d85db0 sys/vfs/
usr.sbin/makefs: Sync with sys/vfs/hammer2
Sync with following sys/vfs/hammer2 commits.
$ git log --pretty="%h %s" a0373a75974db9f2e5b8420fcc1111337d553f30.. -- sys/vfs/hammer2/ cbf2d85db0 sys/vfs/hammer2: Fix -Wformat warnings on other platforms 2a6d3b8baa sys/vfs/hammer2: Fix memory leak for second PFS mount and after
show more ...
|
f8a1147c | 06-May-2023 |
Tomohiro Kusumi <tkusumi@netbsd.org> |
usr.sbin/makefs: Fix -Wformat warnings on other platforms
Mostly from HAMMER2, except for DragonFly specific makefs_daddr_t part in ffs/buf.c. Includes the same diff as cbf2d85db0. |