Revision tags: v6.2.1, v6.2.0, v6.3.0, v6.0.1, v6.0.0, v6.0.0rc1, v6.1.0, v5.8.3, v5.8.2, v5.8.1, v5.8.0, v5.9.0, v5.8.0rc1, v5.6.3, v5.6.2, v5.6.1, v5.6.0, v5.6.0rc1, v5.7.0, v5.4.3, v5.4.2, v5.4.1, v5.4.0, v5.5.0, v5.4.0rc1, v5.2.2, v5.2.1, v5.2.0, v5.3.0, v5.2.0rc, v5.0.2, v5.0.1, v5.0.0, v5.0.0rc2 |
|
#
1767454f |
| 30-Sep-2017 |
Tomohiro Kusumi <kusumi.tomohiro@gmail.com> |
sbin/mount_hammer: Remove redundant test_volumes() on mount(2) failure
This code was originally added by 1a607e3e which added signature check when mount(2) failed, and later modified by several comm
sbin/mount_hammer: Remove redundant test_volumes() on mount(2) failure
This code was originally added by 1a607e3e which added signature check when mount(2) failed, and later modified by several commits including 1e297b34 which copied code from sbin/hammer/ondisk.c. But as mentioned in 1e297b34, this entire checking wasn't needed (as it's in dmesg), or it may even show the wrong reason of failure.
The correct way is to just type dmesg, and see what the kernel said, instead of resorting to wild guess in userspace by reading volume header *after* mount(2) failure (If you really want this it should be done *before* mount(2)).
This originally didn't exist till 2009 and that was better.
show more ...
|
Revision tags: v5.1.0, v5.0.0rc1, v4.8.1 |
|
#
688e7182 |
| 17-Apr-2017 |
Tomohiro Kusumi <kusumi.tomohiro@gmail.com> |
sbin/mount_hammer: Use calloc(3) and cleanups
|
#
005a4da7 |
| 14-Apr-2017 |
Tomohiro Kusumi <kusumi.tomohiro@gmail.com> |
sbin/*hammer: Use consistent static/inline/returntype format for functions
Change them to HAMMER2 style which has much more stable code style than HAMMER1. HAMMER1 is basically a mix of every possib
sbin/*hammer: Use consistent static/inline/returntype format for functions
Change them to HAMMER2 style which has much more stable code style than HAMMER1. HAMMER1 is basically a mix of every possible pattern (even in the code originally written only by dillon@).
show more ...
|
#
c967446b |
| 14-Apr-2017 |
Tomohiro Kusumi <kusumi.tomohiro@gmail.com> |
sbin/hammer: Test volume version in __verify_volume()
Since now that HammerVersion is always used by CRC operations, and blkdevs based hammer commands are likely to either test/set CRC, the volume v
sbin/hammer: Test volume version in __verify_volume()
Since now that HammerVersion is always used by CRC operations, and blkdevs based hammer commands are likely to either test/set CRC, the volume version should be checked after volume parameters are loaded from ondisk volume header.
The reason for using >=WIP instead of >MAX is because that's how newfs_hammer checks volume version, though it's currently the same thing.
show more ...
|
#
88356ed4 |
| 10-Apr-2017 |
Tomohiro Kusumi <kusumi.tomohiro@gmail.com> |
sbin/newfs_hammer: Add /* not reached */ for usage()
|
#
9db06424 |
| 10-Apr-2017 |
Tomohiro Kusumi <kusumi.tomohiro@gmail.com> |
sbin/mount_hammer: Add /* not reached */
|
#
34be98df |
| 10-Apr-2017 |
Tomohiro Kusumi <kusumi.tomohiro@gmail.com> |
sbin/mount_hammer: Partly bring back removed braces from a90e74c5
based on comments from dillon@.
(dillon) three types, yah. (1) multi-line condition in if(), (2) if TRUE or FALSE body spans more
sbin/mount_hammer: Partly bring back removed braces from a90e74c5
based on comments from dillon@.
(dillon) three types, yah. (1) multi-line condition in if(), (2) if TRUE or FALSE body spans more than one line, put braces around both (dillon) (including if a comment is part of the body)
show more ...
|
#
a90e74c5 |
| 09-Apr-2017 |
Tomohiro Kusumi <kusumi.tomohiro@gmail.com> |
sbin/mount_hammer: Cleanup blocks with a single statement
This commit basically does the same as what Linux kernel's coding style mentions for braces, which is basically the same with BSDs. https://
sbin/mount_hammer: Cleanup blocks with a single statement
This commit basically does the same as what Linux kernel's coding style mentions for braces, which is basically the same with BSDs. https://github.com/torvalds/linux/blob/master/Documentation/process/coding-style.rst#3-placing-braces-and-spaces
No diff in sbin/mount_hammer/mount_hammer binary when assert(3) is disabled.
show more ...
|
Revision tags: v4.8.0, v4.6.2, v4.9.0, v4.8.0rc |
|
#
25abdf3e |
| 16-Dec-2016 |
Tomohiro Kusumi <kusumi.tomohiro@gmail.com> |
sbin/mount_hammer: Use warn(3) variants
|
#
bac217f3 |
| 15-Dec-2016 |
Tomohiro Kusumi <kusumi.tomohiro@gmail.com> |
sbin/hammer: Change fprintf/exit to err variants [1/2]
Change fprintf(stderr, ...); exit(1); and perror(...); exit(1); to err(1, ...) or errx(1, ...); where possible for consistency.
In test_volume
sbin/hammer: Change fprintf/exit to err variants [1/2]
Change fprintf(stderr, ...); exit(1); and perror(...); exit(1); to err(1, ...) or errx(1, ...); where possible for consistency.
In test_volume(), if open(2)/pread(2) failed, err(1) without scanning rest of the volumes. This function itself is redundant anyway as mentioned in 1e297b34, so no one cares.
Other than that this is just conversion to err(3) variants. Messages themselves are not changed, except for removing strerror(errno) for err(3), and removing trailing \n, though err variants add program name in the messages.
err(3) and variants are non standard BSD functions, but HAMMER userspace has been using BSD stuff aside from the existing err/errx. Also note that err(3) is available in Linux as well.
show more ...
|
#
1e297b34 |
| 03-Nov-2016 |
Tomohiro Kusumi <kusumi.tomohiro@gmail.com> |
sbin/mount_hammer: Fix/cleanup test_volumes()
The requirement of this function is basically the same as __verify_volume() in sbin/hammer/ondisk.c, so make it __verify_volume() based.
Note that this
sbin/mount_hammer: Fix/cleanup test_volumes()
The requirement of this function is basically the same as __verify_volume() in sbin/hammer/ondisk.c, so make it __verify_volume() based.
Note that this function doesn't necessarily print the real reason mount(2) failed, as shown in a comment. This function just takes a wild guess with sanity checks on volume header. The real reason is likely to be in dmesg. This originally didn't exist, but was added by 1a607e3e in 2009.
show more ...
|
#
920e34fa |
| 03-Nov-2016 |
Tomohiro Kusumi <kusumi.tomohiro@gmail.com> |
sbin/mount_hammer: Simplify ondisk verification
Unlike sbin/hammer or sbin/newfs_hammer, sbin/mount_hammer has no restriction regarding I/O size since it's readonly. It doesn't have to be 16KB as lo
sbin/mount_hammer: Simplify ondisk verification
Unlike sbin/hammer or sbin/newfs_hammer, sbin/mount_hammer has no restriction regarding I/O size since it's readonly. It doesn't have to be 16KB as long as I/O size meets the requirement of read(2) over a raw block device.
show more ...
|
Revision tags: v4.6.1 |
|
#
2998e5e0 |
| 16-Oct-2016 |
Tomohiro Kusumi <kusumi.tomohiro@gmail.com> |
sbin/mount_hammer: Add missing switch case from bab16452
The previous commit bab16452 needed 1..15 case for expected values, so as not to show an irrelevant message via default case.
|
#
bab16452 |
| 16-Oct-2016 |
Tomohiro Kusumi <kusumi.tomohiro@gmail.com> |
sbin/mount_hammer: Fix warning messages
Add warning messages for -1 and non-0-15 for master_id.
-1 and 0-15 inclusive are the only supoprted values, so remove probably from the existing warning mes
sbin/mount_hammer: Fix warning messages
Add warning messages for -1 and non-0-15 for master_id.
-1 and 0-15 inclusive are the only supoprted values, so remove probably from the existing warning message.
show more ...
|
#
b3dd5035 |
| 15-Oct-2016 |
Tomohiro Kusumi <kusumi.tomohiro@gmail.com> |
sbin/hammer: Add volume signature check on loading a volume
|
Revision tags: v4.6.0, v4.6.0rc2, v4.6.0rc, v4.7.0 |
|
#
fe3b711b |
| 17-Apr-2016 |
Tomohiro Kusumi <kusumi.tomohiro@gmail.com> |
sbin/mount_hammer: Remove duplicated MOPT_UPDATE macro definition
include/mntopts.h has this for getmntopts(3).
mount_dirfs(8) has this too probably because it's been copy-pasted from mount_hammer(
sbin/mount_hammer: Remove duplicated MOPT_UPDATE macro definition
include/mntopts.h has this for getmntopts(3).
mount_dirfs(8) has this too probably because it's been copy-pasted from mount_hammer(8) though this commit doesn't touch that. (the one in mount_devfs(8) is if0'd)
# grep MOPT_UPDATE . -riI | grep define ./contrib/smbfs/mount_smbfs/mntopts.h:#define MOPT_UPDATE { "update", 0, MNT_UPDATE, 0 } ./include/mntopts.h:#define MOPT_UPDATE { "update", 0, MNT_UPDATE, 0 } ./sbin/mount_devfs/mount_devfs.c:#define MOPT_UPDATE { "update", 0, MNT_UPDATE, 0 } ./sbin/mount_dirfs/mount_dirfs.c:#define MOPT_UPDATE { "update", 0, MNT_UPDATE, 0 } ./sbin/mount_hammer/mount_hammer.c:#define MOPT_UPDATE { "update", 0, MNT_UPDATE, 0 }
show more ...
|
Revision tags: v4.4.3, v4.4.2, v4.4.1, v4.4.0 |
|
#
e73c3403 |
| 23-Nov-2015 |
Tomohiro Kusumi <kusumi.tomohiro@gmail.com> |
sys/vfs/hammer: Remove const from volume names
struct hammer_mount_info having const char** for volume names was not necessary.
mount_hammer(8) needs to be able to free info->volumes[i] since these
sys/vfs/hammer: Remove const from volume names
struct hammer_mount_info having const char** for volume names was not necessary.
mount_hammer(8) needs to be able to free info->volumes[i] since these names are strdup'd char* but not pointers to argv[i].
Also see aeb72a17.
show more ...
|
Revision tags: v4.5.0, v4.4.0rc |
|
#
586b3d29 |
| 25-Sep-2015 |
Tomohiro Kusumi <kusumi.tomohiro@gmail.com> |
sbin/mount_hammer: Fix mount(2) error handling
Move mount(2) error handling code to a newly added function test_volumes().
* Omit printing strcated volume names since this is obvious from an erro
sbin/mount_hammer: Fix mount(2) error handling
Move mount(2) error handling code to a newly added function test_volumes().
* Omit printing strcated volume names since this is obvious from an error message for each volume. Also note mount(2) could fail when open(2), read(2) and signature check, etc don't fail which makes this confusing (see 331432f3). * Add vol_count check in addition to signature check.
show more ...
|
#
aeb72a17 |
| 25-Sep-2015 |
Tomohiro Kusumi <kusumi.tomohiro@gmail.com> |
sbin/mount_hammer: Minor fix and cleanups
(Note that -Werror=cast-qual doesn't allow freeing info->volumes[i]. It was better without const given that blkdevs format arg requires parsing + strdup)
|
#
b519f4e8 |
| 24-Sep-2015 |
Tomohiro Kusumi <kusumi.tomohiro@gmail.com> |
sbin/mount_hammer: Minor fixes and cleanups
|
#
87b8f936 |
| 17-Sep-2015 |
Tomohiro Kusumi <kusumi.tomohiro@gmail.com> |
sys/vfs/hammer: Fix incomplete mountctl(2) vop behavior
mount(8) is unable to print nomirror mount option while other two (nohistory, master=) are properly printed. This is because hammer's mountctl
sys/vfs/hammer: Fix incomplete mountctl(2) vop behavior
mount(8) is unable to print nomirror mount option while other two (nohistory, master=) are properly printed. This is because hammer's mountctl and mount flags aren't implemented the way vfs expects them to be. mount(8) generates option strings by mountctl(2).
===== missing nomirror string # mount_hammer -o nohistory -o master=5 -o nomirror /dev/da1:/dev/da2:/dev/da3 /HAMMER # mount | grep /HAMMER TEST on /HAMMER (hammer, local, nohistory, master)
===== using this commit # mount_hammer -o nohistory -o master=5 -o nomirror /dev/da1:/dev/da2:/dev/da3 /HAMMER # mount | grep /HAMMER TEST on /HAMMER (hammer, local, nohistory, master, nomirror)
This commit adds HMNT_NOMIRROR using a reserved HMNT_RESERVED and assigns HMNT_NOMIRROR to nomirror. This is necessary since two options (master=, nomirror) using the same HMNT_MASTERID is the root cause of above behavior.
This change would affect userspace in theory, however the only userspace that would actually use these mount option flags is mount command itself (for inbox userspace programs at least). It's more important that hammer properly handles mount(8).
This commit also adds a missing nomirror mountctl element in hammer_vop_mountctl() using HMNT_NOMIRROR so mountctl becomes aware of nomirror option.
The reason nomirror needs to use HMNT_NOMIRROR instead of HMNT_MASTERID is because vfs_flagstostr() assumes each option has an unique flag (see vfs_flagstostr() where it does the following). flags &= ~optp->o_opt;
This could have been fixed by changing above vfs code, but fixing hammer code is probably the right approach. Also note that master= and nomirror options aren't alias of each other. These two are similar but they do have different purpose, which should make sense to have independent flags, and that's what vfs expects.
show more ...
|
#
f1e2cdee |
| 15-Sep-2015 |
Tomohiro Kusumi <kusumi.tomohiro@gmail.com> |
sbin/mount_hammer: Remove typedef ary_ptr_t
It makes code more clear and readable without this typedef which is only used for the first arg of extract_volumes().
info.volumes is char**, and an arra
sbin/mount_hammer: Remove typedef ary_ptr_t
It makes code more clear and readable without this typedef which is only used for the first arg of extract_volumes().
info.volumes is char**, and an array internally used within the function is char**, then using char*** for the first arg is better than using typedef for char**.
show more ...
|
Revision tags: v4.2.4 |
|
#
331432f3 |
| 02-Aug-2015 |
Tomohiro Kusumi <kusumi.tomohiro@gmail.com> |
sbin/mount_hammer: Fix error messages
It's possible that open(2) and signature check do not fail but mount(2) still fails possibly because of fs's bug. When that happens (it actually did happen righ
sbin/mount_hammer: Fix error messages
It's possible that open(2) and signature check do not fail but mount(2) still fails possibly because of fs's bug. When that happens (it actually did happen right now) fdevs remains with no valid string strcatted. Add an error message for such case.
Also change printf(); to fprintf(stderr);.
show more ...
|
#
96c170df |
| 02-Aug-2015 |
Tomohiro Kusumi <kusumi.tomohiro@gmail.com> |
sbin/mount_hammer: Fix upper limit of volume num
(ac - 1) is for the command arg which is in blkdevs format. info.nvolumes is the number of volumes after dissecting blkdevs format.
|
Revision tags: v4.3.1, v4.2.3 |
|
#
da490817 |
| 09-Jul-2015 |
Tomohiro Kusumi <kusumi.tomohiro@gmail.com> |
sbin/mount_hammer: Fix indentation
|