summaryrefslogtreecommitdiff
path: root/lib/e2p
AgeCommit message (Collapse)AuthorFilesLines
2011-09-25ext2fs: add multi-mount protection (INCOMPAT_MMP)Andreas Dilger2-1/+9
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-18Shorten compile commands run by the build systemTheodore Ts'o21-25/+65
The DEFS line in MCONFIG had gotten so long that it exceeded 4k, and this was starting to cause some tools heartburn. It also made "make V=1" almost useless, since trying to following the individual commands run by make was lost in the noise of all of the defines. So fix this by putting the configure-generated defines in lib/config.h and the directory pathnames to lib/dirpaths.h. In addition, clean up some vestigal defines in configure.in and in the Makefiles to further shorten the cc command lines. Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2011-09-16libe2p: reach unreachable codeEric Sandeen1-3/+4
The EOPNOTSUPP case is unreachable, being outside a set of: #if ... return; #else ... return; #endif Fix this up so that if neither HAVE_CHFLAGS nor HAVE_EXT2_IOCTLS applies, we set EOPNOTSUPP. Signed-off-by: Eric Sandeen <sandeen@redhat.com> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2011-09-16e2fsprogs: annotate intentional fallthroughs in case statementsEric Sandeen3-0/+5
Using the /* fallthrough */ comment lets Coverity (and humans) know that we really do want to fall through in these case statements. Signed-off-by: Eric Sandeen <sandeen@redhat.com> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2011-09-16debugfs: add 64-bit support to the set_field commandsTheodore Ts'o1-1/+1
The set_fields commands (set_super_value, set_inode_field, set_block_group) now handle fields which store in split fields on ext4's on-disk format. For example, the superblock fields s_blocks_count and s_blocks_count_hi. The user can either set the low or high part of the field via "blocks_count_lo" or "blocks_count_hi", or both parts can be set via "blocks_count". Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2011-09-16libext2fs: add metadata checksum and snapshot feature flagsTheodore Ts'o2-0/+8
Reserve EXT4_FEATURE_RO_COMPAT_METADATA_CSUM and EXT2_FEATURE_COMPAT_EXCLUDE_BITMAP. Also reserve fields in the superblock and the inode for the checksums. In the block group descriptor, reserve the exclude bitmap field for the snapshot feature, and checksums for the inode and block allocation bitmaps. With this commit, the metadata checksum and exclude bitmap features should have reserved all of the fields they need in ext4's on-disk format. This commit also fixes an a missing byte swap for s_overhead_blocks. Signed-off-by: "Theodore Ts'o" <tytso@mit.edu> Cc: Darrick J. Wong <djwong@us.ibm.com> Cc: Amir Goldstein <amir73il@gmail.com>
2011-09-16Merge branch 'maint' into nextTheodore Ts'o1-1/+1
2011-09-15libe2p: fix bug so that MNTOPT_ options can be successfully parsedTheodore Ts'o1-1/+1
Thanks to Israel G. Lugo for pointing this out. Addresses-Debian-Bug: #641667 Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2011-06-11misc: fix compile warnings on OSXAndreas Dilger4-15/+18
The BLKFLSBUF and FDFLUSH ioctls are Linux specific, and do not really have anything to do with __GNUC__ (which is also used on OS/X and Solaris). Only print these warnings on Linux systems. statfs64() is deprecated on OSX and generates a deliberate warning. Fix some other warnings that show up on OSX builds. Signed-off-by: Andreas Dilger <adilger@whamcloud.com> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2011-06-11misc: clean up compiler warningsAndreas Dilger1-2/+2
Fix several types of compiler warnings (unused variables/labels), uninitialized variables, etc that are hit with gcc -Wall. Signed-off-by: Andreas Dilger <adilger@whamcloud.com> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2011-03-18Merge branch 'maint' into nextTheodore Ts'o1-0/+3
Conflicts: lib/e2p/ls.c
2011-03-18add new superblock field: s_overhead_blocksTheodore Ts'o1-0/+3
It turns out that it's very hard to calculate overheads in the face of clustered allocation (bigalloc). This is because multiple metadata blocks from different block groups can end up in the same allocation cluster. Calculating the exact overhead requires O(all block bitmaps) in memory, or O(number of block groups**2) in time. So we will calculate this at mkfs time and stash it in the superblock. Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2011-02-27Merge branch 'maint' into nextTheodore Ts'o2-2/+22
Conflicts: lib/ext2fs/initialize.c
2011-02-25Add basic BIGALLOC support for cluster-based allocationTheodore Ts'o2-2/+14
This adds the superblock fields needed so that dumpe2fs works and the code points and renames the superblock fields from describing fragments to clusters. Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2011-02-25e2fsprogs: reserving code points for new ext4 quota featureAditya Kali2-0/+8
This patch adds support for detecting the new 'quota' feature in ext4. The patch reserves code points for usr and group quota inodes and also for the feature flag EXT4_FEATURE_RO_COMPAT_QUOTA. Signed-off-by: Aditya Kali <adityakali@google.com> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2010-09-24Merge branch 'maint' into nextTheodore Ts'o2-0/+6
Conflicts: configure configure.in lib/ext2fs/ext2fs.h misc/mke2fs.c
2010-09-18tune2fs, debugfs, libext2fs: Add support for ext4 default mount optionsTheodore Ts'o2-0/+6
Add support for 2.6.35's new default mount options which can be specified in the superblock. Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2010-07-19Merge branch 'maint' into nextTheodore Ts'o1-0/+42
Conflicts: resize/extent.c
2010-07-05Add superblock fields which track first and most recent fs errorsTheodore Ts'o1-0/+31
Add superblock fields which track where and when the first and most recent file system errors occured. These fields are displayed by dumpe2fs and cleared by e2fsck. Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2010-06-24Add support for Next3 snapshot superblock fields to dumpe2fs and debugfsTheodore Ts'o1-0/+11
We also support for byte-swapping the Next3 fields, although the current Next3 implementation doesn't support big-endian systems. Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2010-06-07Merge branch 'maint' into nextTheodore Ts'o21-41/+90
Conflicts: e2fsck/journal.c e2fsck/pass1.c e2fsck/pass2.c misc/mke2fs.c
2010-05-17libe2p, libext2fs: Update file copyright permission states to match COPYINGTheodore Ts'o21-41/+90
The top-level COPYING file states that the e2p and ext2fs libraries are available under the LGPLv2. The files were incorrectly labelled. Alex Thomas/Luster has been consulted wrt to the ext3_extents.h file; the rest of the files were primarily authored by Theodore Ts'o. Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2009-07-02Add support for configure --enable-verbose-makecmdsTheodore Ts'o1-21/+21
Some people don't want to see the concise "kernel-style" make output. This configure option allows build engines that want to see the full set of commands executed by the makefile to get what they want. Most people will find this more distracting than useful, unless they need to debug the Makefiles. (It is not necessary to rerun configure to enable this verbose make output temprarily; if a developer wants to do a quick debug of a directory's makefile, he or she can simply edit the definition of the $(E) and $(Q) variables in the Makefile; instructions can be found in the MCONFIG file which is included in at the beginning of every Makefile.) Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2009-07-21libe2p: Add new function parse_num_blocks2()Valerie Aurora Henson2-1/+7
Signed-off-by: Valerie Aurora Henson <vaurora@redhat.com> Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2009-06-01e2p: Print 64-bit block numbers in the superblockTheodore Ts'o1-3/+23
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2009-05-28chattr: manpage tidyupsEric Sandeen1-1/+1
Tidy up the chattr(1) manpage to completely document all available options, and differentiate those which are read-only early in the manpage as well. * Remove "I" from settable attribute list * add "e" to 2nd list of settable attributes & descriptions * Note that h/E/I/X/Z are readonly * Correct "H" to "h" for huge file attribute description * fix long_name for indexed directory in flags_array Addresses-Red-Hat-Bugzilla: BZ#502971 Signed-off-by: Eric Sandeen <sandeen@redhat.com> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2009-04-22libe2p: Declare prototypes for the journal feature name functions in e2p.hTheodore Ts'o1-0/+2
Define the prototypes for e2p_jrnl_feature2string() and e2p_jrnl_string2feature() in e2p.h. This promotes better error checking and avoids warnings when compiling the library and programs that call these functions. Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2009-03-06Add support for a new superblock field: s_kbytes_writtenTheodore Ts'o1-0/+18
This field tracks the lifetime amount of writes to the filesystem. It will be updated by the kernel as well as by e2fsprogs programs which write to the filesystem. Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-09-02Fix pkg-config files: use Requires.private and fix the include directoryTheodore Ts'o1-1/+1
Addresses-Sourceforge-Bug: #2089537 Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-09-01libe2p: Fix potential core-dumping bug in iterate_on_dir()Theodore Ts'o1-3/+3
iterate_on_dir() can try to copy too much data from the directory entry, resulting in a crash. Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-08-29Update makefile dependency for lib/e2p/Makefile.inTheodore Ts'o1-1/+9
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-08-27Remove trailing whitespace for the entire source treeTheodore Ts'o15-45/+45
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-08-24libe2p: Fix namespace leakage of os_tabTheodore Ts'o1-1/+1
Make os_tab static, since there's no reason it should be exposed. Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-08-24add debugfs command to print known featuresAndreas Dilger3-2/+141
Print out the currently supported features of e2fsprogs/libext2fs via a new "debugfs supported_features" command. This helps scripts to know whether it is possible to try and enable specific features in the filesystem. Signed-off-by: Kalpak Shah <kalpak.shah@sun.com> Signed-off-by: Andreas Dilger <adilger@sun.com> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2008-08-15Fix a typo in lib/e2p/Makefile.inLi Zefan1-1/+1
Signed-off-by: Li Zefan <lizf@cn.fujitsu.com> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2008-04-22Basic flexible block group supportTheodore Ts'o1-0/+3
Add superblock definition, and dumpe2fs and debugfs support. Signed-off-by: Jose R. Santos <jrs@us.ibm.com> Signed-off-by: Valerie Clement <valerie.clement@bull.net> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2008-04-20libe2p: Print the s_min_extra_isize and s_wanted_extra_isize fieldsTheodore Ts'o1-1/+7
Make dumpe2fs and debugfs print out the s_min_extra_isize and s_wanted_extra_isize fields from the superblock. Update tests expect files as appropriate. Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-04-17Change the primary name of the extents feature to be 'extent'Theodore Ts'o1-2/+2
This was the original name used by Lustre's patches; keep the plural when converting feature names to a feature mask for compatibility's sake. Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-04-17Rename the feature uninit_groups to uninit_bgTheodore Ts'o1-0/+2
Allow the old name of uninit_groups when converting feature names for backwards compatibility for scripts running mke2fs and tune2fs. Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-04-17Add support for the HUGE_FILE featureTheodore Ts'o1-0/+1
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-03-20Rename feature name from gdt_checksum to uninit_groupsJose R. Santos1-1/+1
This name is a more intuitive option when running mke2fs. Signed-off-by: Jose R. Santos <jrs@us.ibm.com> Signed-off-by: Andreas Dilger <adilger@clusterfs.com> Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-02-27Merge branch 'maint'Theodore Ts'o3-10/+46
Conflicts: lib/blkid/devname.c lib/blkid/probe.c misc/mke2fs.c misc/tune2fs.c
2008-02-26libe2p: New e2p_edit_feature2 which provides better error handlingTheodore Ts'o2-8/+44
This creates a new enhanced edit_feature function for libe2p which supports a different set of feature flags that are OK to clear as opposed to set, and which returns more specific information about why the user provided an invalid edit feature command. Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-02-22libe2p: Change Raid to RAID in display optionTheodore Ts'o1-2/+2
Update m_raid_opt test so that it reflects the code change. Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-02-18Merge branch 'maint' into nextTheodore Ts'o1-0/+6
2008-02-18libe2p: Make list_super2() print the RAID stride and stripe-widthTheodore Ts'o1-0/+6
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-01-27Merge branch 'maint' into nextTheodore Ts'o1-2/+6
Conflicts: configure lib/ext2fs/ext2_fs.h misc/e2image.c
2008-01-26Add support for the test_fs flagTheodore Ts'o1-2/+6
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>
2007-11-03Merge basic FLEX_BG supportTheodore Ts'o1-0/+2
Merge commit 'c2d4300b8a4a13d8a78b86c386f76259f23feec2' into next
2007-11-03Enable FLEX_BG feature supportJose R. Santos1-0/+2
Add FLEX_BG as a supported feature bit. Add support to mke2fs to create filesystems with FLEX_BG. Add support to tune2fs to add (and remove, if it won't break filesystem consistency) the FLEX_BG feature. Signed-off-by: Jose R. Santos <jrs@us.ibm.com> Signed-off-by: "Theodore Ts'o" <tytso@mit.edu> -- lib/e2p/feature.c | 2 ++ lib/ext2fs/ext2fs.h | 6 ++++-- misc/mke2fs.c | 7 ++++++- 3 files changed, 12 insertions(+), 3 deletions(-)