764bf12e | 01-Dec-2023 |
Tomohiro Kusumi <tkusumi@netbsd.org> |
usr.sbin/makefs/hammer2: Properly support block device for image creation
Unlike regular file image, block device image creation fails if estimated image size exceeds the device size.
Sparse file o
usr.sbin/makefs/hammer2: Properly support block device for image creation
Unlike regular file image, block device image creation fails if estimated image size exceeds the device size.
Sparse file option is ignored. The block device blocks aren't zero cleared.
show more ...
|
096d2ac4 | 30-Nov-2023 |
Tomohiro Kusumi <tkusumi@netbsd.org> |
sys/vfs/hammer2: Remove unused local variable *pmp
No longer used since 34fb48c236fd17fbe558c7b2cf21b4e50f38153e. makefs code warned on Linux. |
6b47f3ea | 29-Nov-2023 |
Tomohiro Kusumi <tkusumi@netbsd.org> |
usr.sbin/makefs: Sync with sys/vfs/hammer2
Sync with following sys/vfs/hammer2 commits. Also remove unused makefs specific function hammer2_pfs_inode_count().
$ git log --pretty="%h %s" 961db90e96d
usr.sbin/makefs: Sync with sys/vfs/hammer2
Sync with following sys/vfs/hammer2 commits. Also remove unused makefs specific function hammer2_pfs_inode_count().
$ git log --pretty="%h %s" 961db90e96d4d039edbd15dd78ecc822445405ec.. -- sys/vfs/hammer2/ bb70b93b8e sys/vfs/hammer2: Rename HAMMER2_INODE_ONRBTREE -> HAMMER2_INODE_ONHASH ad82725233 sys/vfs/hammer2: Remove REGFILE/SOFTLINK test in hammer2_inode_create_pfs() 258074ba74 sys/vfs/hammer2: Minor cleanup 0130729cda sys/vfs/hammer2: Fix comments on comp|check macros 9046282cb0 hammer2: Use HAMMER2_CHECK_DEFAULT when creating inode a071436b39 hammer2: Rename HAMMER2_COMP_NEWFS_DEFAULT -> HAMMER2_COMP_DEFAULT da9dedd0a7 sys/vfs/hammer2: Remove unused lbase local variables for hammer2_calc_logical() caf661fcf8 hammer2 - Try to reduce no-activity stalls during complex flushes 34fb48c236 hammer2 - Multitude of SMP contention fixes, work on flush 34a86030d9 sys/vfs/hammer2: Remove obsolete comments on common parent 74fa7b92b4 sys/vfs/hammer2: Remove obsolete comments on hidden inode 3a3a7c0e9c sys/vfs/hammer2: vnops need to return unix errno 2b3f93ea6d kernel - Add per-process capability-based restrictions eeb5b5dd2c sys/vfs/hammer2: Use hammer2_off_t in hammer2_io_alloc() 68e37e5676 sys/vfs/hammer2: Fix double count of hammer2_iod_file_{read,write} 7cf689a5ea sys/vfs/hammer2: Don't fail to lockinit diolk for fchain / vchain 73da171931 sys/vfs/hammer2: Use HAMMER2_VOLUME_BYTES for volume header size 41fa929b83 sys/vfs/hammer2: Fix XOP structure used in hammer2_inode_chain_flush() 4fe5868fa3 usr.sbin/makefs/hammer2: Fix -Wunused-but-set-variable warnings on Linux
show more ...
|
9046282c | 05-Nov-2023 |
Tomohiro Kusumi <tkusumi@netbsd.org> |
hammer2: Use HAMMER2_CHECK_DEFAULT when creating inode
There are a few cases where inode check type is explicitly specified (usually derived from parent directory inode).
These cases should use HAM
hammer2: Use HAMMER2_CHECK_DEFAULT when creating inode
There are a few cases where inode check type is explicitly specified (usually derived from parent directory inode).
These cases should use HAMMER2_CHECK_DEFAULT rather than HAMMER2_CHECK_XXHASH64, in the same way HAMMER2_COMP_DEFAULT is being used.
show more ...
|
a071436b | 05-Nov-2023 |
Tomohiro Kusumi <tkusumi@netbsd.org> |
hammer2: Rename HAMMER2_COMP_NEWFS_DEFAULT -> HAMMER2_COMP_DEFAULT
This was originally only used within newfs_hammer2(8) when first appeared in f481450ffccdbf50f8c9604067c25eb642a0c562 in 2013, but
hammer2: Rename HAMMER2_COMP_NEWFS_DEFAULT -> HAMMER2_COMP_DEFAULT
This was originally only used within newfs_hammer2(8) when first appeared in f481450ffccdbf50f8c9604067c25eb642a0c562 in 2013, but it's now always used when creating a new inode (e.g. ioctl).
The check version of this is HAMMER2_CHECK_DEFAULT without "NEWFS_".
show more ...
|
2b3f93ea | 13-Oct-2023 |
Matthew Dillon <dillon@apollo.backplane.com> |
kernel - Add per-process capability-based restrictions
* This new system allows userland to set capability restrictions which turns off numerous kernel features and root accesses. These restricti
kernel - Add per-process capability-based restrictions
* This new system allows userland to set capability restrictions which turns off numerous kernel features and root accesses. These restrictions are inherited by sub-processes recursively. Once set, restrictions cannot be removed.
Basic restrictions that mimic an unadorned jail can be enabled without creating a jail, but generally speaking real security also requires creating a chrooted filesystem topology, and a jail is still needed to really segregate processes from each other. If you do so, however, you can (for example) disable mount/umount and most global root-only features.
* Add new system calls and a manual page for syscap_get(2) and syscap_set(2)
* Add sys/caps.h
* Add the "setcaps" userland utility and manual page.
* Remove priv.9 and the priv_check infrastructure, replacing it with a newly designed caps infrastructure.
* The intention is to add path restriction lists and similar features to improve jailess security in the near future, and to optimize the priv_check code.
show more ...
|
556932ec | 30-Sep-2023 |
Matthew Dillon <dillon@apollo.backplane.com> |
makefs - Deconflict hammer2 function
* Deconflict and fix build |
6da97f51 | 01-Jul-2023 |
Tomohiro Kusumi <tkusumi@netbsd.org> |
usr.sbin/makefs/hammer2: Support inode timestamp in "-o R" option
which was missing part in 5e8b0eb766966577a1da788053d7ccaa443fa222.
Get timestamp from source inode within image file, and use that
usr.sbin/makefs/hammer2: Support inode timestamp in "-o R" option
which was missing part in 5e8b0eb766966577a1da788053d7ccaa443fa222.
Get timestamp from source inode within image file, and use that to update newly created directory and regular file.
If the underlying file system of destination files doesn't support timestamp and/or updating fails, the failure is simply ignored.
show more ...
|
daa1a189 | 30-Jun-2023 |
Tomohiro Kusumi <tkusumi@netbsd.org> |
usr.sbin/makefs/hammer2: Fix memory leak from retired xops
Add missing kfrees from 9d036237cbc59969257aaea138ddec5dbd8e181b. |
5e8b0eb7 | 27-Jun-2023 |
Tomohiro Kusumi <tkusumi@netbsd.org> |
usr.sbin/makefs/hammer2: Support recursive read for "-o R" option
"-o R" option currently creates 0 byte file if a given path is a directory, as directory inode size is set to 0.
Change this to rec
usr.sbin/makefs/hammer2: Support recursive read for "-o R" option
"-o R" option currently creates 0 byte file if a given path is a directory, as directory inode size is set to 0.
Change this to recursively walk directories, and retrieve directories and regular files under that directory. Specifying "-o R=/" does the reverse of what makefs(8) does.
It currently has following limitations. - Only directory and regular file are supported, other types are ignored. - Hard links are not ignored, but files are retrieved as different inodes and link count is not preserved. - Inode timestamp is not preserved. - Anything that HAMMER2 and this option support, but underlying file system doesn't is unsupported.
show more ...
|
9d036237 | 27-Jun-2023 |
Tomohiro Kusumi <tkusumi@netbsd.org> |
usr.sbin/makefs/hammer2: Introduce XOP fifo realloc
Since makefs HAMMER2 used a serialized single threaded xops, it was not possible to have more than HAMMER2_XOPFIFO fifo entries.
Change this to r
usr.sbin/makefs/hammer2: Introduce XOP fifo realloc
Since makefs HAMMER2 used a serialized single threaded xops, it was not possible to have more than HAMMER2_XOPFIFO fifo entries.
Change this to realloc XOP fifo whenever it hits current limit. This is also what Free|Net|OpenBSD HAMMER2 currently do until they support multi-threaded xops.
This makes possible to support VOP_READDIR, and that makes possible to support recursive read for "-o R" option.
show more ...
|
fc4148fe | 24-Jun-2023 |
Tomohiro Kusumi <tkusumi@netbsd.org> |
usr.sbin/makefs: Add HAMMER2 offline read / VOP_READ support
The offline read takes HAMMER2 specific "-o R" option. `image-file` argument is a valid HAMMER2 image file or block device. Unlike other
usr.sbin/makefs: Add HAMMER2 offline read / VOP_READ support
The offline read takes HAMMER2 specific "-o R" option. `image-file` argument is a valid HAMMER2 image file or block device. Unlike other offline commands, `directory` must be a valid directory.
e.g. $ makefs -t hammer2 -o R=/path/to/file /dev/adx /a/b/c $ makefs -t hammer2 -o R=/path/to/file /path/to/hammer2.img /a/b/c
The "-o R" option requires file path argument. The file is retrieved from `image-file` and written to a file under `directory`. In the examples above, /path/to/file is retrieved as /a/b/c/file on success.
show more ...
|
89a3eb16 | 23-Jun-2023 |
Tomohiro Kusumi <tkusumi@netbsd.org> |
usr.sbin/makefs/hammer2: Support VOP_READLINK
This makes possible for path component lookup against HAMMER2 image to handle symlinks with limitations below.
1. It can't support symlink with absolut
usr.sbin/makefs/hammer2: Support VOP_READLINK
This makes possible for path component lookup against HAMMER2 image to handle symlinks with limitations below.
1. It can't support symlink with absolute path destination by design, unless you can assume a given image is to be mounted at /. 2. It currently doesn't support "..". This is another non obvious case where a path could reach to outside of the image.
The regular HAMMER2 image creation doesn't use this (instead makefs uses real readlink(2) when scanning a source directory).
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 ...
|
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 ...
|
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 ...
|
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 ...
|
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 ...
|