History log of /external/e2fsprogs/lib/ext2fs/ext2_fs.h
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
e0ed7404719a9ddd2ba427a80db5365c8bad18c0 20-Mar-2014 JP Abgrall <jpa@google.com> Switch back to 1.42.9 now that there is a fix

Revert "Revert changes that moved from 1.41.14 to 1.42.9"

This reverts commit 65f0aab98b20b5994a726ab90d355248bcddfffd.
65f0aab98b20b5994a726ab90d355248bcddfffd 06-Mar-2014 JP Abgrall <jpa@google.com> Revert changes that moved from 1.41.14 to 1.42.9

Revert "e2fsck: Don't use e2fsck_global_ctx unless HAVE_SIGNAL_H"
commit e80e74c41d85ff93f3d212ba6512340f48054a93.

Revert "Merge remote-tracking branch 'linaro/linaro-1.42.9' into aosp_master"
This reverts commit e97b2b6fc82f840e84dfc631b87f21be44ff2421, reversing
changes made to 7e2fb9d09c245eba70ee008b78007315e9c0f1df.

Revert "Prepare for upstream 1.42.9"
This reverts commit 7e2fb9d09c245eba70ee008b78007315e9c0f1df.

Bug: 13340735
Change-Id: If48b153a95ef5f69f7cdccb00e23524abff3c5a8
Signed-off-by: JP Abgrall <jpa@google.com>
11d1116a7c0b833af317249d12025413fecbcd70 23-Dec-2013 Andreas Dilger <adilger@dilger.ca> e2fsck: verify s_desc_size is power-of-two value

Add a LOG2_CHECK mode for check_super_value() so that it is easy
to verify values that are supposed to be power-of-two values
(s_desc_size and s_inode_size so far). In ext2fs_check_desc()
also check for a power-of-two s_desc_size.

Print out s_desc_size in debugfs "stats" and dumpe2fs output, if
it is non-zero.

It turns out that the s_desc_size validation in check_super_block()
is not currently used by e2fsck, because the group descriptors are
verified earlier by ext2fs_check_desc(), and even without an
explicit check of s_desc_size the group descriptors fail to align
correctly on disk. It makes sense to keep the check_super_block()
regardless, in case the code changes at some point in the future.

Signed-off-by: Andreas Dilger <adilger@dilger.ca>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
0796e660859724f304155e094b6cf5739a610ae4 12-Jun-2012 Theodore Ts'o <tytso@mit.edu> lsattr, chattr: add support for btrfs's No_COW flag

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
660b4c3b3fd78d0da408643b9c09b47becb5521a 12-May-2012 Theodore Ts'o <tytso@mit.edu> Reserve the codepoints for the INCOMPAT features LARGEDATA and INLINEDATA

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
010dc7b90d97b93907cbf57b3b44f1c1cad234f6 23-Mar-2012 Lukas Czerner <lczerner@redhat.com> e2fsck: remove EXT4_EOFBLOCKS_FL flag handling

We've decided to remove EOFBLOCKS_FL from the ext4 file system entirely,
because it is not actually very useful and it is causing more problems
than it solves. We're going to remove it from e2fsprogs first and then
after the new e2fsprogs version is common enough we can remove the
kernel part as well.

This commit changes e2fsck to not check for EOFBLOCKS_FL. Instead we
simply search for initialized extents past the i_size as this should not
happen. Uninitialized extents can be past the i_size as we can do
fallocate with KEEP_SIZE flag.

Also remove the EXT4_EOFBLOCKS_FL from lib/ext2fs/ext2_fs.h since it is
no longer needed.

Signed-off-by: Lukas Czerner <lczerner@redhat.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
991211f676f49c6cf30af368dade2f81287f1fa8 17-Feb-2012 Theodore Ts'o <tytso@mit.edu> libext2fs, libe2p: Reserve RO_COMPAT_REPLICA feature

The replica is a feature which stores multiple copies of the key
metadata blocks so a single block failure in failure-prone media
(read: certain types of flash storage) doesn't take out the entire
file system.

Discussion on the upstream list proved not to be very positive on this
feature; the arguments were that it added complexity that wasn't
warrented, since common practice in industry is to insist on reliable
media, and if media is unreliable, you're kind of toast anyway (unless
the file system is being used as the back-end store of a cluster file
system where checksuming and data replication is happening above the
local disk file system level). So, this feature is being developed
out of tree.

We reserve the code points so that other people won't accidentally
step on them. Since it's not upstream, it's a soft reservation, but
it's not like we have any shortage of RO_COMPAT features. We are a
bit more tight on reserved inodes, but EXT2_BOOT_LOADER_INO and
EXT2_UNDEL_DIR_INO are not currently used anywhere, and
EXT2_EXCLUDE_INO is a reservation for another out-of-tree feature.
There are no features currently being discussed which require a
reserved inode, but if a need were to arise, we can claw back code
point reservations that were never used or not in tree, as those will
always be considered lower priority than in-tree features.

