History log of /freebsd-10.1-release/sbin/badsect/badsect.c
Revision Date Author Comments
(<<< Hide modified files)
(Show modified files >>>)
# 272461 02-Oct-2014 gjb

Copy stable/10@r272459 to releng/10.1 as part of
the 10.1-RELEASE process.

Approved by: re (implicit)
Sponsored by: The FreeBSD Foundation

# 256281 10-Oct-2013 gjb

Copy head (r256279) to stable/10 as part of the 10.0-RELEASE cycle.

Approved by: re (implicit)
Sponsored by: The FreeBSD Foundation


# 227081 04-Nov-2011 ed

Add missing static keywords for global variables to tools in sbin/.

These tools declare global variables without using the static keyword,
even though their use is limited to a single C-file, or without placing
an extern declaration of them in the proper header file.


# 139648 03-Jan-2005 rwatson

The badsect(8) utility uses atol(), which doesn't allow very good error
checking and only recognizes numbers in base 10. The attached patch
checks errno after strtol() and uses a base of 0 to allow octal, or hex
sector numbers too.

PR: 73112
Submitted by: keramida
MFC after: 2 weeks


# 128073 09-Apr-2004 markm

Remove advertising clause from University of California Regent's license,
per letter dated July 22, 1999.

Approved by: core, imp


# 114589 03-May-2003 obrien

Use __FBSDID() to quiet GCC 3.3 warnings.


# 111265 22-Feb-2003 johan

Remove unused variable to make badsect WARNS=2 clean.


# 109600 20-Jan-2003 jmallett

Convert badsect to use libufs.


# 107294 27-Nov-2002 mckusick

Create a new 32-bit fs_flags word in the superblock. Add code to move
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.


# 102231 21-Aug-2002 trhodes

s/filesystem/file system/g as discussed on -developers


# 98542 21-Jun-2002 mckusick

This commit adds basic support for the UFS2 filesystem. The UFS2
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>


# 96707 16-May-2002 trhodes

more file system > filesystem


# 96478 12-May-2002 phk

Sigh, more BBSIZE related breakage.

Sponsored by: DARPA & NAI Labs.


# 92753 20-Mar-2002 imp

Kill register


# 92538 18-Mar-2002 imp

o Use real prototypes and ANSI function definitions.
o Remove __P.


# 78732 24-Jun-2001 dd

Include missing header files which define functions for which gcc has
builtins (e.g., exit, strcmp).


# 68521 09-Nov-2000 adrian

Remove the block/char device distinction. badsect only worked on bdevs,
and then mapped /dev/foo into /dev/rfoo to get to the character device.
This isn't needed anymore.

Reviewed by: ps


# 50476 27-Aug-1999 peter

$Id$ -> $FreeBSD$


# 37233 28-Jun-1998 bde

Fixed printf format errors.


# 36626 04-Jun-1998 charnier

Correct use of .Nm. Add section number to .Xr. Add rcsid, usage(). Use err(3).


# 18485 24-Sep-1996 bde

Eliminated includes of the "temporary" backwards compatibility header
<sys/dir.h> in applications. Maintained existing (inadequate) ifdefs
for dir.h vs dirent.h in libdialog, amd and rarpd, but didn't add any
new ones.


# 7590 02-Apr-1995 bde

Submitted by: Philippe Charnier <charnier@lirmm.fr>, added to by bde

Fix all the warnings from `gcc -Wall'.


# 7589 02-Apr-1995 bde

Make this actually work. It always failed in FreeBSD because it attempted
to open the mounted block device containing the directory to put the bad
sector files in, and opening of mounted block devices hasn't been allowed
since Net/2 or before. Attempt to open the raw device instead. Be more
careful about long names.

Use lstat() instead of stat() to search for block devices so that my
symlink to the default floppy doesn't cause problems.

Check for truncation of the block number when it is squeezed through the
mknod() interface. The maximum used to be only 32767, but now it large
enough.


# 1559 26-May-1994 rgrimes

This commit was generated by cvs2svn to compensate for changes in r1558,
which included commits to RCS files with non-trunk default branches.


# 1558 26-May-1994 rgrimes

BSD 4.4 Lite sbin Sources

Note: XNSrouted and routed NOT imported here, they shall be imported with
usr.sbin.