Commit Graph

6420 Commits

Author SHA1 Message Date
christos
7e254cfb82 Remove getdisksize support; we either have the ioctls (current/-7) or we
don't (non-netbsd-current/7+tools).
2015-11-29 15:32:46 +00:00
christos
2d178fa50d Add the missing cases. 2015-11-29 14:12:56 +00:00
christos
4ab2c2d9c7 Add some debugging. 2015-11-29 14:12:35 +00:00
christos
c313281022 Do division once 2015-11-29 14:03:35 +00:00
christos
f8906ab68d Only use the ioctl's if we have them. 2015-11-29 13:46:23 +00:00
jnemeth
1ca10bc795 fix build breakage for systems that do not have DIOCG{SECTOR,MEDIA}SIZE 2015-11-29 13:24:28 +00:00
christos
2599c179cc print the current map type. 2015-11-29 00:34:39 +00:00
christos
5435e55eab - use snprintf
- fix bogus logic on map_type
2015-11-29 00:15:12 +00:00
christos
ca4e0dcdd1 merge the create errors in one place and fix them. 2015-11-29 00:14:46 +00:00
pgoyette
e6045f6364 Add cross-refs from modload(8) amd modunload(8) to modctl(2) 2015-11-28 23:53:48 +00:00
christos
35da36c439 CID 1340063: fix TOCTOU 2015-11-24 14:07:18 +00:00
christos
fc8a4870ed Don't chdir to the config directory; just form the parameters file with a
path if needed.
2015-11-22 20:24:19 +00:00
christos
cd40e75014 explain how to clear an entry (without reading the source) 2015-11-22 15:53:10 +00:00
christos
d59d77037c - update NAME_MAX to match the kernel.
- add a comment about where the constant is used.
2015-11-16 17:06:47 +00:00
jnemeth
6141a178e3 correctly print the gpt header revision as a "float" 2015-11-16 12:24:13 +00:00
tnn
c9f8274c3f fix iSCSI RFC number 2015-11-10 12:41:18 +00:00
christos
51068fec25 print flags symbolically. 2015-11-04 16:04:55 +00:00
ozaki-r
c2e5d2b795 Fix rump.ping6 -c N (N > 1) doesn't work
2nd packet and subsequent packets are sent based on SIGALRM and
it depends on poll(2) returns with EINTR by the signal. However,
currently poll is rump-ified while signals aren't so the signal
doesn't wake up poll and ping6 doesn't work expectedly.

Rump-ifying signals is unsure (nobody does it for now) and the
combination use of signals and poll makes the logic a bit complex.
So let's fix the defect by stopping using signals for packet
transmissions. The new logic is derived from ping(8).

Bonus: ping6 -i 0.01 works as we expect now while the original
didn't work enough fast.
2015-11-04 08:07:54 +00:00
ozaki-r
c94323a777 Fix exit status when -c and -X is used
It exited with status 0 when at least one packet was received
and timed out. However, when we specify -c N (while N > 0),
we expect that it fails if it times out before all sent requests
are replied.
2015-11-04 07:59:25 +00:00
pgoyette
b6f71a3653 Add FLAGS to the module data displayed. Reduce some of the extra
inter-column white-space to (partly) compensate for the additional
column.
2015-11-04 04:30:42 +00:00
knakahara
fad49cfc60 rump.ping6 supports "-S" option. 2015-11-04 01:14:02 +00:00
jnemeth
902aecab13 Add a "header" subcommand that displays information about the size of
the disk along with information from the GPT header if it exists.
2015-11-03 02:19:24 +00:00
christos
1428ec3f79 remove advertising clause. 2015-10-16 17:38:17 +00:00
dholland
6ada0ed75b Teach scan_ffs about lfs64.
(and also about byte-swapped lfs volumes, which might or might not
actually work)
2015-10-15 06:25:23 +00:00
dholland
06de5f4e56 Make dump recognize lfs64.
For now at least it will refuse to touch it though as it needs to be
taught more abstraction about directory entries; currently it blindly
uses struct direct from ffs and will croak on the lfs64 64-bit inode
numbers.
2015-10-15 06:25:12 +00:00
dholland
ae64c38ebb Enable lfs64 in fsck_lfs.
(and in everything else that uses this code)
2015-10-15 06:24:55 +00:00
dholland
511153d2cc Enable the creation of lfs64 volumes.
To create an lfs64 volume, use -w 64. You can also force a 32-bit
volume with -w 32, but this will fail on devices thta are too large.

lfs64 is the default for devices > 1TB. (1TB rather than 2TB because
daddr_t is signed and negative block numbers can cause interesting
complications.)

