#
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 ...
|
#
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 ...
|
#
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 ...
|
#
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 ...
|
#
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 ...
|
#
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 ...
|
#
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 ...
|
#
aa86710a |
| 22-Apr-2023 |
Tomohiro Kusumi <tkusumi@netbsd.org> |
usr.sbin/makefs/hammer2: Avoid #include "makefs.h" in hammer2.h
Not a build error from ddd1d3d1ff2fecb3b58ce152a65095abaf634491, but safer to avoid including "makefs.h" in usr.sbin/makefs/hammer2/ha
usr.sbin/makefs/hammer2: Avoid #include "makefs.h" in hammer2.h
Not a build error from ddd1d3d1ff2fecb3b58ce152a65095abaf634491, but safer to avoid including "makefs.h" in usr.sbin/makefs/hammer2/hammer2.h which basically shouldn't know anything about makefs(8).
show more ...
|
#
6b469f5b |
| 22-Apr-2023 |
Tomohiro Kusumi <tkusumi@netbsd.org> |
usr.sbin/makefs/hammer2: Include <stdbool.h> for hammer2_update_time()
A bool argument from ddd1d3d1ff2fecb3b58ce152a65095abaf634491 needs <stdbool.h>. It fails to compile on some platforms.
|
#
ddd1d3d1 |
| 18-Apr-2023 |
Tomohiro Kusumi <tkusumi@netbsd.org> |
usr.sbin/makefs/hammer2: Derive timestamp from source inodes
makefs(8) HAMMER2 has been using current time for inode's ctime/mtime. Change hammer2_update_time() to use current fsnode's timestamp. Al
usr.sbin/makefs/hammer2: Derive timestamp from source inodes
makefs(8) HAMMER2 has been using current time for inode's ctime/mtime. Change hammer2_update_time() to use current fsnode's timestamp. Also support -T option.
Note that both hammer2_curnode (current fsnode) and stampst (-T option) are global variables.
show more ...
|
#
8f9d1da1 |
| 30-Jan-2023 |
Tomohiro Kusumi <tkusumi@netbsd.org> |
usr.sbin/makefs: Set HAMMER2 inode mode using source inode
which is also what other makefs fs do.
|
#
e49cd535 |
| 28-Jan-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" 66f2c621b4a3c452381030521ca3bb6dadfba431.. -- sys/vfs/hammer2/ 1d5238a4ed sys/vfs/
usr.sbin/makefs: Sync with sys/vfs/hammer2
Sync with following sys/vfs/hammer2 commits.
$ git log --pretty="%h %s" 66f2c621b4a3c452381030521ca3bb6dadfba431.. -- sys/vfs/hammer2/ 1d5238a4ed sys/vfs/hammer2: Fix -Wpointer-sign warnings on hammer2_dirhash() 1b796c7004 sys/vfs/hammer2: Fix -Wpointer-sign warnings
show more ...
|
#
4e2eefe9 |
| 24-Jan-2023 |
Tomohiro Kusumi <tkusumi@netbsd.org> |
usr.sbin/makefs: Rename struct buf -> m_buf
to reduce unnecessary diff vs FreeBSD makefs.
|
#
6bcbb706 |
| 24-Jan-2023 |
Tomohiro Kusumi <tkusumi@netbsd.org> |
usr.sbin/makefs: Rename struct vnode -> m_vnode
to reduce unnecessary diff vs FreeBSD makefs.
|
Revision tags: v6.4.0, v6.4.0rc1, v6.5.0 |
|
#
00e4ae5c |
| 11-Nov-2022 |
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" 185ae703d726eb41fe0f44e432a9575d06b2ba45.. -- sys/vfs/hammer2/ ae4718daaa sys/vfs/
usr.sbin/makefs: Sync with sys/vfs/hammer2
Sync with following sys/vfs/hammer2 commits.
$ git log --pretty="%h %s" 185ae703d726eb41fe0f44e432a9575d06b2ba45.. -- sys/vfs/hammer2/ ae4718daaa sys/vfs/hammer2: Remove redundant "spmp->iroot = NULL;" ee92f60939 sys/vfs/hammer2: Fix many comments be41253d2a sys/vfs/hammer2: Rename HAMMER2_BREF_FLAG_ZERO -> HAMMER2_BREF_FLAG_UNUSED 64eadfb368 sys/vfs/hammer2: Fix incorrect reservedXXX names in ondisk structure 6feb58ab26 sys/vfs/hammer2: Minor cleanups for hammer2_disk.h 4b2ec0813c sys/vfs/hammer2: Move HAMMER2_{CHECK,COMP}_STRINGS to sbin/hammer2 cca587dd52 sys/vfs/hammer2: Move HAMMER2_METH_DEFAULT from hammer2_disk.h to hammer2.h d21704d78e sys/vfs/hammer2: Fix a typo in a source code comment fac0c41fdd sys/vfs/hammer2: Fix "already initialized" multi-volumes error message 6763396fd5 sys/vfs/hammer2: Remove redundant error check in hammer2_vfs_mount() 12757b74e2 sys/vfs/hammer2: Make fchain/vchain dump on last drop consistent a011271d2d sys/vfs/hammer2: Remove comments on removed stuff e6a1580946 sys/vfs/hammer2: Remove obsolete comment on HAMMER2_RESOLVE_RDONLY e8e30c7644 sys/vfs/hammer2: Remove obsolete comment in hammer2_vop_readdir() 25b8f48546 sys/vfs/hammer2: #if0 hammer2_chain_lock_unhold()/hammer2_chain_unlock_hold() b5513ad07d sys/vfs/hammer2: Use correct XOP struct in hammer2_xop_{lookup,delete} 5b691df11e sys/vfs/hammer2: hammer2_dump_chain() should belong to hammer2_chain.c 92931eab21 sys/vfs/hammer2: Use HAMMER2_PFSTYPE_NONE rather than 0 16f0b63d7f sys/vfs/hammer2: Make sure PFS exists after chain lookup on mount 4b0205e630 sys/vfs/hammer2: hammer2_ioctl_inode_{get,set} never returns error 634b6e30ca sys/vfs/hammer2: Add include guard for hammer2_xxhash.h bc7ea12e61 sbin/hammer2: Remove HAMMER1 comment from dirhash() 47f63aa5d3 sys/vfs/hammer2: Rename hammer2_chain_core_init() -> hammer2_chain_init() 507074cda8 sys/vfs/hammer2: Change readonly purpose sysctls to CTLFLAG_RD 39b691836e sys/vfs/hammer2: Use __debugvar for RB_INSERT() result only used in KKASSERT a4959f8900 sys/vfs/hammer2: Use __debugvar rather than trying to use it outside KASSERT 9944926ceb sys/vfs/hammer2: Avoid unused warning when !INVARIANTS
show more ...
|