1. 06 Feb, 2017 1 commit
  2. 21 Nov, 2014 1 commit
    • JP Abgrall's avatar
      tune2fs: Allow building it as a static lib · d25948b9
      JP Abgrall authored
      This allows getting all of tune2fs as a static library.
      The entry point is
        int tune2fs_main(int argc, char **argv).
      It requires passing argv[0]="tune2fs" to get tune2fs behavior.
      
      Bug: 18430740
      Change-Id: I7bf8d96c53066a4da37778c0d67383b0b820e2ff
      d25948b9
  3. 20 Mar, 2014 3 commits
  4. 06 Mar, 2014 2 commits
  5. 04 Mar, 2014 1 commit
  6. 04 Jan, 2014 1 commit
    • Bernhard Rosenkränzer's avatar
      Add files that would normally be generated by the e2fsprogs build system · 18a1444b
      Bernhard Rosenkränzer authored
      
      Android doesn't run ./configure and friends, so it has to rely on
      pre-populated versions of the autogenerated files.
      
      This is somewhat bogus (e.g. hardcoded little-endian reference in
      lib/ext2fs/ext2_types.h) and should at some point be fixed, but it's
      what Android has always done, not a regression from the 1.41.14 branch.
      
      Also, don't #include config.h which we don't generate (we pass what it
      usually contains as -D parameters from Android.mk) anywhere.
      
      Add a new Android.mk file for the quota library.
      
      Change-Id: I162c6327fee5bd06261d9cdcc34bda10f04a6f21
      Signed-off-by: default avatarBernhard Rosenkränzer <Bernhard.Rosenkranzer@linaro.org>
      18a1444b
  7. 31 Dec, 2013 1 commit
  8. 26 Dec, 2013 1 commit
    • Theodore Ts'o's avatar
      e2image: only skip writing zero blocks when writing to a new file · aa2c7433
      Theodore Ts'o authored
      
      The e2image progam was originally intended to create image files.
      However, some people have started using e2image to copy a file system
      from one block device to another, since it is more efficient than
      using dd because it only copies the blocks which are in use.  If we
      are doing this, however, we must not skip writing blocks which are all
      zero in the source device, since they may not be zero in the
      destination device.
      Signed-off-by: default avatar"Theodore Ts'o" <tytso@mit.edu>
      Cc: Phillip Susi <psusi@ubuntu.com>
      aa2c7433
  9. 25 Dec, 2013 2 commits
    • Theodore Ts'o's avatar
      libext2fs: checksum bg descriptors larger than 64 bytes · b3c2a638
      Theodore Ts'o authored
      
      Currently the ext4 block group descriptor is 64 bytes.  In case we
      need to support larger block group descriptors in the future, teach
      ext2fs_group_desc_csum() to checksum parts of the block group
      descriptors that libext2fs doesn't yet understand.
      Signed-off-by: default avatar"Theodore Ts'o" <tytso@mit.edu>
      b3c2a638
    • Andreas Dilger's avatar
      debugfs, e2fsck: fix s_desc_size handling · 2bc30417
      Andreas Dilger authored
      
      The s_desc_size in the superblock specifies the group descriptor
      size in bytes, but in various places the EXT4_FEATURE_INCOMPAT_64BIT
      flag implies that the descriptor size is EXT2_MIN_DESC_SIZE_64BIT
      (64 bytes) instead of checking the actual size.  In other places,
      the s_desc_size field is used without checking for INCOMPAT_64BIT.
      
      In the case of ext2fs_group_desc() the s_desc_size was being ignored,
      and assumed to be sizeof(struct ext4_group_desc), which would result
      in garbage for any but the first group descriptor.  Similarly, in
      ext2fs_group_desc_csum() and print_csum() they assumed that the
      maximum group descriptor size was sizeof(struct ext4_group_desc).
      Fix these functions to use the actual superblock s_desc_size if
      INCOMPAT_64BIT.
      
      Conversely, in ext2fs_swap_group_desc2() s_desc_size was used
      without checking for INCOMPAT_64BIT being set.
      
      The e2fsprogs behaviour is different than that of the kernel,
      which always checks INCOMPAT_64BIT, and only uses s_desc_size to
      determine the offset of group descriptors and what range of bytes
      to checksum.
      
      Allow specifying the s_desc_size field at mke2fs time with the
      "-E desc_size=NNN" option.  Allow a power-of-two s_desc_size
      value up to s_blocksize if INCOMPAT_64BIT is specified.  This
      is not expected to be used by regular users at this time, so it
      is not currently documented in the mke2fs usage or man page.
      
      Add m_desc_size_128, f_desc_size_128, and f_desc_bad test cases to
      verify mke2fs and e2fsck handling of larger group descriptor sizes.
      Signed-off-by: default avatarAndreas Dilger <adilger@dilger.ca>
      Signed-off-by: default avatar"Theodore Ts'o" <tytso@mit.edu>
      2bc30417
  10. 23 Dec, 2013 1 commit
    • Andreas Dilger's avatar
      e2fsck: verify s_desc_size is power-of-two value · 11d1116a
      Andreas Dilger authored
      
      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: default avatarAndreas Dilger <adilger@dilger.ca>
      Signed-off-by: default avatar"Theodore Ts'o" <tytso@mit.edu>
      11d1116a
  11. 16 Dec, 2013 7 commits
    • Theodore Ts'o's avatar
      Clean up sparse warnings · f404167d
      Theodore Ts'o authored
      
      Mostly by adding static and removing excess extern qualifiers.  Also
      convert a few remaining non-ANSI function declarations to ANSI.
      Signed-off-by: default avatar"Theodore Ts'o" <tytso@mit.edu>
      f404167d
    • Kazuya Mio's avatar
      mke2fs: disallow creating FS on a loop mounted file with no option · fbabd5c4
      Kazuya Mio authored
      
      When /etc/mtab is a symlink of /proc/mounts, mke2fs without -FF option
      can create a filesystem on the image file that is mounted.
      According to mke2fs man page, we should specify -FF option in this case.
      
      This patch protects filesystem from unintended mke2fs caused by human error.
      
      How to reproduce:
        # mke2fs -t ext4 -Fq fs.img
        # mount -o loop fs.img /mnt/mp1
        # mke2fs -t ext4 -Fq fs.img && echo "mke2fs success"
        mke2fs success
      Signed-off-by: default avatarKazuya Mio <k-mio@sx.jp.nec.com>
      Signed-off-by: default avatar"Theodore Ts'o" <tytso@mit.edu>
      fbabd5c4
    • Darrick J. Wong's avatar
      libext2fs: don't update the summary counts when doing implied cluster allocation · 230272c1
      Darrick J. Wong authored
      
      When we're appending a block to a directory file or the journal file,
      and the new block is part of a cluster that has already been allocated
      to the file (implied cluster allocation), don't update the bitmap or
      the summary counts because that was performed when the cluster was
      allocated.
      Reviewed-by: default avatarZheng Liu <wenqing.lz@taobao.com>
      Signed-off-by: default avatarDarrick J. Wong <darrick.wong@oracle.com>
      Signed-off-by: default avatar"Theodore Ts'o" <tytso@mit.edu>
      230272c1
    • Darrick J. Wong's avatar
      libext2fs: only punch complete clusters · 84397754
      Darrick J. Wong authored
      
      When bigalloc is enabled, using ext2fs_block_alloc_stats2() to free
      any block in a cluster has the effect of freeing the entire cluster.
      This is problematic if a caller instructs us to punch, say, blocks
      12-15 of a 16-block cluster, because blocks 0-11 now point to a "free"
      cluster.
      
      The naive way to solve this problem is to see if any of the other
      blocks in this logical cluster map to a physical cluster.  If so, then
      we know that the cluster is still in use and it mustn't be freed.
      Otherwise, we are punching the last mapped block in this cluster, so
      we can free the cluster.
      
      The implementation given only does the rigorous checks for the partial
      clusters at the beginning and end of the punching range.
      Reviewed-by: default avatarZheng Liu <wenqing.lz@taobao.com>
      Signed-off-by: default avatarDarrick J. Wong <darrick.wong@oracle.com>
      Signed-off-by: default avatar"Theodore Ts'o" <tytso@mit.edu>
      84397754
    • Andreas Dilger's avatar
      ext2fs,blkid: delete unused LIST_HEAD() macro · eaf44035
      Andreas Dilger authored
      
      The LIST_HEAD() macro conflicts with the <sys/queue.h> declaration
      of the same name.  Delete the unused LIST_HEAD() macro from the
      libext2fs and libblkid headers to avoid compiler warnings.  It can
      be replaced by INIT_LIST_HEAD() or LIST_HEAD_INIT() if needed.
      Signed-off-by: default avatarAndreas Dilger <adilger@dilger.ca>
      Signed-off-by: default avatar"Theodore Ts'o" <tytso@mit.edu>
      eaf44035
    • Andreas Dilger's avatar
      ext2fs: quiet compiler warnings · 269da3b8
      Andreas Dilger authored
      
      Include ext2fsP.h in fileio.c for ext2fs_file_block_offset_too_big()
      declaration.  Fix up the declaration to mark it extern in the header.
      
      Include <strings.h> header for strcasecmp() in tune2fs.c if available,
      as described in the strcasecmp(3) man page, instead of doing this
      indirectly by declaring _BSD_SOURCE and getting it from <string.h>.
      
      If CONFIG_QUOTA is undefined, parse_quota_opts() is unused in
      tune2fs.c so #ifdef it out.
      Signed-off-by: default avatarAndreas Dilger <adilger@dilger.ca>
      Signed-off-by: default avatar"Theodore Ts'o" <tytso@mit.edu>
      269da3b8
    • Andreas Dilger's avatar
      build: use long long for __u64 by default · 3a941bef
      Andreas Dilger authored
      
      Don't print a verbose configure error in parse-types.h if
      <asm/types.h> missing and __[SU]*_TYPEDEF is unset.  This is
      always the case for non-Linux builds.
      
      The printf formatting strings all use "%llu" for printing 64-bit
      values and this it produces a large number of warnings if __u64
      is defined as "unsigned long".  If __U64_TYPEDEF isn't set use
      "unsigned long long" for __u64 in ext2-types.h and blkid-types.h
      by default instead of using "unsigned long".
      
      Fix a few places where "%d" or "%u" or "%Lu" were used to print a
      64-bit value, by converting them to use "%lld" or "%llu" instead.
      
      Fix a few places where "%lu" was used to print .tv_usec, by casting
      the variable to "(long)" since .tv_usec is "int" on some systems.
      Signed-off-by: default avatarAndreas Dilger <adilger@dilger.ca>
      Signed-off-by: default avatar"Theodore Ts'o" <tytso@mit.edu>
      3a941bef
  12. 15 Dec, 2013 1 commit
  13. 12 Dec, 2013 14 commits
  14. 04 Dec, 2013 1 commit
  15. 03 Dec, 2013 3 commits