Cc: Aditya Kali <adityakali@google.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
0f5eba7501f467f757792ee449d16c9259b994fd 24-Sep-2011 Andreas Dilger <adilger@whamcloud.com> ext2fs: add multi-mount protection (INCOMPAT_MMP)

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>
ae96c678e15eda2a5d0eea7e1067b449f6604aff 16-Sep-2011 Theodore Ts'o <tytso@mit.edu> libext2s: fix swapfs.c so it builds on big endian systems

Also cleaned up ext2_fs.h, and improved the byte swapping code so the
extra fields in the large inode are properly byte swapped.

Addresses-Debian-Bug: #641838

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
16c581d0e8d931f3cf0005de07481d7380ca4c0c 15-Sep-2011 Theodore Ts'o <tytso@mit.edu> debugfs: add 64-bit support to the set_field commands

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

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
89efc88e65136ece22708cc28ec4124a33feeecd 15-Sep-2011 Theodore Ts'o <tytso@mit.edu> libext2fs: add metadata checksum and snapshot feature flags

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

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>
75405ffde6f87f88c7172bfb431ec085c542ec1a 16-Sep-2011 Theodore Ts'o <tytso@mit.edu> Merge branch 'maint' into next
3fbfad558e01ffbacc14e5a536c4dfec0a0af4f5 15-Sep-2011 Theodore Ts'o <tytso@mit.edu> libext2fs: fix binary and source compatibility with the dump program

The dump program relies on fs->frag_size and the
EXT2_FRAGS_PER_BLOCK() macro. Kind of silly for it to do so, but it's
part of the kludgy way the dump program (which was originally written
for the BSD FFS was ported over to support ext2/3.) Given how it
makes assumptions about the ext2/3/4 file system being similar to the
BSD FFS, it's a bit of a miracle it works for ext4 --- or at least
appears to work...

Addresses-Debian-Bug: #636418

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
9f6ba888f027ba4daf57ac61a11a6dce98e42347 14-Sep-2011 Yongqiang Yang <xiaoqiangnk@gmail.com> resize2fs: add support for new in-kernel online resize ioctl

This is needed to support online resizing for > 32-bit file systems

Signed-off-by: Yongqiang Yang <xiaoqiangnk@gmail.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
d32c915abfb224f6f6659e9cada7e9f759b7e3d2 07-Jul-2011 Theodore Ts'o <tytso@mit.edu> libext2fs: Fix gcc -Wall warnings

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
6a6337c3df7c982eb888764d585ec483a51af16e 05-Jun-2011 Theodore Ts'o <tytso@mit.edu> Merge branch 'maint' into next

ae9e37cd114385764864518057ff854b3f335440 04-Jun-2011 Theodore Ts'o <tytso@mit.edu> libext2fs: change EXT2_MAX_BLOCKS_PER_GROUP() to be cluster size aware

Change the EXT2_MAX_BLOCKS_PER_GROUP so that it takes the cluster size
into account. This way we can open bigalloc file systems without
ext2fs_open() thinking that they are corrupt.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
5af9eeaa7d36dd6f3a434697747ba8db3434eced 18-Mar-2011 Theodore Ts'o <tytso@mit.edu> Merge branch 'maint' into next

4df1618250349dbe71f9474c42d52d7d03cc68a0 18-Mar-2011 Theodore Ts'o <tytso@mit.edu> add new superblock field: s_overhead_blocks

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>
829d9994880394e48c883510799b1536812d6efb 28-Feb-2011 Theodore Ts'o <tytso@mit.edu> Merge branch 'maint' into next

412376efff3c0e0c2fea00666c2457e6f2ae1878 26-Feb-2011 Theodore Ts'o <tytso@mit.edu> Add basic BIGALLOC support for cluster-based allocation

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>
0edcc2702106ef8ea0d4ab60ef06c0c38b0b87ee 15-Feb-2011 Aditya Kali <adityakali@google.com> e2fsprogs: reserving code points for new ext4 quota feature

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>
9d92a201deec7bbb1911e6e5ee98abf3c83882d4 25-Sep-2010 Theodore Ts'o <tytso@mit.edu> Merge branch 'maint' into next

9345f02671fd39cad69338080b62e12e8b86671d 19-Sep-2010 Theodore Ts'o <tytso@mit.edu> tune2fs, debugfs, libext2fs: Add support for ext4 default mount options

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>
db0bdb49f49fc3dd14c12439d934a3403a3be9f1 19-Jul-2010 Theodore Ts'o <tytso@mit.edu> Merge branch 'maint' into next

