summaryrefslogtreecommitdiff
path: root/misc/util.h
AgeCommit message (Collapse)AuthorFilesLines
2011-09-28mke2fs: set s_max_mnt_count to -1 by defaultTheodore Ts'o1-1/+1
If the enable_periodic_fsck option is false in /etc/mke2fs.conf (which is also the default), s_max_mnt_count needs to be set to -1, instead of 0. Kernels newer than 3.0 will interpret 0 to disable periodic checks, but older kernels will print a warning message on each mount, which will annoy users. Addresses-Debian-Bug: #632637 Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2011-09-25ext2fs: add multi-mount protection (INCOMPAT_MMP)Andreas Dilger1-0/+1
Multi-mount protection is feature that allows mke2fs, e2fsck, and others to detect if the filesystem is mounted on a remote node (on SAN disks) and avoid corrupting the filesystem. For e2fsprogs this means that it checks the MMP block to see if the filesystem is in use, and marks the filesystem busy while e2fsck is running on the system. This is useful on SAN disks that are shared between high-availability servers, or accessible by multiple nodes that aren't in HA pairs. MMP isn't intended to serve as a primary HA exclusion mechanism, but as a failsafe to protect against user, software, or hardware errors. There is no requirement that e2fsck updates the MMP block at regular intervals, but e2fsck does this occasionally to provide useful information to the sysadmin in case of a detected conflict. For the kernel (since Linux 3.0) MMP adds a "heartbeat" mechanism to periodically write to disk (every few seconds by default) to notify other nodes that the filesystem is still in use and unsafe to modify. Originally-by: Kalpak Shah <kalpak@clusterfs.com> Signed-off-by: Johann Lombardi <johann@whamcloud.com> Signed-off-by: Andreas Dilger <adilger@whamcloud.com> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2011-09-13mke2fs: Use ext2fs_flush() only onceLukas Czerner1-1/+1
We are doing ext2fs_flush() twice right now at the end of the mke2fs. First by directly calling ext2fs_flush() which is intended to write superblock and fs accounting information. And then it is invoked again when we are calling ext2fs_close(), only this time, because the fs is not dirty, we are writing out only superblock. I think it is bad to call it twice because even when writing only super block it takes some time on bigger file systems and moreover ext2fs_close() can fail without any reasonable explanation for the user. Also ext2fs_flush() is printing out progress and it is confusing for the users. Fix all this by removing the ext2fs_flush() and leaving it all to ext2fs_close(). However we need to introduce new variables to store check interval and max mount count, because fs structure is freed on ext2fs_close() and we really want to print those information as the last info for the user. [ Fixed type mismatch in a printf format statement -tytso] Signed-off-by: Lukas Czerner <lczerner@redhat.com> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2008-08-27Remove trailing whitespace for the entire source treeTheodore Ts'o1-1/+1
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2007-08-03Fix gcc -Wall warningsTheodore Ts'o1-1/+1
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2002-02-25Add check for mkfs.ext3 and create a journal in this case.Andreas Dilger1-0/+1
2001-12-16Fix various gcc -Wall nits. Fixed a bug in mke2fs where a bogusTheodore Ts'o1-1/+1
error message could be printed on an malloc() failure, and e2image was optimized to avoid needless system calls by using the stashed inode functions.
2001-06-14ChangeLog, mke2fs.c, tune2fs.8.in, tune2fs.c, util.c, util.h:Theodore Ts'o1-1/+1
tune2fs.c, mke2fs.c, util.c, util.h (print_check_message): Move the message which displays how often the filesystem will be checked from mke2fs into a utility subroutine. Then cause tune2fs to call that function to display the message after adding a journal to a filesystem. mke2fs.8.in: Add manual page fixups and explanation for why it's good to check filesystems periodically from Andreas Dilger.
2001-03-26ChangeLog, mke2fs.8.in, mke2fs.c, tune2fs.8.in, tune2fs.c, util.c, util.h:Theodore Ts'o1-1/+2
ke2fs.8.in, tune2fs.8.in: Change man paegs to document that the journal must be bewteen 1024 and 10,240 file system blocks. mke2fs.c, tune2fs.c: Change to use figure_journal_size() util.c, util.h (figure_journal_size): Change journal_default_size into routine which also converts the requested journal size into filesystem blocks and does bounds checking to make sure the journal is sized reasonably. Renamed function to journal_default_size. parse_journal_opts): Remove bounds check for the journal size, since this is now done in figure_journal_size, and based on the number of filesystem blocks, as opposed to using the absolute size of the journal.
2001-01-18ChangeLog, util.c, util.h:Theodore Ts'o1-0/+1
util.h, util.c (journal_default_size): New function from Andreas Dilger to calculate an appropriate default journal size given a filesystem size. util.c (parse_journal_opts): Allow the creation of a journal as small as 1MB.
2001-01-03ChangeLog, Makefile.in, mke2fs.c, tune2fs.8.in, tune2fs.c, util.c, util.h:Theodore Ts'o1-0/+23
tune2fs.c (update_feature_set, add_journal): Moved to separate functions. Added ability to add and remove the journal while the filesystem is live. Added support for setting a time-based UUID. Removed zero-initialized static variables. mke2fs.c, util.c, util.h (strcasecmp, proceed_question, check_plausibility, parse_journal_opts, check_mount): Moved functions to util.c so they can be used by tune2fs. mke2fs.c (main): Change ext2fs_add_journal_fs() to ext2fs_add_journal_inode() to reflect function renaming.