summaryrefslogtreecommitdiffstats
path: root/sbin/growfs/growfs.c
Commit message (Collapse)AuthorAgeFilesLines
* When growing a UFS1 filesystem, we need to initialise all inodes in any newgavin2010-02-131-4/+2
| | | | | | | | | | | | | | | | | | | | | cylinder groups that are created. When the filesystem is first created, newfs always initialises the first two blocks of inodes, and then in the UFS1 case will also initialise the remaining inode blocks. The changes in growfs.c 1.23 broke the initialisation of all inodes, seemingly based on this implementation detail in newfs(8). The result was that instead of initialising all inodes, we would actually end up initialising all but the first two blocks of inodes. If the filesystem was grown into empty (all-zeros) space then the resulting filesystem was fine, however when grown onto non-zeroed space the filesystem produced would appear to have massive corruption on the first fsck after growing. A test case for this problem can be found in the PR audit trail. Fix this by once again initialising all inodes in the UFS1 case. PR: bin/115174 Submitted by: Nate Eldredgei nge cs.hmc.edu Reviewed by: mjacob MFC after: 1 month
* Quiet spurious warnings.mckusick2010-02-111-8/+8
|
* Remove dead code. This section of code is only run in thegavin2010-01-021-10/+4
| | | | | | | | | | (sblock.fs_magic == FS_UFS1_MAGIC) case, so the check within the loop is redundant. Submitted by: Nate Eldredge nge cs.hmc.edu Reviewed by: mjacob Approved by: ed (mentor) MFC after: 1 month
* The cylinder group tag cg_initediblk needs to match the number of inodesmjacob2009-10-051-2/+8
| | | | | | | | | actually initialized. In the growfs case for UFS2, no inodes were actually being initialized and the number of inodes noted as initialized was the number of inodes per group. This created a filesystem that was deemed corrupted because the inodes thus added were full of garbage. MFC after: 1 month
* Fix an int overflow on very large file systems.das2007-12-171-2/+2
| | | | | PR: bin/113399 Submitted by: Staffan Ulfberg <staffan@ulfberg.se>
* Remove duplicated assignment.stefanf2006-07-171-1/+0
|
* Remove \n at the end of err(3) stringscharnier2005-01-161-7/+5
|
* 3 important fixes for growfs:scottl2004-10-091-22/+42
| | | | | | | | | | | | | | | | | | | | | | | 1) ginode() is passed a cylinder group number and inode number. The inode number is relative to the cg. Use this relative number rather than the absolute inode number when searching the cg inode bitmap to see if the inode is allocated. Using the absolute number quickly runs the check off the end of the array and causes invalid inodes to be referenced. 2) ginode() checks the absolute indoe number to make sure that it is greater than ROOTINO. However, the caller loops through all of the possible inode numbers and directly passes in values that are < ROOTINO. Instead of halting the program with an error, just return NULL. 3) When allocating new cylinder groups, growfs was initializing all of the inodes in the group regardless of this only being required for UFS1. Not doing this for UFS2 provides a significant performance increase. These fixes allow growing a filesystem beyond a trivial amount and have been tested to grow an 8GB filesystem to 1.9TB. Much more testing would be appreciated. Obtained from: Sandvine, Inc.
* Catch up with recent gcc changes and introduce a DIP_SET macrole2004-07-291-2/+8
| | | | | to use when setting values that depend on the UFS version. Raise WARNS again.
* Include <time.h> instead of depending on namespace pollution in <sys/stat.h>bde2004-04-041-0/+1
| | | | for the declaration of time().
* Fix the remaining warnings of growfs(8) on my sparc64 box withmux2004-04-031-4/+4
| | | | | | | | WARNS=6. I don't change the WARNS level in the Makefile because I didn't tested this on other archs. The fs.h fix was suggested by: marcel Reviewed by: md5(1)
* - Don't abuse caddr_t when what we really want is a void *.mux2004-04-031-4/+5
| | | | | | | - Use the %jd format and a cast to intmax_t to print an int64_t. - The return type of getopt() is an int, not a char. This fixes some warnings but there's still much more work to do here.
* Make growfs WARNS=6 clean.le2004-04-031-34/+38
| | | | Approved by: grog (mentor)
* Don't read an inode which isn't used to avoid problems on UFS2 where notle2004-03-261-0/+8
| | | | | | all inodes are initialized when running newfs. Approved by: grog (mentor)
* Remove a few unused variables.trhodes2003-10-301-3/+2
|
* Understand GEOM. This makes growfs work again, but it really needs rewriting.grog2003-05-121-28/+57
| | | | | Submitted by: Lukas Ertl <l.ertl@univie.ac.at> Approved by: re (scottl)
* Fix typos in comments; some style(9) fixes; no code changes.schweikh2003-04-261-121/+117
| | | | | PR: misc/50979 Submitted by: Lukas Ertl <l.ertl@univie.ac.at>
* Fix typos, mostly s/ an / a / where appropriate and a few s/an/and/schweikh2002-12-301-1/+1
| | | | Add FreeBSD Id tag where missing.
* Create a new 32-bit fs_flags word in the superblock. Add code to movemckusick2002-11-271-2/+1
| | | | | | | | | | | | | | | | | the old 8-bit fs_old_flags to the new location the first time that the filesystem is mounted by a new kernel. One of the unused flags in fs_old_flags is used to indicate that the flags have been moved. Leave the fs_old_flags word intact so that it will work properly if used on an old kernel. Change the fs_sblockloc superblock location field to be in units of bytes instead of in units of filesystem fragments. The old units did not work properly when the fragment size exceeeded the superblock size (8192). Update old fs_sblockloc values at the same time that the flags are moved. Suggested by: BOUWSMA Barry <freebsd-misuser@netscum.dyndns.dk> Sponsored by: DARPA & NAI Labs.
* Use the standardized CHAR_BIT constant instead of NBBY in userland.mike2002-09-251-4/+5
|
* s/filesystem/file system/g as discussed on -developerstrhodes2002-08-211-19/+19
|
* This commit adds basic support for the UFS2 filesystem. The UFS2mckusick2002-06-211-395/+316
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | filesystem expands the inode to 256 bytes to make space for 64-bit block pointers. It also adds a file-creation time field, an ability to use jumbo blocks per inode to allow extent like pointer density, and space for extended attributes (up to twice the filesystem block size worth of attributes, e.g., on a 16K filesystem, there is space for 32K of attributes). UFS2 fully supports and runs existing UFS1 filesystems. New filesystems built using newfs can be built in either UFS1 or UFS2 format using the -O option. In this commit UFS1 is the default format, so if you want to build UFS2 format filesystems, you must specify -O 2. This default will be changed to UFS2 when UFS2 proves itself to be stable. In this commit the boot code for reading UFS2 filesystems is not compiled (see /sys/boot/common/ufsread.c) as there is insufficient space in the boot block. Once the size of the boot block is increased, this code can be defined. Things to note: the definition of SBSIZE has changed to SBLOCKSIZE. The header file <ufs/ufs/dinode.h> must be included before <ufs/ffs/fs.h> so as to get the definitions of ufs2_daddr_t and ufs_lbn_t. Still TODO: Verify that the first level bootstraps work for all the architectures. Convert the utility ffsinfo to understand UFS2 and test growfs. Add support for the extended attribute storage. Update soft updates to ensure integrity of extended attribute storage. Switch the current extended attribute interfaces to use the extended attribute storage. Add the extent like functionality (framework is there, but is currently never used). Sponsored by: DARPA & NAI Labs. Reviewed by: Poul-Henning Kamp <phk@freebsd.org>
* more file system > filesystemtrhodes2002-05-161-8/+8
|
* Remove 'register' keyword.obrien2002-03-201-1/+1
| | | | | | It does not help modern compilers, and some may take some hit from it. (I also found several functions that listed *every* of its 10 local vars with "register" -- just how many free registers do people think machines have?)
* Removed duplicate VCS ID tags, as per style(9).ru2001-08-131-1/+0
|
* fixing a bug in test mode (growfs -N)chm2001-08-081-0/+15
| | | | | | Submitted by: Chris Boltwood <chris@hiendmedia.com> Reviewed by: tomsoft MFC after: 5 days
* cleanup to get rid of most warnings on alphatomsoft2001-06-071-83/+95
| | | | | | | and yes now it also works on alpha Reviewed by: chm MFC after: 3 weeks
* fix a bug of a only partitally initialization which could resulttomsoft2001-06-051-1/+2
| | | | | | | in an unclean filesystem after growing by a large amount of cylinder groups Reviewed by: chm
* corrected spelling mistakes in commentstomsoft2000-12-121-110/+144
| | | | | | | | | | check a couple of mallocs usage of errx linebreaks of DBG_ macros, correcting the usage of nroff macros Submitted by: grog, charnier Reviewed by: chm
* added growfs(8) including ffsinfo(8) to the freebsd base systemtomsoft2000-12-091-0/+2476
Reviewed by: grog
OpenPOWER on IntegriCloud