For now print a warning that the lfs64 format isn't finalized, because
it isn't. For now any lfs64 use should be limited to test data,
benchmarking, and so forth.
2015-10-15 06:24:33 +00:00
christos
fec59bb419 these are syslog-like 2015-10-14 15:53:24 +00:00
mrg
28d34520d5 don't stop processing /etc/fstab when one entry fails, both for
add and remove loops.  now when you add a new swap file and run
"swapctl -A" it won't give up after the existing one gives EBUSY
and move on to the rest.
2015-10-11 23:58:16 +00:00
dholland
0a6370d92e Use a specific SEGSUM size instead of the size of the union. 2015-10-10 22:34:19 +00:00
dholland
f3729261c1 Track down and fix two missing uses of SEGSUM_FINFOBASE(). 2015-10-10 22:34:09 +00:00
dholland
da7186290f The per-inode state 'id_entryno' is used by pass1 for a block count,
so widen it to 'long long'. pass2 uses it for the number of entries in
a directory (IIUC) which does not need to be wider than int, but for
now let's not try to split into two fields. FUTURE...
2015-10-03 08:30:13 +00:00
dholland
a07fd0a2a2 Use daddr_t instead of uint32_t for the in-memory copy of the inode
block pointers.
2015-10-03 08:30:02 +00:00
dholland
896006c986 Drop an explicit sign-extension in fsck that shouldn't be needed any
more.
2015-10-03 08:29:48 +00:00
dholland
93f2a7d5e8 Add lfs_checkword type for reading checksum data out of structures.
This is always uint32_t, but having a name for it both makes things
clearer and avoids confusion about whether it should be 32 or 64 bit.

Note: deployed in only one place (that was erroneously tagged
ondisk32) so far.
2015-10-03 08:29:34 +00:00
dholland
db7a6054ae Fix hardwired 32-bit stuff in fsck:
- compute the maximum file size using LFS_BLKPTRSIZE()
   - use the new IINFO in pass 6 instead of uint32_t pointers
   - use accessors to read and write indirect blocks
2015-10-03 08:29:21 +00:00
dholland
b82b54bc04 Remove a dead data structure. 2015-10-03 08:29:06 +00:00
dholland
7f7a5fa1e3 Apply IINFO in the other userland tools. 2015-10-03 08:28:46 +00:00
dholland
a407c8d218 Use IINFO in lfs_writeinode().
(both the kernel and the userland copies)
2015-10-03 08:28:15 +00:00
mrg
710e06c668 add smart IDs 210, 246, 247 and 248 (Micron):
+       { 210,          "Successful RAIN Recovery Count", NULL },
+       { 246,          "Total Host Sector Writes", NULL },
+       { 247,          "Contact Factory (Micron)", NULL },
+       { 248,          "Contact Factory (Micron)", NULL },

(eek i hope 247 and 248 don't move.)
2015-09-21 06:05:00 +00:00
dholland
cfe9c0210f Fix some assorted 32-bit assumptions not yet otherwise handled.
Also apply patch to fix the overt problem in PR 50246: newfs was
calculating ifpb wrong for volumes with non-default block sizes.
2015-09-21 01:24:58 +00:00
dholland
947343ea0e Add 64-bit directory entry structures, and adjust accessors accordingly.
The LFS64 directory entry has a 64-bit inode number. This is stored as
two 32-bit values to avoid inducing 64-bit alignment requirements.

The exposed type for manipulating directory entries is now
LFS_DIRHEADER, following the same convention as e.g. IFILE and SEGUSE.
(But with LFS_ on it, because.)
2015-09-21 01:24:23 +00:00
dholland
80201f5aa5 Oops; LFS_DIRECTSIZ() is going to need the fs as an argument.
Also, it turns out that dirhash needs a compile-time-constant version
of LFS_DIRECTSIZ(LFS_MAXNAMLEN+1), independent of 64-vs-32, so create
LFS_MAXDIRENTRYSIZE for this. Sigh.
2015-09-21 01:22:18 +00:00
dholland
75caa729bb Clean up struct lfs_dirtemplate. 2015-09-20 04:51:43 +00:00
dholland
805a8504cb Pass around struct lfs_dirheader instead of struct lfs_direct. 2015-09-15 15:02:25 +00:00
dholland
98320dbc87 Add an accessor function for directory names. 2015-09-15 15:02:01 +00:00
dholland
653d6346b1 Add a function lfs_copydirname() to copy directory names in place; use
it in place of (variously) memcpy and strlcpy. (The latter isn't even
correct; was probably changed blindly from strncpy at some point.)

The new function zeroes the padding in the directory entry instead of
leaving trash behind.
2015-09-15 15:01:38 +00:00
dholland
06be19e226 Tidyups/fixes preparatory to making d_name[] in struct lfs_direct size
0 instead of size LFS_MAXNAMLEN+1, and preparatory to having accessor
functions for d_name. In particular, don't create prototype entries
and copy them, and access the name field only for directory structures
that are in buffers with space for the name to exist.
2015-09-15 15:01:22 +00:00
dholland
c2c4048b2d Move the header part of struct lfs_direct to its own structure.
(lfs_dirheader)

Take the opportunity to improve the directory generation code in
make_lfs.c. (Everything else was unaffected by virtue of using
accessor functions.)
2015-09-15 14:59:58 +00:00
dholland
5a97d9e5b6 Add and use accessor functions for more of the directory entry fields. 2015-09-15 14:58:05 +00:00