The pid file was getting created before the fork(), so it had the
incorrect pid number. No one noticed for a while, since "uuidd -k"
will kill the daemon and it has enough automatic convenience functions
that it's usually not necessary to refer to the pid file except as a
convenient place for uuidd to lock against multiple instances of the
daemon starting up.
Addresses-Sourceforge-Bug: #1893244
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
This isn't necessary since we don't install the init.d script (and
it's not the recommended way to start uuidd anyway).
Addresses-Sourceforge-Bug: #1885085
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Since recent kernels have a tendency to set this feature willy-nilly,
let's just enable by default. It's only very old kernels that don't
support it any more.
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
This makes it easier to upgrade to ext4 in the future, and it speeds
up extended attributes handling --- important on SELinux systems!
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
The test_fs flag is an "ok to be used with test kernel code" flag. It
makes it easier for us to determine whether a filesystem should be
mounted using ext4 or not.
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
If the disk fills while e2image is writing its output file, it will
spew a large number of error messages instead of exiting with a
non-zero status code after the first failure.
Addresses-Sourceforge-Feature-Request: #606508
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Add a configure option which causes the uuidd helper daemon not to be
built or used by the uuid library.
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Use an improved locking protocol based on the pid file to assure that
only one uuidd is started. Apparently the kernel does not prevent
multiple processes from racing to bind to a Unix domain socket.
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Also store the clock sequence information in a state file in
/var/lib/misc/uuid-clock so that if the time goes backwards the clock
sequence counter can get bumped. This allows us to completely
correctly generate time-based (version 1) UUID's according to the
algorithm specified RFC 4122.
Addresses-Sourceforge-Bug: #1529672
Addresses-Red-Hat-Bugzilla: #233471
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Fuse and ssh fstab lines such as:
wdfs#https://dav.hoster.com/foo/bar /mnt/hoster fuse user,noauto 0 0
will cause fsck to issue warnings about invalid fstab lines, because
fsck was previously treating '#' as a comment when it appeared
anywhere in an fstab line, not just at the beginning of the line.
Addresses-Gentoo-bug: #195405
Addresses-Sourceforge-bug: #1826147
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
When printing the value of tags in a formatted format, print control
characters and characters with the high eight bit set using the ^ and
M- notation, respectively. This prevents a filesystem with a garbage
label from potentially screwing up the user's screen (for example,
putting it into graphical mode).
Addresses-Ubuntu-Bug: #78087
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
In raw mode (-r), e2image appends an extra byte to the image-file's
end if the last block requires a sparse write. Consequently, the
resulting image-file is one byte larger than the original in
size. This patch fixes the problem by seeking to one less than the
given offset, so that the byte write does not overflow into the next
block.
This problem can be reproduced by doing an e2image -r dev image-file
and comparing the original and resulting image sizes. This assumes the
image is sparse at the end. For my tests, I created a 100MB sparse
image with two files.
Signed-off-by: Arun Thomas <thomasar@us.ibm.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
The -R option is only used for backwards compatibility, and -E is
preferred, so change the usage message accordingly.
Signed-off-by: Coly Li <coyli@suse.de>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
If a user specifies a bind mount with a non-zero fsck pass number, for
example:
/foo /bar ext3 bind,defaults 1 3
print a warning and ignore the fstab entry.
Addresses-Red-Hat-Bugzilla: #151533
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Fix up $(root_sysconfdir) handling misc/Makefile.in so that
make install and make uninstall works correctly when $prefix != /.
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
People are getting surprised by mke2fs creating filesystems with
different defaults than earlier versions of mke2fs if mke2fs.conf is
not present. Having gotten two complaints about ramdisks getting
created by with 4k blocksizes which then blow up when the ramdisk is
mounted with a "Magic mismatch, very weird" error message from the
kernel, let's fix this by making sure mke2fs has a built-in version of
mke2fs.conf file. People can still override the built-in version of
mke2fs.conf by editing /etc/mke2fs.conf, but this maintains the
previous behavior.
Addresses-Sourceforge-Bug: #1745818
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
This patch changes ext2fs_open() to set EXT2_FLAG_MASTER_SB_ONLY by
default. This avoids some problems in e2fsck (reported by Jim Garlick)
where a corrupt journal can end up writing the bad superblock to the
backups. In general, only e2fsck (after the filesystem is clean),
tune2fs, and resize2fs should change the backup superblocks by default.
Most callers of ext2fs_open() should not be touching anything where the
backups should be touched. So let's change the defaults to avoid
potential problems.
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
A quick patch to sanity check the inode ratio vs the inode size. In
some cases Lustre users have tried specifying an inode size of 4096
bytes, while keeping an inode ratio of one inode per 4096 bytes. I'm
sure more people will do this now that large inodes are available in
ext4 and documented in e2fsprogs.
Signed-off-by: Andreas Dilger <adilger@clusterfs.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Store the RAID stride value when a filesystem is created with a requested
RAID stride, and then use it automatically in resize2fs.
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Mke2fs is supposed to set the uid/gid ownership of the root directory when
a non-rooot user creates the filesystem. This wasn't working correctly
if the uid/gid was > 16 bits. In additional, debugfs wasn't displaying
large uid/gid's correctly. This patch fixes these two programs.
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
One of our testers filed a bug that said "mkfs.ext3 is much slower
when mke2fs.conf is missing..."
This is because the shipped defaults in mke2fs.conf do not match the
shipped defaults in the mkfs code itself; he wound up making a 1k
block filesystem on a very large block device, for example.
So - How about this patch, to bring them back into line? Which makes
me wonder; having "defaults" in 2 different places is bound to get out
of sync; should we instead generate both code & config file defaults
(and maybe man page defaults) from a common source?
Anyway, here's a patch to bring mke2fs.conf and mke2fs.c into line for
current defaults...
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Increase the maximum size of the journal to 100 times the previous
maximum, but add a restriction that it can be no more than half the size
of the filesystem.
Signed-off-by: Andreas Dilger <adilger@clusterfs.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
The memory allocated by inst is not reclaimed. There also was a
call to exit that coverity did not catch the resource leak. This
might not really be a big issue since the memory will be freed when
fsck exits, but it should be done anyway imho.
Coverity ID: 32: Resource Leak
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
zero_buf and buf must be freed on return from the
output_meta_data_blocks() function.
Coverity ID: 26+27: Resource Leak
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
If the fs_type is not specified and we are creating a journal device, to
use a fs_type of "journal"; this used to be the behavior before we added
support for the /etc/mke2fs.conf file, so let's fix it to restore the
old behavior.
Coverity ID: 4: Deadcode
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Change all of the e2fsprogs programs to use the newer add_error_table()
and remove_error_table() interfaces instead of the much older
initialize_*_error_table() function.
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Add support for the new flag EXT2_FLAG_SOFTSUPP_FEATURES flag to
ext2fs_open() , which allows application to open filesystes with features
which are currently only partially supported by e2fsprogs.
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Badblocks now interprets last_block argument as the last block to check,
instead of the number of blocks to check, to be consistent with the
badblocks man page.
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Fix revision 0 error checking so that it doesn't give spurious error
when the user gives a command-line option of "-O none".Add error
checking so that "-r 0 -j", "-r 0 -s 1", and "-r 0 -E resize=XXX" will
print an explanatory error message and abort.
Addresses Debian bug: #392107
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>