host, and vice versa), to fix PR#44203.
Add support for growing (but not yet shrinking) UFS2 file systems. Partially
addresses PR#44205.
While I'm here, reformat the code for closer adherence to KNF.
Fairly extensive testing was performed, using the shortly-to-be-committed
updated ATF tests. Patch posted to tech-userlevel on 21 December 2010,
no comments.
unsupported, while catching up to some changes in my local tree which
will hopefully support them at some time in the future.
Also, change "device" variable to "special", to reflect the fact
that resize_ffs will work on a plain file.
and depending on file system data, can actually be a false error.
Fixes what I was actually testing for in bin/44209, though the
actual problem was not what I originally described.
copy appropriate data to where they are expected in the updated superblock.
When writing the updated superblock, move the updated values back to the
old ffsv1 superblock locations. Also check for old superblock format when
updating the last cylinder group and adjust cg_old_ncyl appropriately.
Derived from how mksf sets them. Should address PR bin/44209.
to ensure it's been properly extended. Clears up some problems at certain
blocksizes which showed up during creation of atf tests, which is done
using file-backed file systems.
when testing that the last sector of the new size is writeable, make
sure we're ACTUALLY writing in the new space, instead of possibly
overwriting something in the existing fs.
Discovered while writing tests - tests which uncovered file corruption at
certain block sizes.
XXX should rewrite writeat() to expect fs blocks instead of disk blocks.
OK mlelstv@
- sync usage comment with current reality
- sort includes
- wrap lines
- use EXIT_FAILURE consistently
- make error messages consistent: Cannot->Can't
- Remove "Old FFSv1 macros" in favor of system macros in ufs/ffs/fs.h .
Leave dblksize() because it uses the on-disk dinode structure.
More cleanup is needed.
No functional changes intended.
were commented out with XXX and a notation to "fix once fsck is fixed."
fsck seems to have been fixed for this particular issue sometime in the
7 years since the code was brought into the tree.
Update cg_old_niblk instead of cg_ni_blk, since this tool
currently supports ffsv1 only.
With these two changes, I can grow a file system and have the result
be clean according to fsck_ffs. Shrinking still results in an unclean
file system.
OK mhitch@
While I'm here, fix a typo in an error message.
filesystem on a vnd partition for me. It did grow the filesystem, and after
a fsck -f on the partition to fix a few superblock inconsistencies, all
looks good.
finding an ffsv1 sb at 64k.
Also stop it playing with fs that have 'FS_FLAGS_UPDATED' set.
It certainly doesn't act on that falg, and my guess is that it is
playing the pre-ffsv2 fs.
Fixes part of PR kern/24809
I didn't have time to clean it up completely before my legal status
w.r.t. open source projects goes into limbo for a while. Other
developers are encouraged to play with the tool and get it into
release-worthy shape.
TODO list (see TODO file)
* verify it builds on -current, put it into release lists/etc. and src/sbin/Makefile
(built & tested on 1.6.1)
* make it ask questions before doing any work (confirm)
* create regression test suite (see discussions on tech-kern and
developers) and fix any bugs
* verify conversion to ANSI C didn't break anything
* port to UFS2