Use "stanza" to refer to top-level stanzas, and fix a few typos. Also
indent the sample profile format so it looks nicer.
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
The x86 assembly instructures for bit test-and-set, test-and-clear,
etc., interpret the bit number as a 32-bit signed number, which is
problematic in order to support filesystems > 8TB.
Added new inline functions (in C) to implement a
ext2fs_fast_set/clear_bit() that does not return the old value of the
bit, and use it for the fast block/bitmap functions.
Added a regression test suite to test the low-level bit operations
functions to make sure they work correctly.
Note that a bitmap can address 2**32 blocks requires 2**29 bytes, or
512 megabytes. E2fsck requires 3 (and possibly 4 block bitmaps),
which means that the block bitmaps can require 2GB all by themselves,
and this doesn't include the 4 or 5 inode bitmaps (which assuming an
8k inode ratio, will take 256 megabytes each). This means that it's
more likely that a filesystem check of a filesystem greater than 2**31
blocks will fail if the e2fsck is dynamically linked (since the shared
libraries can consume a substantial portion of the 3GB address space
available to x86 userspace applications). Even if e2fsck is
statically linked, for a badly damaged filesystem, which may require
additional block and/or inode bitmaps, I am not sure e2fsck will
succeed in all cases.
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Fixed a bug caused by using an insufficiently larger counter field so
that mklost+found would work properly on filesystems with larger block
sizes.
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Integrate profile_std_line() into parse_line(), and profile_parse_file()
into profile_update_file() to make the code use less memory.
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Make the libdevmapper fail quietly if blkid is called without root
privileges or the kernel does not include device mapper support.
(What is the device mapper _library_ doing writing to stderr, anyway?)
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Change the format string(%d, %ld) for a block number and inode number
to %u or %lu.
Signed-off-by: Takashi Sato <sho@tnes.nec.co.jp>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
If the filesystem is mounted, open it in read-only mode since the userspace
program should not try to modify it directly. If the filesystem is not mounted,
open it in exclusive mode to avoid potential problems (such as someone
trying to mount the filesystem while it is being resized).
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Thanks to Andreas Dilger for this idea. If the filesystem is not mounted,
e2fsck will open it in exclusive mode to prevent the a confused/careless
system administrator from mounting the filesystem while the filesystem
check is taking place, which could cause all sorts of problems.
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
This flag when specified to ext2fs_open or ext2fs_initialize indicates
that the application wants the io_channel to be opened in exclusive mode.
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Add a new io_channel open flag, IO_FLAG_EXCLUSIVE,which requests that
the device be opened in exclusive (O_EXCL) mode. Add support to the unix_io
implementation for this flag.
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Add missing real-subdirs:: line to lib/Makefile.library, so there is a
default definition of the real-subdirs target.
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Users have reported problems on newly installed systems when the
Macintosh's system clock battery is dead and the hardware clock is
returning a date of 1904. Turns out there were some bugs in handling
dates before the Unix epoch.
Addresses Red Hat Bug: #182188
probe.c (blkid_verify): Fix the bid_time sanity checking logic,
so that if last verification time is more recent than the
current time, or the comparison between the last
verification time and the current time causes an overflow,
a device verification will take place.
devname.c (blkid_get_dev): Set the initial bid_time to be
INT_MIN, to guarantee that blkid_verify will always be run
even when the system clock is insane.
dev.c (blkid_debug_dump_dev), read.c (debug_dump_dev),
save.c (save_dev): Fix the printf format for dev->bid_time
to match the fact that it is an signed type.
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
The previous fix which fixed the problem with GNU make 3.81 building
all of the library object files caused GNU make 3.80 fail because the
subdirectories (such as elfshared) were not getting created. This fix
should allow the Makefiles to work with both GNU make 3.80 and GNU
make 3.81.
If the filesystem has an external journal, store the UUID of the
external journal in the tag EXT_JOURNAL.
If the filesystem type has changed, clear all the tags on the device,
not just a preset list of LABEL, UUID, TYPE, and SEC_TYPE.
Fix a bug so that blkid_set_tag will work correctly when freeing a tag
when the input name parameter comes from the tag that we are freeing.
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Check to see if the superblock hint for the external journal needs to
be updated, and if so, offer to update it. (Addresses Debian Bug:
#355644)
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
(This was an artifact of the migration of the sources from BitKeeper
to Mercurial; mea culpa, mea maximum culpa --- Ted)
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Hello Ted,
here is a minor fixup with debugfs "icheck" finding a block in an EA.
It was reporting the inode number as one too low because it was set
after the EA check is done.
From: Andreas Dilger <adilger@clusterfs.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
On systems where is multi-path storage device is problem with duplicated
filesystems. The solution is select "the best" device. This is possible
by device-mapper library.
Short quotation from RH bugzilla:
With my patch, all dm devices remains in libblkid cache.
Only the top level dm devices are given high priority
and more appropriate node names (i.e. /dev/mapper/*) are used.
For example, if we have linear mapped dm device "ov1" over
dm device "disk1p3" which is multipath mapped to /dev/sdd3 and /dev/sdh3:
# dmsetup.static ls --tree
ov1 (253:5) <-- /dev/mapper/ov1 or /dev/dm-5
`-disk1p3 (253:4) <-- /dev/mapper/disk1p3 or /dev/dm-4
`-disk1 (253:0)
|- (8:112) <-- /dev/sdh
`- (8:48) <-- /dev/sdd
Original version of blkid will show:
# ./orig/blkid -t LABEL=mpdisk1p3 -l
/dev/sdd3: LABEL="mpdisk1p3" ... TYPE="ext3"
With my patch, blkid will show:
# ./deptree/blkid -t LABEL=mpdisk1p3 -l
/dev/mapper/ov1: LABEL="mpdisk1p3" ... TYPE="ext3"
In blkid cache, all devices are listed:
# ./orig/blkid -t LABEL=mpdisk1p3
/dev/sdd3: LABEL="mpdisk1p3" ... TYPE="ext3"
/dev/sdh3: LABEL="mpdisk1p3" ... TYPE="ext3"
/dev/dm-4: LABEL="mpdisk1p3" ... TYPE="ext3"
/dev/dm-5: LABEL="mpdisk1p3" ... TYPE="ext3"
# ./deptree/blkid -t LABEL=mpdisk1p3
/dev/mapper/ov1: LABEL="mpdisk1p3" ... TYPE="ext3"
/dev/sdd3: LABEL="mpdisk1p3" ... TYPE="ext3"
/dev/sdh3: LABEL="mpdisk1p3" ... TYPE="ext3"
/dev/dm-4: LABEL="mpdisk1p3" ... TYPE="ext3"
For more details see discussion on:
https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=156324
Addresses Red Hat Bug: #156324
Signed-off-by: Karel Zak <kzak@redhat.com>
Signed-off-by: Peter Jones <pjones@redhat.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Whether fs checks are skipped when the system is running on battery can be
controlled by the new e2fsck.conf option defer_check_on_battery (this option
defaults to TRUE).
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
On Sat, Jan 28, 2006 at 12:53:33PM -0600, Fredrick Knieper wrote:
> Package: e2fsprogs
> Version: 1.38+1.39-WIP-2005.12.31-1
>
> When running fsck at boot or when running e2fsck manually on a device,
> fsck will not check a filesystem based on the maximum mount count,
> unless a flag such as -f or -c is used to force the filesystem check.
What's happening is that when you run on battery, e2fsck will delay
running the filesystem check, on the assumption that it is better to
defer the check until some time in the future when your laptop is
running on AC mains again. This deferral is not infinite, however; if
the number of mounts exceeds twice the max mount counts, or if the
interval between checks exceeds twice the check interval, e2fsck will
force the check even though you are on battery.
I've changed the sources to print a message to make this more clear.
Addresses Debian Bug: #350306
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
This avoids a fd leak across an execve() which was causing problems
for the LVM tools.
(Addresses Debian Bug: #345832)
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
This also changes syntax accepted by the profile parser. The value of
profile relations must not contain spaces unless it is quoted;
otherwise the parser will throw an error. Previously something like
this was allowed:
[liboptions]
test = foo bar
Now, the relation must be in double quotes in order to be valid, i.e.,
"foo bar".
Comments are allowed anywhere and can be started with either a ';' or
a '#' character. The only place where comments will not be intepreted
as beginning a comment is in a quoted string.
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
E2fsck will now report syntax errors in /etc/e2fsck.conf intead of simply
ignoring the config file when there are errors.
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Unified batchmode and command-line handling.
profile_is_node_final() and profile_find_node_relation() are static,
unused functions.
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Fix #include of com_err.h so that it isn't required that the com_err
development environment be installed. (Addresses Debian Bug: #345519)
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Add the ability for the e2fsck configuration file to override the
behaviour of e2fsck when a particular filesystem problem is
encountered. This allows reconnecting an inode to lost+found to not
stop the boot sequence, if a system administrator really badly wants
this behaviour for some specialized reason, for example.
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>