993988f65527e5665181b3e4a6161f317e396489 25-Jun-2010 Theodore Ts'o <tytso@mit.edu> Add superblock fields which track first and most recent fs errors

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>
97d26ce9e3589e9f5fa17014467a9730a884d158 07-Jun-2010 Theodore Ts'o <tytso@mit.edu> Merge branch 'maint' into next

6d0ed6780285e79360353d4b06b339c00712d754 02-Jun-2010 Theodore Ts'o <tytso@mit.edu> Reserve feature flags and fields needed for the Next3 snapshot feature

The documentation is not (as of this writing) fully complete, but
there is some documentation here:


... which will hopefully be updated soon to be fully up to date with
these assignments and more details about how things work.

For now, the assignments should avoid collisions with other new work
that people might want to do on ext3/4.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
30a7610edfc0c22cb6b5ad9f76f65700fb6ffe98 02-Jun-2010 Andreas Dilger <adilger@sun.com> Reserve the EXT4_FEATURE_INCOMPAT_DIRDATA feature flag

Reserve the EXT4_FEATURE_INCOMPAT_DIRDATA feature flag for adding
extra file data in ext2_dir_entry_2 entries.

This changes the on-disk layout in the following way.

Firstly, the ext2_dir_entry_2 file_type field now has a mask: that
limits the "filetype" information to the low 4 bits of this field.
Since these values are sequentially assigned, this allows for up to 7
more filetypes to be assigned. When reading the "filetype" field, the
high 4 bits should be masked off when converting to DT_* filetypes for

The high 4 bits of "filetype" are used as a bitmask to register up to
4 different "extended" directory entry fields. Extended data fields
are packed without alignment into the directory entry after the "name"
field in order of increasing bitmask value, for each field where bit
is set. In order to avoid the need to "understand" each of the
extended fields, the first byte of each extended data field holds the
size of that data field (including the size itself), so they can be
skipped if not understood. For fields that change the semantics of
the filesystem it is expected that a separate ROCOMPAT or INCOMPAT
field is registered.

There is a single dirent data type defined currently, for Lustre:
which holds a 128-bit file identifier. It is expected that if there
are 64-bit inode values that this will be assigned the 0x20 value.

Should a need ever arise to use all 4 of the extended dirent data
fields, it would be possible to keep the last bit (0x80) for use as a
multiplexor that stores a 1-byte aggregate data size, then a series of
"<u8_size><u8_type><data>" records in the last extended data record.
It is not expected that this will actually be needed in the lifetime
of ext4.

Signed-off-by: Andreas Dilger <adilger@sun.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
cff9690f4e114d95c9031a7468c99fda0ddcb3ec 02-Jun-2010 Andreas Dilger <adilger@sun.com> Reserve the EXT4_INCOMPAT_EA_INODE feature flag

Reserve the EXT4_INCOMPAT_EA_INODE feature flag for use with
large extended attributes that are stored in a separate inode.
This changes the on-disk format in several ways:

First, replace the e_value_block field with e_value_inum, so that
an xattr entry can reference an external inode. This field is
currently unused, as all of the entries live in the same block.

