1. 10 Jul, 2014 12 commits
  2. 09 Jul, 2014 1 commit
  3. 06 Jul, 2014 20 commits
    • Theodore Ts'o's avatar
      cd75fb04
    • Benno Schulenberg's avatar
      po: add Esperanto translation · 01233baf
      Benno Schulenberg authored
      Signed-off-by: default avatarTheodore Ts'o <tytso@mit.edu>
      01233baf
    • Yuri Chornoivan's avatar
      po: add Ukrainian translation · 476a0c4d
      Yuri Chornoivan authored
      Signed-off-by: default avatarTheodore Ts'o <tytso@mit.edu>
      476a0c4d
    • Trần Ngọc Quân's avatar
      1a7f2326
    • Göran Uddeborg's avatar
      a2d6a7d9
    • Jakub Bogusz's avatar
      po: update pl.po (from translationproject.org) · 3f19bda0
      Jakub Bogusz authored
      Signed-off-by: default avatarTheodore Ts'o <tytso@mit.edu>
      3f19bda0
    • Benno Schulenberg's avatar
      a73cb6f1
    • Milo Casagrande's avatar
      ffbe17c7
    • Samuel Thibault's avatar
      c9cbc954
    • Philipp Thomas's avatar
      9bf4107d
    • Petr Pisar's avatar
      po: update cs.po (from translationproject.org) · 868d1e9f
      Petr Pisar authored
      Signed-off-by: default avatarTheodore Ts'o <tytso@mit.edu>
      868d1e9f
    • Theodore Ts'o's avatar
      e2fsck: reopen the file system with saved flags after a journal replay · 0d19ccbd
      Theodore Ts'o authored
      After a journal replay, we close and reopen the file system so that
      any changes in the superblock can get reflected in the libext2fs's
      internal data structures.  We need to save the flags passed to
      ext2fs_open() that we used when we originally opened the file system.
      
      Otherwise we will end up not be able to repair a file system which
      requires a journal replay and which has bigalloc enabled or which has
      more than 2**32 blocks; e2fsck will abort with the error message:
      
      fsck.ext4: Filesystem too large to use legacy bitmaps while trying to re-open
      
      Addresses-Debian-Bug: 744953
      Cc: Андрей Василишин <a.vasilishin@kpi.ua>
      Cc: Jon Severinsson <jon@severinsson.net>
      Cc: 744953@bugs.debian.org
      0d19ccbd
    • Akira Fujita's avatar
      mke2fs: prevent creation of unmountable ext4 with large flex_bg count · d988201e
      Akira Fujita authored
      
      In mke2fs command, if flex_bg count is too large to filesystem blocks
      count, unmountable ext4 which has the out of filesystem block offset
      is created (Case1).  Moreover this large flex_bg count causes an
      unintentional metadata layout (bmap-imap-itable-bmap-imap-itable .. in
      block group) (Case2).
      
      To fix these issues and keep healthy flex_bg layout, disallow creating
      ext4 with obviously large flex_bg count to filesystem blocks count.
      
      Steps to reproduce:
      (Case1)
      1.
          # mke2fs -t ext4 -b 4096 -O ^resize_inode -G $((2**20)) DEV 2130483
      
      2.
          # mount -t ext4 DEV MP
          mount: wrong fs type, bad option, bad superblock on /dev/sdb4,
                 missing codepage or helper program, or other error
                 In some cases useful info is found in syslog - try
                 dmesg | tail  or so
      
      3.
          # dumpe2fs DEV
          ...
          Block count:              2130483
          ...
          Flex block group size:    1048576
          ...
          Group 65: (Blocks 2129920-2130482) [INODE_UNINIT]
            Checksum 0x4cb3, unused inodes 8080
            Block bitmap at 67 (bg #0 + 67), Inode bitmap at 1048643 (bg #32 + 67)
            Inode table at 2129979-2130483 (+59)
                                   ^^^^^^^  2130483 is out of FS!
            65535 free blocks, 8080 free inodes, 0 directories, 8080 unused inodes
            Free blocks:
            Free inodes: 525201-533280
      
      (Case2)
      1.
          # mke2fs -t ext4 -G 2147483648 DEV 3145728
      
      2.
          # debugfs -R stats DEV
          ...
          Block count:              786432
          ...
          Flex block group size:    2147483648
          ...
           Group  0: block bitmap at 193, inode bitmap at 194, inode table at 195
          ...
           Group  1: block bitmap at 707, inode bitmap at 708, inode table at 709
          ...
           Group  2: block bitmap at 1221, inode bitmap at 1222, inode table at 1223
          ...
      Signed-off-by: default avatarAkira Fujita <a-fujita@rs.jp.nec.com>
      Signed-off-by: default avatarTheodore Ts'o <tytso@mit.edu>
      Reviewed-by: default avatarAndreas Dilger <adilger@dilger.ca>
      d988201e
    • Akira Fujita's avatar
      mke2fs: add get_uint_from_profile to mke2fs.c · d0de4c95
      Akira Fujita authored
      
      We can set flex_bg count only up to 2^30 with profile
      because get_int_from_profile can handle it to 2^31-1.
      Add get_uint_from_profile to read unsigned int value
      so that mke2fs with profile can handle up to 2^31 flex_bg same as -G option.
      Signed-off-by: default avatarAkira Fujita <a-fujita@rs.jp.nec.com>
      Signed-off-by: default avatarTheodore Ts'o <tytso@mit.edu>
      d0de4c95
    • Akira Fujita's avatar
      mke2fs: set upper limit to flex_bg count · a131053e
      Akira Fujita authored
      
      mke2fs -G option allows root user to set flex_bg count (power of 2).
      However ext4 has bad metadata layout if we specify more than or equal to
      2^32 to mke2fs -G, because of the 32bit shift operation
      in ext2fs_allocate_group_table().
      
      And the maximum block group count of ext4 is 2^32 -1 (ext4_group_t
      s_groups_count), so diallow more than 2^32 flex_bg count.
      
      Steps to reproduce:
      
         # mke2fs -t ext4 -G 4294967296 DEV
      
         # dumpe2fs DEV
         ...
         Flex block group size:    1          <----- flex_bg is 1!
         ...
         Group 0: (Blocks 0-32767)
           Checksum 0x4afd, unused inodes 7541
           Primary superblock at 0, Group descriptors at 1-1
           Reserved GDT blocks at 2-59
           Block bitmap at 60 (+60), Inode bitmap at 61 (+61)
           Inode table at 62-533 (+62)
           32228 free blocks, 7541 free inodes, 2 directories, 7541 unused inodes
           Free blocks: 540-32767
           Free inodes: 12-7552
         Group 1: (Blocks 32768-65535) [INODE_UNINIT]
           Checksum 0xc890, unused inodes 7552
           Backup superblock at 32768, Group descriptors at 32769-32769
           Reserved GDT blocks at 32770-32827
           Block bitmap at 32828 (+60), Inode bitmap at 32829 (+61)
           Inode table at 32830-33301 (+62)
           32234 free blocks, 7552 free inodes, 0 directories, 7552 unused inodes
           Free blocks: 33302-65535
           Free inodes: 7553-15104
         ...
      Signed-off-by: default avatarAkira Fujita <a-fujita@rs.jp.nec.com>
      Signed-off-by: default avatarTheodore Ts'o <tytso@mit.edu>
      Reviewed-by: default avatar"Darrick J. Wong" <darrick.wong@oracle.com>
      a131053e
    • Andreas Dilger's avatar
      mke2fs: handle flex_bg collision with backup descriptors · f7a51a12
      Andreas Dilger authored
      
      If a large flex_bg factor is specified and the block allocator was
      laying out block or inode bitmaps or inode tables, and collides with
      previously allocated metadata (for example the backup superblock or
      group descriptors) it would reset the allocator back to the beginning
      of the flex_bg instead of continuing past the obstruction.
      
      For example, with "-G 131072" the inode table will hit the backup
      descriptors in groups 1, 3, 5, 7, 9 and start interleaving with the
      block and inode bitmaps.  That results in poorly allocated bitmaps
      and inode tables that are interleaved and not contiguous as was
      intended for flex_bg:
      
       Group 0: (Blocks 0-32767)
         Primary superblock at 0, Group descriptors at 1-2048
         Block bitmap 2049 (+2049), Inode bitmap at 133121 (bg #4+2049)
         Inode table 264193-264200 (bg #8+2049)
         :
         :
       Group 3838: (Blocks 125763584-125796351) [INODE_UNINIT, BLOCK_UNINIT]
         Block bitmap 5887 (bg #0+5887), Inode bitmap 136959 (bg #4+5887)
         Inode table 294897-294904 (bg #8 + 32753)
       Group 3839: (Blocks 125796352-125829119) [INODE_UNINIT, BLOCK_UNINIT]
         Block bitmap 5888 (bg #0+5888), Inode bitmap 136960 (bg #4+5888)
         Inode table 5889-5896 (bg #0 + 5889)
       Group 3840: (Blocks 125829120-125861887) [INODE_UNINIT, BLOCK_UNINIT]
         Block bitmap 5897 (bg #0+5897), Inode bitmap 136961 (bg #4+5889)
         Inode table 5898-5905 (bg #0 + 5898)
         :
         :
      
      Instead, skip the intervening blocks if there aren't too many of them.
      That mostly keeps the flex_bg allocations from colliding, though still
      not perfect because there is still some overlap with the backups.
      This patch addresses the majority of the problem, allowing about 124k
      groups to be layed out perfectly, instead of less than 4k groups with
      the previous code.
      Signed-off-by: default avatarAndreas Dilger <adilger@dilger.ca>
      Signed-off-by: default avatarTheodore Ts'o <tytso@mit.edu>
      f7a51a12
    • Lukas Czerner's avatar
      mke2fs: enable lazy_itable_init on newer kernel by default · 7584b8db
      Lukas Czerner authored
      
      Currently is used did not specified lazy_itable_init option we rely on
      information from ext4 module exported via sysfs interface. However if
      the ext4 module is not loaded it will not be enabled even though kernel
      might support it.
      
      With this commit we set the default according to the kernel version,
      however we still allow it to be set manually via extended option or be
      enabled in case that ext4 module advertise that it supports this
      feature.
      Signed-off-by: default avatarLukas Czerner <lczerner@redhat.com>
      Signed-off-by: default avatarTheodore Ts'o <tytso@mit.edu>
      Reviewed-by: default avatarEric Sandeen <sandeen@redhat.com>
      7584b8db
    • Lukas Czerner's avatar
      d27a559c
    • Lukas Czerner's avatar
      e2fsprogs: introduce ext2fs_close_free() helper · 47fee2ef
      Lukas Czerner authored
      
      Currently there are many uses of ext2fs_close() which might be wrong.
      First of all ext2fs_close() does not set the ext2_filsys pointer to NULL
      so the caller is responsible for clearing it, however there are some
      cases there we do not do it.
      
      Second of all very small number of users of ext2fs_close() actually
      check the return value. If there is a problem in ext2fs_close() it will
      not even free the ext2_filsys structure, but majority of users expect it
      to do so.
      
      To fix both problems this commit introduces a new helper
      ext2fs_close_free() which will not only check for the return value and
      free the ext2_filsys structure if the call to ext2fs_close2() failed,
      but it will also set the ext2_filsys pointer to NULL.
      
      Replace every use of ext2fs_close() in e2fsprogs tools with
      ext2fs_close_free() - there is no real reason to keep using
      ext2fs_close().
      Signed-off-by: default avatarLukas Czerner <lczerner@redhat.com>
      Signed-off-by: default avatarTheodore Ts'o <tytso@mit.edu>
      Reviewed-by: default avatarDarrick J. Wong <darrick.wong@oracle.com>
      47fee2ef
    • Theodore Ts'o's avatar
      fix cross-compilation support · e7822c1f
      Theodore Ts'o authored
      Commit 2500ebfc (util: fix make dependencies for subst) broke cross
      compilation because it unconditionally used config.h without setting a
      includes path so that the config.h file could be found.
      
      The proposed fix of adding the include path (such as was proposed at
      http://patchwork.ozlabs.org/patch/355662/ or in Debian Bug #753375)
      isn't really the right way to go, since the information in config.h is
      for the target environment, and not the build environment.  So using
      config.h when building helper programs used as part of the build can
      potentially cause more problems than it solves.
      
      In general, build helpers must be written to be as portable as
      possible, and to not require any autoconf defined #ifdef's whenever
      possible.  The subst program broke this rule to (1) address a Coverity
      security complaint by using futimes(2) instad of utimes(2) if present,
      and (2) to preserve the nanosecond portion of the file timestamp.
      
      Oh, well.  We won't be able to do the latter when cross compiling, and
      as to the former, if an attacker has write access to your build tree
      while you are building programs that will be run as root, you've got
      bigger problems.  :-)
      
      Fix the problem that commit 2500ebfc
      
       was trying to address by
      explicitly adding @DEFS@ to CFLAGS, so that -DHAVE_CONFIG_H is passed
      to make depend.  This fixes up the make depend without forcing the use
      of config.h when cross-compiling.
      
      Addresses-Debian-Bug: #753375
      Signed-off-by: default avatarTheodore Ts'o <tytso@mit.edu>
      Tested-by: default avatarGustavo Zacarias <gustavo@zacarias.com.ar>
      Cc: Helmut Grohne <helmut@subdivi.de>
      Cc: 753375@bugs.debian.org
      e7822c1f
  4. 05 Jul, 2014 7 commits
    • Theodore Ts'o's avatar
      configure.in: fix external libblkid test for static link · 2d7583bd
      Theodore Ts'o authored
      
      External libblkid needs -luuid when linking statically.
      
      Also fix up the bogus other-lib parameter in the libuuid test;
      $LIBUUID is the null string, so it doesn't do anything other than
      obfuscate the use of AC_CHECK_LIB.
      Reported-by: default avatarBaruch Siach <baruch@tkos.co.il>
      Signed-off-by: default avatarTheodore Ts'o <tytso@mit.edu>
      2d7583bd
    • Andreas Dilger's avatar
      blkid,ext2fs: avoid name clash with __u{8,16,32,64} · 5023510d
      Andreas Dilger authored
      
      Try to avoid name clashes with definitions of __u8, __u16, __u32,
      and __u64 in userspace, in case other headers also define these
      types.  Define HAVE___{S,U}{8,16,32,64} preprocessor macros to
      show that these types are already defined.
      
      This would avoid the need to check for _BLKID_TYPES_H in ext2_types.h
      and _EXT2_TYPES_H in blkid_types.h, but since older versions of these
      headers did not use HAVE___U8 et.al. keep these checks around for now.
      
      Report an error if there are no 64-bit types available.  The code
      will not compile if these are not available.
      Signed-off-by: default avatarAndreas Dilger <adilger@dilger.ca>
      Signed-off-by: default avatarTheodore Ts'o <tytso@mit.edu>
      5023510d
    • Andreas Dilger's avatar
      blkid: remove unnecessary header and comment · 51050544
      Andreas Dilger authored
      The LIST_HEAD macro is not directly used in getsize.c, so
      <sys/queue.h> is not needed at all, and could cause confusion at
      some later point if the Linux-style list macros are ever used.
      
      Build was verified on MacOS which defined HAVE_SYS_DISK_H true.
      I manually inspected the sources for recent *BSD headers to check
      if this was needed there or not.  MacOS and FreeBSD <sys/disk.h>
      do not use lists at all.  NetBSD and OpenBSD <sys/disk.h> and all
      of the <sys/mount.h> headers include <sys/queue.h> internally.
      
      I used http://fxr.watson.org/fxr/source/sys/mount.h?v={OSTYPE}
      
      
      as a reference, checking both old and new *BSD versions.
      Signed-off-by: default avatarAndreas Dilger <adilger@dilger.ca>
      Signed-off-by: default avatarTheodore Ts'o <tytso@mit.edu>
      51050544
    • Eric Sandeen's avatar
      e2fsprogs: add mount options to ext4.5 · 3e500a8f
      Eric Sandeen authored
      
      This is a straight cut and paste from the util-linux
      mount manpage to ext4.5 (with commented-out lines
      removed).
      
      It's pretty much impossible for util-linux to keep up
      with every filesystem out there, and Karel has more than
      once expressed a wish that mount options move into fs-specific
      manpages.
      
      So, here we go.
      Signed-off-by: default avatarEric Sandeen <sandeen@redhat.com>
      Signed-off-by: default avatarTheodore Ts'o <tytso@mit.edu>
      3e500a8f
    • Eric Sandeen's avatar
      e2fsprogs: revise and extend chattr(1) and chattr usage() · 272258e1
      Eric Sandeen authored
      
      The chattr(1) manpage and chattr usage() output were missing some flags.
      
      Add those, and make some other minor cosmetic fixes.
      
      (I've left out the 'B' (EXT2_COMPRBLK_FL) flag, because
      it's not actually used anywhere, and I can't figure out
      how it differs from 'c' (EXT2_COMPR_FL))
      
      Also, because the matrix of filesystems & flags is quite large,
      refer to filesystem-specific manpages for detailed discussion
      of flags supported by those filesystems, rather than trying to
      cover it all in this manpage.  I'll send those manpage
      updates to the appropriate lists a bit later.
      Signed-off-by: default avatarEric Sandeen <sandeen@redhat.com>
      Signed-off-by: default avatarTheodore Ts'o <tytso@mit.edu>
      Reviewed-by: default avatarAndreas Dilger <adilger@dilger.ca>
      272258e1
    • Eric Sandeen's avatar
      e2fsprogs: reorder flags in chattr(1) · 5b9aaae7
      Eric Sandeen authored
      
      The flags described in chattr usage() and the chattr(1) manpage
      were in semi-random order, which makes it hard to ascertain
      which flags might be missing or undocumented, and to locate
      flags within the manpage.
      
      Re-order the list of flags in alphanumeric order, and do
      the same for the flag descriptions in the body of the manpage.
      
      There should be no content changes here, just reordering
      for consistency.
      Signed-off-by: default avatarEric Sandeen <sandeen@redhat.com>
      Signed-off-by: default avatarTheodore Ts'o <tytso@mit.edu>
      Reviewed-by: default avatarAndreas Dilger <adilger@dilger.ca>
      5b9aaae7
    • Jan Kara's avatar
      e2fsck: fix last mount time and last write time in preen mode · 87aca2ad
      Jan Kara authored
      
      Fixing last mount time and last write time is safe - there's no risk of
      loosing any important information or making corruption significantly
      worse even if we get it wrong. So let's just fix these times in preen
      mode. This allows initrd to automatically check and mount root
      filesystem in case system clock is wrong without having to manually set
      broken_system_clock variable (openSUSE uses broken_system_clock by default
      to avoid these problems during boot but this disables time-based checks
      even on systems where clock is fine so that's not ideal either).
      Signed-off-by: default avatarJan Kara <jack@suse.cz>
      Signed-off-by: default avatarTheodore Ts'o <tytso@mit.edu>
      87aca2ad