struct ext2_ext_attr_entry {
__u8 e_name_len; /* length of name */
__u8 e_name_index; /* attribute name index */
__le16 e_value_offs; /* offset in disk block of value */
> __le32 e_value_inum; /* inode in which the value is stored */
__le32 e_value_size; /* size of attribute value */
__le32 e_hash; /* hash value of name and value */
char e_name[0]; /* attribute name */

Second, add a flag to the inode that indicates it is using a large
(external) extended attribute. This is needed so that when unlinking
an inode the xattrs will be scanned to unlink the xattr inodes
referenced by the main inode.

Third, for inodes that have a number of xattrs that are larger than
a single block, but not large enough to justify an external inode
(less than 64kB total xattr size, due to e_value_offs limitation)
the ext2_ext_attr_header->h_blocks field can grow beyond a single
block to represent a contiguous allocation of blocks for the xattr.

Signed-off-by: Andreas Dilger <adilger@sun.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
c5b23f6c0e17503630455fb16d1b2035f844acc9 15-Mar-2010 Theodore Ts'o <tytso@mit.edu> Merge branch 'maint' into next
4ffafee26cf791c0c651c08d3dcefcdd363bf127 24-Feb-2010 Eric Sandeen <sandeen@redhat.com> e2fsck: don't complain about i_size for known blocks past EOF

This is the userspace side of Jiaying's EOFBLOCKS patch. With
Aneesh's patches for .33, Jiaying's patch, and this one, xfstests
013/fsstress (even with direct IO enabled) has held up through many

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
a63745e81cbb476b90c75ca3ca60b9ba4be95cae 08-Sep-2009 Valerie Aurora Henson <vaurora@redhat.com> Use ext2fs_file_acl_block() instead of using .i_file_acl directly

This provides support for 48-bit file acl blocks.

Signed-off-by: Valerie Aurora Henson <vaurora@redhat.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
3c4d4d7459f46adbd10b97b37fe0def2313d1d21 06-Jun-2009 Valerie Aurora Henson <vaurora@redhat.com> libext2fs: Define bg_itable_unused_hi in the ext4_group_desc structure

Signed-off-by: Valerie Aurora Henson <vaurora@redhat.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
b7c5b4030870b31d73019d9d9ec55d550772590b 06-Mar-2009 Theodore Ts'o <tytso@mit.edu> Add support for a new superblock field: s_kbytes_written

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>
efc6f628e15de95bcd13e4f0ee223cb42115d520 28-Aug-2008 Theodore Ts'o <tytso@mit.edu> Remove trailing whitespace for the entire source tree

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
5c4f8d674845095050f94ea95f3c73072cbe34b5 07-Jun-2008 Theodore Ts'o <tytso@mit.edu> resize2fs: Add support to use the ext4 online resize ioctl's

First try the ext3 ioctl, but if we get an error, try using the ext4

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
bb767b2fc3b4420f566df6f563574fd8e5c856b1 16-May-2008 Theodore Ts'o <tytso@mit.edu> ext2fs.h: Add l_i_file_acl_high and l_version_hi to on-disk inode structure

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
494a1daad37a8098e7db166d558aab3e9e37ac48 22-Apr-2008 Theodore Ts'o <tytso@mit.edu> Basic flexible block group support

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>
1ca1059fd0126fd2c065f272a566c18f14bab16d 09-Apr-2008 Theodore Ts'o <tytso@mit.edu> Add support for the HUGE_FILE feature

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
ca2634a46ab9da85a3a015a7772770d9dbe5848e 22-Oct-2007 Jose R. Santos <jrs@us.ibm.com> Add initial checksum support for the gdt_checksum/uninit_group feature

- Add support for computing CRC-16 value.
- Add call to check/verify/set csum on block_groups.
- Add a test program to verify csum operations.

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>
a7c9cb7d0dc464eda26958595b728a6c3a4cacbc 02-Feb-2008 Andreas Dilger <adilger@sun.com> Add support for the DIR_NLINK feature.

This patch includes the changes required to e2fsck to understand the
nlink count changes made in the kernel.

In e2fsck pass 4, when we fetch the actual link count, if it is
exceeds 65,000 we set the link count to 1. We silently fix the
situation where the nlink count of the directory is 1, and there are
fewer than 65,000 subdirectories, since since that can happen

Patch originally from CFS, significantly rewritten by Theodore Ts'o.

Signed-off-by: Andreas Dilger <adilger@clusterfs.com>
Signed-off-by: Kalpak Shah <kalpak@clusterfs.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
6567e5a684610832962a951a50712574eff59808 15-Mar-2008 Theodore Ts'o <tytso@mit.edu> Merge branch 'maint'
a80f3694a7b99756e747683f01ab8a5bca022251 15-Mar-2008 Theodore Ts'o <tytso@mit.edu> ext2_fs.h: Rename EXT4_ORPHAN_FS to be EXT3_ORPHAN_FS

No application will ever use the ORPHAN_FS flag, since it only shows
up in kernel memory, but it's been pointed out it was first used in
ext3, and so it should be renamed for accuracy.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
428f6b32a9029e1f0bc2559233954955a6aae64c 28-Jan-2008 Theodore Ts'o <tytso@mit.edu> Merge branch 'maint' into next


6cb27404f51f97e2665fa0e0c4c0f7bc47e698ec 27-Jan-2008 Theodore Ts'o <tytso@mit.edu> Add support for the test_fs flag

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>
153439222e6a16e40be324408d8d19361bc1e65e 21-Jan-2008 Theodore Ts'o <tytso@mit.edu> Define helper functions ext2fs_set_i_{u,g}id_high() for MacOS compatibility

This is needed for all non-Linux/Hurd/Masix systems...

Addresses-Sourceforge-Bug: #1863819

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
fef2b38d8e5b475655771f8208265a8fa9246601 01-Jan-2008 Theodore Ts'o <tytso@mit.edu> Merge branch 'maint' into next


7132d48d83f79992773b6d9f1cace8d96366f08b 01-Jan-2008 Theodore Ts'o <tytso@mit.edu> Fix build failure on non-Linux/non-Hurd/non-Masix systems

The previous fix didn't quite work, but this one should!

Addresses-Sourceforge-Bug: #1861633

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
3306861158a1ca27b7ec83bb33fb8fbbf043d24c 30-Dec-2007 Theodore Ts'o <tytso@mit.edu> Fix build failure on non-Linux/non-Hurd/non-Masix systems

inode_uid() and inode_gid() weren't getting defined on systems that
were not Linux, Hurd, or Masix.

Addresses-Sourceforge-Bug: #1859778

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
3166c58dc0e2be55c9414e019607902c85485e83 18-Dec-2007 Theodore Ts'o <tytso@mit.edu> Add #define needed for Hurd ioctl definitions

Addresses-Debian-Bug: #437720

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
5ea565fd37821b2708c2b7f1e49fe6fc94587794 04-Nov-2007 Theodore Ts'o <tytso@mit.edu> Merge basic FLEX_BG support

Merge commit 'c2d4300b8a4a13d8a78b86c386f76259f23feec2' into next
cf0eeec0159b1af67fad9bccce220402cf08dff0 14-Aug-2007 Jose R. Santos <jrs@us.ibm.com> Reserve the INCOMPAT feature number for FLEX_BG.

Signed-off-by: Jose R. Santos <jrs@us.ibm.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>

lib/ext2fs/ext2_fs.h | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
c9548bc37e5d0f55308ebbb74b1e19ce7f88ada1 23-Aug-2007 Coly Li <coyli@suse.de> libext2fs: remove masix support

This patch remove masix support from lib/ext2fs.

Signed-off-by: Coly Li <coyli@suse.de>
f2de1d38d0819b17895977fabc52d81d0ea6ec00 30-Aug-2007 Valerie Clement <valerie.clement@bull.net> libext2fs: Add EXT2_DESC_SIZE and EXT2_DESC_PER_BLOCK macros

Add macros to support variable-length group descriptors for ext4.

Signed-off-by: Valerie Clement <valerie.clement@bull.net>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
decb2a5b3a1e346ddb725a3ba01b759d8c9ee4e6 31-May-2007 Theodore Ts'o <tytso@mit.edu> Reserve superblock field for the raid stripe width.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
b62e88af6a1be97b224a3e5c1fea43fa173567ea 31-May-2007 Andreas Dilger <adilger@clusterfs.com> Reserve superblock fields for multiple mount protection feature

There have been reported instances of a filesystem having been mounted
at 2 places at the same time causing a lot of damage to the
filesystem. This patch reserves superblock fields and an INCOMPAT flag
for adding multiple mount protection(MMP) support within the ext4
filesystem itself. The superblock will have a block number
(s_mmp_block) which will hold a MMP structure which has a sequence
number which will be periodically updated every 5 seconds by a mounted
filesystem. Whenever a filesystem will be mounted it will wait for
s_mmp_interval seconds to make sure that the MMP sequence does not
change. To further make sure, we write a random sequence number into
the MMP block and wait for another s_mmp_interval secs. If the
sequence no. doesn't change then the mount will succeed. In case of
failure, the nodename, bdevname and the time at which the MMP block
was last updated will be displayed. tune2fs can be used to set
s_mmp_interval as desired.

Signed-off-by: Andreas Dilger <adilger@clusterfs.com>
Signed-off-by: Kalpak Shah <kalpak@clusterfs.com>
96c6a3acd377698cb99ffd9925bec9b20ca4f6f9 19-May-2007 Theodore Ts'o <tytso@mit.edu> Store the RAID stride value in the superblock and take advantage of it

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>
5113a6e32b298671c86ae7da097bcd24540cebc9 08-May-2007 Eric Sandeen <sandeen@redhat.com> Fix mke2fs and debugfs to support large (> 16 bit) uid's and gid's

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>
d362a3fb7ec1a2b46601f55f4dbae83563c27717 19-Apr-2007 Theodore Ts'o <tytso@mit.edu> Define the l_i_iversion field in ext2_inode

The l_i_version field is now defined from the old l_i_reserved1 field in
the ext2 inode. This field will be used to store high 32 bits of the
64-bit inode version number.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
d2a3bf2ccc2df5167289e9fc084fec3cea78c950 30-Nov-2006 Theodore Ts'o <tytso@mit.edu> Fix (as yet unused) struct ext4_group_desc to add a missing bg_pad field

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
f77704e416fca7dbe4cc91abba674d2ae3c14f6f 12-Nov-2006 Theodore Ts'o <tytso@mit.edu> Add directory hashed signed/unsigned hint to superblock

The e2fsprogs and kernel implementation of directory hash tree has a
bug which causes the implementation to be dependent on whether
characters are signed or unsigned. Platforms such as the PowerPC,
Arm, and S/390 have signed characters by default, which means that
hash directories on those systems are incompatible with hash
directories on other systems, such as the x86.

To fix this we add a new flags field to the superblock, and define two
new bits in that field to indicate whether or not the directory should
be signed or unsigned. If the bits are not set, e2fsck and fixed
kernels will set them to the signed/unsigned value of the currently
running platform, and then respect those bits when calculating the
directory hash. This allows compatibility with current filesystems,
as well as allowing cross-architectural compatibility.

Addresses Debian Bug: #389772

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
6b3ce9871c3424d0b41e0c7227ddc116d2e0de1a 11-Nov-2006 Theodore Ts'o <tytso@mit.edu> On-disk format for controlling the inode size

- EXT4_FEATURE_RO_COMPAT_EXTRA_ISIZE (0x0040?) - add s_min_extra_isize and
s_want_extra_isize fields to superblock, which allow specifying
the minimum and desired i_extra_isize fields in large inodes
(for nsec+epoch timestamps, potential other uses). Needs RO_COMPAT
flag handling, needs e2fsck support, patch complete, little testing.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
8061d2c144bf22ce3e170e40a194932da4baf8fb 11-Nov-2006 Theodore Ts'o <tytso@mit.edu> On-disk format definition for 64-bit support

- EXT4_FEATURE_INCOMPAT_64BIT (0x0080) - support for 64-bit block count
fields in the superblock (s_blocks_count_hi, s_free_blocks_count_hi),
large group descriptors (s_desc_size), extents with high 16 bits
(ee_start_hi, ei_leaf_hi), inode ACL (i_file_acl_hi). May also grow
to encompass the previously proposed BIG_BG.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
bec6f49a46ec78a4c5928a22214848a7ea654704 11-Nov-2006 Theodore Ts'o <tytso@mit.edu> On-disk format for large number of subdirectories

- EXT4_FEATURE_RO_COMPAT_DIR_NLINK (0x0020?) - allow directories to have
> 65000 subdirectories (i_nlinks) by setting i_nlinks = 1 for such
directories. RO_COMPAT protects old filesystems from unlinking such
directories incorrectly and losing all files therein.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
8815fb8a00f5a441eb62f035353db9e0cca90b38 11-Nov-2006 Theodore Ts'o <tytso@mit.edu> On-disk format definition for group descriptor checksums

- EXT4_FEATURE_RO_COMPAT_GDT_CSUM (0x0010?) - store a crc16 checksum in
the group descriptor (s_uuid[16] | __u32 group | ext3_group_desc
(excluding gd_checksum itself)). This allows the kernel to more safely
manage UNINIT groups.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
5d17119d14fe1276936c85d7986695a4543b1aa1 11-Nov-2006 Theodore Ts'o <tytso@mit.edu> On-disk format definition for huge files

- EXT4_FEATURE_RO_COMPAT_HUGE_FILE (0x0008) - change i_blocks to be
in units of s_blocksize units instead of 512-byte sectors, use
l_i_frag and l_i_fsize as i_blocks_hi (could also be part of 64BIT).

E2fsck and debugfs changed to support i_blocks_hi instead of l_i_frag and

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
8fe81a3d53fbaa1670ece5fb7fd11dd5ae45b8da 06-Aug-2006 Andreas Dilger <adilger@clusterfs.com> Rename EXT3_EXTENTS_FL to EXT4_EXTENTS_FL and make it visible to the user

lsattr will display the EXT4_EXTENTS_FL flag

Signed-off-by: Andreas Dilger <adilger@clusterfs.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
f5fa20078bfc05b554294fe9c5505375d7913e8c 09-May-2006 Theodore Ts'o <tytso@mit.edu> Add support for EXT2_FEATURE_COMPAT_LAZY_BG

This feature is initially intended for testing purposes; it allows an
ext2/ext3 developer to create very large filesystems using sparse files
where most of the block groups are not initialized and so do not require
much disk space. Eventually it could be used as a way of speeding up
mke2fs and e2fsck for large filesystem, but that would be best done by
adding an RO_COMPAT extension to the filesystem to allow the inode table
to be lazily initialized on a per-block basis, instead of being entirely initialized
or entirely unused on a per-blockgroup basis.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
bf69235ad0073c80386b70caba0e1b58e5f85697 18-Mar-2006 Theodore Ts'o <tytso@mit.edu> Add support for on-line resizing to resize2fs

If the filesystem is mounted, attempt to use the on-line resizing
ioctls to resize the filesystem.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
7331196a16e57ef80dd6ae40eeeab14747ce2f5d 26-Jan-2005 Theodore Ts'o <tytso@mit.edu> Add library support for large (EA in inode) inodes. Make sure that garbage
doesn't get written into the reserved portion when writing into filesystems
that have large inodes defined.
39dc1c45cb41ce37a56d364103bb852d0b62c835 30-Nov-2004 Theodore Ts'o <tytso@mit.edu> Add definition for the extents filesystem feature and inode flag.

Change the maximum allowable blocksize to be 65536. This allows e2fsck to
check filesystems with a pagesize of 65536, and mke2fs to accept -b 65536.
Of course such a filesystem will not currently work on a Linux/x86 system,
at least not as of this writing!
1ba7a2f2b6a9b152828a06443955a7fb1d139930 30-Jan-2004 Theodore Ts'o <tytso@mit.edu> Fix a byte swap bugs, including one which caused e2fsck to
incorrectly treat as valid symlinks created with SE Linux
(Debian bug #228723) as well as failing the f_journal test case on
big endian systems due to the backup journal blocks not being swapped.
a435ec3449694a8fa299337197cc09624960a3a6 21-Aug-2003 Theodore Ts'o <tytso@mit.edu> Add support for backing up the journal inode location in the
superblock. E2fsck will automatically save the journal information
in the superblock if it is not there already, and will use it if the
journal inode appears to be corrupted. ext2fs_add_journal_inode()
will also save the backup information, so that new filesystems
created by mke2fs and filesystems that have journals added via
tune2fs will also have journal location written to the superblock as
well. Debugfs's logdump command has been enhanced so that it can
use the journal information in the superblock.

The debugfs man page has been improved to more fully describe the
logdump command.

Added two new functions, ext2fs_file_open2() and
ext2fs_inode_io_intern2() which take a pointer to an inode structure;
this is needed so that e2fsck and debugfs can synthesize a
fake journal inode and use it to access the journal.
48e6e81362f264aee4f3945c14928efaf71a06c9 06-Jul-2003 Theodore Ts'o <tytso@mit.edu> Fixx gcc -Wall nitpicks.
2c93113e6ac1384abd1935af7217b783fdcb3023 11-Apr-2003 Theodore Ts'o <tytso@mit.edu> Remove EXT2_FEATURE_RO_COMPAT_BTREE_DIR mention of since it's not
actually used, and may confuse people who are looking for
15f9011add4013d32ea2f7ca7dbf860f95b8ec53 01-Nov-2002 Theodore Ts'o <tytso@mit.edu> Add support for a new inode flag, which is to be used
for indicating the top of directory hierarchies for the
Orlov block allocator.
9d2aefb3bc0a48b1540d06e1983aa96c56d39e17 25-Oct-2002 Theodore Ts'o <tytso@mit.edu> Add a new superblock field, s_mkfs_time, which indicates when
the filesystem was created. It is set via mke2fs, and printed
via list_super2() (which is called by dumpe2fs).

Also, list_super2() will now print "n/a" if the last mount time
(s_mtime) is zero.
4a959fe6f18a3b6023234a66f4455f7ec660b8b4 20-Oct-2002 Theodore Ts'o <tytso@mit.edu> Add support for new default mount options for the journal data mode.
c046ac7f2e4c53e20cf1e909bbe511f91074b396 20-Oct-2002 Theodore Ts'o <tytso@mit.edu> Add support for the meta_blockgroup filesystem format.
a0c3fd5e4cdc2e0b032c9ace89d960a622069c32 15-Oct-2002 Theodore Ts'o <tytso@mit.edu> Add support for new feature in ext2/3 filesystems; a default mount options field
in the superblock. Added the tune2fs '-o' option to set this field.
b33278c4d640c3fc8f99a314b637b7e502fceb9c 17-Aug-2002 Theodore Ts'o <tytso@mit.edu> Modify the half MD4 hash so it is no longer endian dependent. This is
a backwards incompatible change, but this should be OK since the kernel
MD4 ext3 code was only in the CVS tree, and hasn't generally escaped.

Add support for the TEA hash.
b7a00563b22b0ea47ddc7117508c0b8e0d65df43 20-Jul-2002 Theodore Ts'o <tytso@mit.edu> Add support to e2fsck to reindex directories to use hash trees.
9e6c5dd73e7bc1a946b2b8b6c5a15c1f9d3534c0 09-Jul-2002 Theodore Ts'o <tytso@mit.edu> ext2_fs.h: Add superblock field for reserved group descriptors.
503f9e7f6eb331c5b75d7f1ad126f71bcdcfb4e3 26-Jun-2002 Theodore Ts'o <tytso@mit.edu> Add support for the half-MD4 HTREE hash.

Add HTREE root node tests.
88372d5c4b2ebd0405446b42de65bf2b0ebb2408 16-Jun-2002 Theodore Ts'o <tytso@mit.edu> Applied Andrew Morton's patch to support the dirsync option.
b21bf267783274683a432eea6e5c589eab94123e 10-Jun-2002 Andreas Dilger <adilger@clusterfs.com> Do sanity checking of the number of blocks and inodes in a group for
8192-byte and 16384-byte blocksize filesystems.

Change the default bytes-per-inode ratio of a new filesystem to be at most
one inode per block for large blocksizes.
7da78ff17df7d2c1eeebbc2b0727106b63c08a68 10-Jun-2002 Andreas Dilger <adilger@clusterfs.com> ext2_fs.h: Further minor cleanups of the header. Consolidate
some checks for __KERNEL__ into one place.
0fbd1a8a9a2ef697927f886559344ffa1bb2eefa 23-May-2002 Andreas Dilger <adilger@clusterfs.com> ext2_fs.h: Remove macros accessing u.ext2_sb field and use
the EXT2_SB() macro instead. Remove kernel function
prototypes also. This matches the 2.5 kernel, and
is also cleaner for other reasons. Whitespace cleanup.
932a489cdf6bc83d69e59d3f8e0a57b733799ce1 16-May-2002 Andreas Dilger <adilger@clusterfs.com> Add support for creating and checking 8192-byte blocksize filesystems.
We complain if you try to create such a filesystem on a system with 4096

Add checks for valid inode size for undocumented -I option.
df614db6ef79c767745b8154c26d69398b571605 25-Feb-2002 Theodore Ts'o <tytso@mit.edu> Add initial support in debugfs for examining directory indexing
b3f5b4c22939daba86465d05842bce76053bc3cf 06-Nov-2001 Theodore Ts'o <tytso@mit.edu> Define a new ext2 file attribute, EXT2_NOTAIL_FL,
which signals that a particular inode should not have the
last bits of data (the "tail") be merged with another
file. This is necessary to keep programs like LILO happy.
d007cb4cbb4b8b190ffd9a597f0e88ea365926c5 05-Aug-2001 Theodore Ts'o <tytso@mit.edu> Cleanup changes to Andreas' symlink patch. Remove use of EXT2_LINK_DIR

Also cleaned up the symlink handling code to make it a bit more
compact and to test for a bad symlink block earlier.
67052a8aeeca8cd80d1dd33c2792f917573accc8 04-Aug-2001 Andreas Dilger <adilger@clusterfs.com> Add extra checks for bad symlinks, including zero length symlinks,
too long i_size for slow and fast symlinks, i_size_high set, multiple
blocks for slow symlinks.
797f5ef14e92294b329e52971d467d7af5b2993e 02-Jun-2001 Theodore Ts'o <tytso@mit.edu> ChangeLog, wordwrap.pl:
Makefile.in: Move include/asm/types.h.in to lib/ext2fs/ext2_fs.h.in.
wordwrap.pl: Add some rules which help fix up the dependencies.
Many files:
Move include/asm/types.h.in to lib/ext2fs/ext2_fs.h.in.
b10820cdcd5f007894b81cf716cf1fdd8523bbca 21-May-2001 Theodore Ts'o <tytso@mit.edu> ChangeLog, ext2_fs.h:
ext2_fs.h: Change assignment of EXT2_FEATURE_COMPAT_DIR_INDEX to make
room for pre-existing usage of EXT2_FEATURE_COMPAT_EXT_ATTR. Add flag
EXT2_INDEX_FL with the same codepoint as EXT2_BTREE_FL.
9f8046fc6dfc13eee2f5c363214e60b533872cac 14-May-2001 Theodore Ts'o <tytso@mit.edu> Many files:
alloc.c, alloc_tables.c, badblocks.c, bb_compat.c, bb_inode.c,
bitmaps.c, bitops.c, block.c, bmap.c, bmove.c, brel_ma.c,
check_desc.c, closefs.c, cmp_bitmaps.c, dblist.c, dblist_dir.c,
dir_iterate.c, dirblock.c, dupfs.c, expanddir.c, ext2_fs.h, fileio.c,
finddev.c, flushb.c, freefs.c, get_pathname.c, getsize.c, icount.c,
imager.c, initialize.c, inline.c, inode.c, irel_ma.c, ismounted.c,
link.c, lookup.c, mkdir.c, mkjournal.c, namei.c, native.c, newdir.c,
nt_io.c, openfs.c, read_bb.c, read_bb_file.c, rs_bitmap.c,
rw_bitmaps.c, swapfs.c, test_io.c, tst_badblocks.c, tst_byteswap.c,
tst_getsize.c, tst_iscan.c, unix_io.c, unlink.c, valid_blk.c,
version.c, write_bb_file.c, ext2_fs.h: Moved file from include/linux.
Adjust all files in this directroy to include this file.