Whamcloud - gitweb
tools/e2fsprogs.git
9 years agodebian: update changelog for 1.42.10-2 release
Theodore Ts'o [Sun, 13 Jul 2014 20:18:38 +0000 (16:18 -0400)]
debian: update changelog for 1.42.10-2 release

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
9 years agopo: update fr.po (from translationproject.org)
Samuel Thibault [Sun, 13 Jul 2014 17:12:51 +0000 (13:12 -0400)]
po: update fr.po (from translationproject.org)

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
9 years agoUse a wildcard for static libs in the git ignore list
Paul Wise [Sat, 12 Jul 2014 15:56:49 +0000 (11:56 -0400)]
Use a wildcard for static libs in the git ignore list

Signed-off-by: Paul Wise <pabs3@bonedaddy.net>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
9 years agoAdd more generated files to the git ignore list
Paul Wise [Sat, 12 Jul 2014 15:56:49 +0000 (11:56 -0400)]
Add more generated files to the git ignore list

Signed-off-by: Paul Wise <pabs3@bonedaddy.net>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
9 years agolib/ext2fs: Only build tst_libext2fs for make check
Theodore Ts'o [Thu, 10 Jul 2014 20:26:14 +0000 (16:26 -0400)]
lib/ext2fs: Only build tst_libext2fs for make check

It's only necessary to build tst_libext2fs when running "make check".

Also make sure the links of the tst_* programs are done with
$(ALL_LDFLAGS).

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
9 years agoUse sys/syscall.h instead of syscall.h
Theodore Ts'o [Thu, 10 Jul 2014 19:54:42 +0000 (15:54 -0400)]
Use sys/syscall.h instead of syscall.h

Most systems have a backwards compatibility symlink in
/usr/include/syscall.h to /usr/include/sys/syscall.h, but
sys/syscall.h is the documented location of the header file.  Fix two
locations where we were using <syscall.h> instead of <sys/syscall.h>.

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
9 years agomke2fs: fix fencepost error when calling strncat
Theodore Ts'o [Thu, 10 Jul 2014 19:33:57 +0000 (15:33 -0400)]
mke2fs: fix fencepost error when calling strncat

There were other protections which would prevent a buffer overflow
from happening, but we should fix this nevertheless.

Addresses-Coverity-Bug: #1225003
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
9 years agoUpdate release notes, etc. for final 1.42.11 release v1.42.11
Theodore Ts'o [Thu, 10 Jul 2014 03:44:51 +0000 (23:44 -0400)]
Update release notes, etc. for final 1.42.11 release

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
9 years agoFix nroff macro issue in chattr man page
Theodore Ts'o [Thu, 10 Jul 2014 04:47:40 +0000 (00:47 -0400)]
Fix nroff macro issue in chattr man page

The single quote character must not be in the first character in a
line, or else it can get mistaken as a macro call.

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
9 years agoFix up configure so it finds mkinstalldirs
Theodore Ts'o [Thu, 10 Jul 2014 04:17:05 +0000 (00:17 -0400)]
Fix up configure so it finds mkinstalldirs

As an object lesson in why autoreconf is fundamentally unsafe, the
newer version of nls.m4 no longer handles @MKINSTALLDIRS@.  So add
this back, since our Makefiles depend on it.

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
9 years agoUpdate translation files
Theodore Ts'o [Thu, 10 Jul 2014 03:30:49 +0000 (23:30 -0400)]
Update translation files

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
9 years agopo: update vi.po (from translationproject.org)
Trần Ngọc Quân [Thu, 10 Jul 2014 03:13:31 +0000 (23:13 -0400)]
po: update vi.po (from translationproject.org)

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
9 years agopo: update uk.po (from translationproject.org)
Yuri Chornoivan [Thu, 10 Jul 2014 03:13:31 +0000 (23:13 -0400)]
po: update uk.po (from translationproject.org)

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
9 years agopo: update pl.po (from translationproject.org)
Jakub Bogusz [Thu, 10 Jul 2014 03:13:31 +0000 (23:13 -0400)]
po: update pl.po (from translationproject.org)

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
9 years agopo: update nl.po (from translationproject.org)
Benno Schulenberg [Thu, 10 Jul 2014 03:13:31 +0000 (23:13 -0400)]
po: update nl.po (from translationproject.org)

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
9 years agopo: update es.po (from translationproject.org)
Benno Schulenberg [Thu, 10 Jul 2014 03:13:30 +0000 (23:13 -0400)]
po: update es.po (from translationproject.org)

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
9 years agopo: update eo.po (from translationproject.org)
Benno Schulenberg [Thu, 10 Jul 2014 03:13:30 +0000 (23:13 -0400)]
po: update eo.po (from translationproject.org)

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
9 years agopo: update de.po (from translationproject.org)
Philipp Thomas [Thu, 10 Jul 2014 03:13:30 +0000 (23:13 -0400)]
po: update de.po (from translationproject.org)

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
9 years agopo: update cs.po (from translationproject.org)
Petr Pisar [Thu, 10 Jul 2014 03:13:30 +0000 (23:13 -0400)]
po: update cs.po (from translationproject.org)

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
9 years agomke2fs: add support to align hugefiles relative to beginning of the disk
Theodore Ts'o [Wed, 9 Jul 2014 00:02:48 +0000 (20:02 -0400)]
mke2fs: add support to align hugefiles relative to beginning of the disk

Add the mke2fs.conf configuration option which causes the hugefiles to
be aligned to the beginning of the disk.  This is important if the the
reason for aligning the hugefiles is to support hard-drive specific
features such as Shingled Magnetic Recording (SMR).

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
9 years agoUpdate translation files for upcoming 1.42.11 release
Theodore Ts'o [Sun, 6 Jul 2014 03:44:28 +0000 (23:44 -0400)]
Update translation files for upcoming 1.42.11 release

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
9 years agopo: add Esperanto translation
Benno Schulenberg [Sun, 6 Jul 2014 03:39:54 +0000 (23:39 -0400)]
po: add Esperanto translation

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
9 years agopo: add Ukrainian translation
Yuri Chornoivan [Sun, 6 Jul 2014 03:31:42 +0000 (23:31 -0400)]
po: add Ukrainian translation

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
9 years agopo: update vi.po (from translationproject.org)
Trần Ngọc Quân [Sun, 6 Jul 2014 03:18:05 +0000 (23:18 -0400)]
po: update vi.po (from translationproject.org)

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
9 years agopo: update sv.po (from translationproject.org)
Göran Uddeborg [Sun, 6 Jul 2014 03:18:05 +0000 (23:18 -0400)]
po: update sv.po (from translationproject.org)

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
9 years agopo: update pl.po (from translationproject.org)
Jakub Bogusz [Sun, 6 Jul 2014 03:18:05 +0000 (23:18 -0400)]
po: update pl.po (from translationproject.org)

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
9 years agopo: update nl.po (from translationproject.org)
Benno Schulenberg [Sun, 6 Jul 2014 03:18:05 +0000 (23:18 -0400)]
po: update nl.po (from translationproject.org)

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
9 years agopo: update it.po (from translationproject.org)
Milo Casagrande [Sun, 6 Jul 2014 03:18:04 +0000 (23:18 -0400)]
po: update it.po (from translationproject.org)

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
9 years agopo: update fr.po (from translationproject.org)
Samuel Thibault [Sun, 6 Jul 2014 03:18:04 +0000 (23:18 -0400)]
po: update fr.po (from translationproject.org)

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
9 years agopo: update de.po (from translationproject.org)
Philipp Thomas [Sun, 6 Jul 2014 03:18:04 +0000 (23:18 -0400)]
po: update de.po (from translationproject.org)

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
9 years agopo: update cs.po (from translationproject.org)
Petr Pisar [Sun, 6 Jul 2014 03:18:04 +0000 (23:18 -0400)]
po: update cs.po (from translationproject.org)

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
9 years agoe2fsck: reopen the file system with saved flags after a journal replay
Theodore Ts'o [Sun, 6 Jul 2014 02:53:29 +0000 (22:53 -0400)]
e2fsck: reopen the file system with saved flags after a journal replay

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
9 years agomke2fs: prevent creation of unmountable ext4 with large flex_bg count
Akira Fujita [Sun, 6 Jul 2014 02:42:36 +0000 (22:42 -0400)]
mke2fs: prevent creation of unmountable ext4 with large flex_bg count

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: Akira Fujita <a-fujita@rs.jp.nec.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Reviewed-by: Andreas Dilger <adilger@dilger.ca>
9 years agomke2fs: add get_uint_from_profile to mke2fs.c
Akira Fujita [Sun, 6 Jul 2014 02:34:07 +0000 (22:34 -0400)]
mke2fs: add get_uint_from_profile to mke2fs.c

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: Akira Fujita <a-fujita@rs.jp.nec.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
9 years agomke2fs: set upper limit to flex_bg count
Akira Fujita [Sun, 6 Jul 2014 02:14:08 +0000 (22:14 -0400)]
mke2fs: set upper limit to flex_bg count

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: Akira Fujita <a-fujita@rs.jp.nec.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Reviewed-by: "Darrick J. Wong" <darrick.wong@oracle.com>
9 years agomke2fs: handle flex_bg collision with backup descriptors
Andreas Dilger [Fri, 28 Feb 2014 20:15:45 +0000 (13:15 -0700)]
mke2fs: handle flex_bg collision with backup descriptors

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: Andreas Dilger <adilger@dilger.ca>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
9 years agomke2fs: enable lazy_itable_init on newer kernel by default
Lukas Czerner [Sun, 6 Jul 2014 01:08:34 +0000 (21:08 -0400)]
mke2fs: enable lazy_itable_init on newer kernel by default

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: Lukas Czerner <lczerner@redhat.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Reviewed-by: Eric Sandeen <sandeen@redhat.com>
9 years agomke2fs: add revision to the is_before_linux_ver()
Lukas Czerner [Sun, 6 Jul 2014 01:07:55 +0000 (21:07 -0400)]
mke2fs: add revision to the is_before_linux_ver()

Signed-off-by: Lukas Czerner <lczerner@redhat.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
9 years agoe2fsprogs: introduce ext2fs_close_free() helper
Lukas Czerner [Sun, 6 Jul 2014 01:06:29 +0000 (21:06 -0400)]
e2fsprogs: introduce ext2fs_close_free() helper

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: Lukas Czerner <lczerner@redhat.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
9 years agofix cross-compilation support
Theodore Ts'o [Sun, 6 Jul 2014 00:23:23 +0000 (20:23 -0400)]
fix cross-compilation support

Commit 2500ebfc89 (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 2500ebfc89 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: Theodore Ts'o <tytso@mit.edu>
Tested-by: Gustavo Zacarias <gustavo@zacarias.com.ar>
Cc: Helmut Grohne <helmut@subdivi.de>
Cc: 753375@bugs.debian.org
9 years agoconfigure.in: fix external libblkid test for static link
Theodore Ts'o [Sat, 5 Jul 2014 04:27:02 +0000 (00:27 -0400)]
configure.in: fix external libblkid test for static link

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: Baruch Siach <baruch@tkos.co.il>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
9 years agoblkid,ext2fs: avoid name clash with __u{8,16,32,64}
Andreas Dilger [Sat, 5 Jul 2014 03:34:10 +0000 (23:34 -0400)]
blkid,ext2fs: avoid name clash with __u{8,16,32,64}

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: Andreas Dilger <adilger@dilger.ca>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
9 years agoblkid: remove unnecessary header and comment
Andreas Dilger [Wed, 11 Jun 2014 18:59:05 +0000 (12:59 -0600)]
blkid: remove unnecessary header and comment

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: Andreas Dilger <adilger@dilger.ca>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
9 years agoe2fsprogs: add mount options to ext4.5
Eric Sandeen [Sat, 5 Jul 2014 03:07:36 +0000 (23:07 -0400)]
e2fsprogs: add mount options to ext4.5

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: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
9 years agoe2fsprogs: revise and extend chattr(1) and chattr usage()
Eric Sandeen [Sat, 5 Jul 2014 03:03:14 +0000 (23:03 -0400)]
e2fsprogs: revise and extend chattr(1) and chattr usage()

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: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Reviewed-by: Andreas Dilger <adilger@dilger.ca>
9 years agoe2fsprogs: reorder flags in chattr(1)
Eric Sandeen [Sat, 5 Jul 2014 03:02:59 +0000 (23:02 -0400)]
e2fsprogs: reorder flags in chattr(1)

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: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Reviewed-by: Andreas Dilger <adilger@dilger.ca>
9 years agoe2fsck: fix last mount time and last write time in preen mode
Jan Kara [Fri, 4 Jul 2014 20:24:18 +0000 (16:24 -0400)]
e2fsck: fix last mount time and last write time in preen mode

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: Jan Kara <jack@suse.cz>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
9 years agomke2fs: prevent creation of filesystem with unsupported revision
Frank Sorenson [Fri, 4 Jul 2014 19:31:50 +0000 (15:31 -0400)]
mke2fs: prevent creation of filesystem with unsupported revision

It's a bit strange to accept revision levels higher than
the code creating the filesystem can understand, so don't
allow it.

At least the kernel will mount the fs readonly if it's too
high, but no other utility will touch it, so you can't
fix the error.

Just reject anything > EXT2_MAX_SUPP_REV at mkfs time.

Signed-off-by: Frank Sorenson <fsorenso@redhat.com>
[sandeen@redhat.com: Add more verbose commit log]
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
9 years agoe2fsprogs: remove checker infrastructure
Eric Sandeen [Thu, 17 Apr 2014 22:05:38 +0000 (17:05 -0500)]
e2fsprogs: remove checker infrastructure

Per http://www.gnu.org/software/checker/ the gcc "-checker" option
is long deprecated.  Nuke it from e2fsprogs.

Most people would never hit this, but people who love to turn knobs,
such as the reporter of kernel.org bz#74171, might run into it and be
sad.

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
9 years agoUpdate to latest version of config.* files
Theodore Ts'o [Fri, 4 Jul 2014 04:30:04 +0000 (00:30 -0400)]
Update to latest version of config.* files

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
9 years agoaclocal.m4: update to newer versions of autoconf macros
Theodore Ts'o [Fri, 4 Jul 2014 03:44:13 +0000 (23:44 -0400)]
aclocal.m4: update to newer versions of autoconf macros

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
9 years agomove e2fsprogs-specific macros from aclocal.m4 to acinclude.m4
Ross Burton [Fri, 4 Jul 2014 03:19:38 +0000 (23:19 -0400)]
move e2fsprogs-specific macros from aclocal.m4 to acinclude.m4

Autoconf says that aclocal.m4 is a machine-generated copy of
system-wide macros, whereas acinclude.m4 is for project-specific
macros.  Reflect this division and ease building by anyone who needs
to re-generate the autotooling by splitting AX_TLS and CHECK_GNU_MAKE
to acinclude.m4.

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
9 years agodebugfs: add support setting the error_count and associated sb fields
Theodore Ts'o [Fri, 4 Jul 2014 02:28:24 +0000 (22:28 -0400)]
debugfs: add support setting the error_count and associated sb fields

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
9 years agotests: avoid using mktemp -t
Theodore Ts'o [Fri, 4 Jul 2014 02:16:48 +0000 (22:16 -0400)]
tests: avoid using mktemp -t

The -t option is documented as deprecated in GNU's mktemp, and
FreeBSD's mktemp doesn't support it at all.

Replace it with the construct "mktemp ${TMPDIR:-/tmp}/foo.XXXXXX"

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
9 years agotests: clean up the temp file if test_one is interrupted
Theodore Ts'o [Mon, 9 Jun 2014 14:47:41 +0000 (10:47 -0400)]
tests: clean up the temp file if test_one is interrupted

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
9 years agotests: fix left-over e2fsprogs-tmp files not getting clean up
Theodore Ts'o [Mon, 9 Jun 2014 14:34:17 +0000 (10:34 -0400)]
tests: fix left-over e2fsprogs-tmp files not getting clean up

In addition, incorporate the test name into the e2fsprogs-tmp to make
it easier to debug left-over temp files in the future.

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
9 years agotests: for mktemp the exes must be the final characters of the name
Benno Schulenberg [Mon, 9 Jun 2014 14:17:39 +0000 (10:17 -0400)]
tests: for mktemp the exes must be the final characters of the name

Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
9 years agomisc: quiet minor build warnings, ignore generated files
Andreas Dilger [Mon, 9 Jun 2014 13:53:40 +0000 (09:53 -0400)]
misc: quiet minor build warnings, ignore generated files

Quiet a couple of build warnings in tst_libext2fs.c
Add missing unistd.h header for misc/util.c.

Ignore generated files for lib/ext2fs/tst_libext2fs and intl/ files.

Signed-off-by: Andreas Dilger <adilger@dilger.ca>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
9 years agoresize2fs: don't attempt to calculate minimum size on fs with errors
Eric Sandeen [Mon, 9 Jun 2014 13:52:19 +0000 (09:52 -0400)]
resize2fs: don't attempt to calculate minimum size on fs with errors

My old patch:

resize2fs: don't print minimum size if fs is not clean

almost did this, but it still calculated the size; it just didn't print
it.  Which is a bit silly.

Jes had a pretty badly corrupted image which made the minimum size
calculation go off into the weeds.  It was corrupted, and also marked
as having an error.

We'll eventually bail out for an unmounted filesystem if it's marked
as being in an error state anyway; just move that test & bail-out
to a much earlier point, and remove the now-duplicate one under the
print_min_size block.

This will catch & block all resize operations on an offline filesystem
with errors, in one central place.

Reported-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
10 years agoe2fsck: sort the abbreviations better
Benno Schulenberg [Wed, 4 Jun 2014 01:59:31 +0000 (21:59 -0400)]
e2fsck: sort the abbreviations better

This makes it easier for translators to look up what they've done.

Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
10 years agoe2fsck: make two comments match the messages
Benno Schulenberg [Wed, 4 Jun 2014 01:59:31 +0000 (21:59 -0400)]
e2fsck: make two comments match the messages

Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
10 years agoe2fsck: make a prompt message simpler and thus translatable
Benno Schulenberg [Wed, 4 Jun 2014 01:59:31 +0000 (21:59 -0400)]
e2fsck: make a prompt message simpler and thus translatable

It can be made simpler because there is no need to differentiate between
having an internal journal inode and having an external journal device.

Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
10 years agopo: describe more precisely the %B expansion
Benno Schulenberg [Wed, 4 Jun 2014 01:59:31 +0000 (21:59 -0400)]
po: describe more precisely the %B expansion

Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
10 years agofilefrag: fix issues with 29758d2
Eric Sandeen [Mon, 2 Jun 2014 01:27:41 +0000 (21:27 -0400)]
filefrag: fix issues with 29758d2

29758d2 filefrag: exit with error code if an error is hit

introduced a couple errors; in one case it missed returning
a value, and possibly picked up errno from (unchecked) close(),
and in the other used a test where it needed an
assignment.  So capture the error, move perror() directly
after the failed call in both cases, and fix the assignment.

Also fix a precedence problem with:

if (fe_flags & mask == 0)

which is equivalent to:

if (fe_flags & (mask == 0))

but we need:

if ((fe_flags & mask) == 0)

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Reviewed-by: Andreas Dilger <adilger@dilger.ca>
10 years agopo: add %It to the list of recognized expansions
Benno Schulenberg [Sun, 1 Jun 2014 21:29:50 +0000 (23:29 +0200)]
po: add %It to the list of recognized expansions

Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
10 years agoe2fsck: fully and properly gettextize two error messages
Benno Schulenberg [Sun, 1 Jun 2014 21:27:49 +0000 (23:27 +0200)]
e2fsck: fully and properly gettextize two error messages

The phrases "mounted" and "in use" were filled in untranslated into
the messages.  But it is better to gettextize entire sentences, and
not synthesize them from fragments.

Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
10 years agomke2fs: fix a typo in an error message
Benno Schulenberg [Mon, 2 Jun 2014 01:12:47 +0000 (21:12 -0400)]
mke2fs: fix a typo in an error message

Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
10 years agoFix up minor typo in German translation
Theodore Ts'o [Sat, 31 May 2014 17:37:30 +0000 (13:37 -0400)]
Fix up minor typo in German translation

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Cc: pth@suse.de
10 years agopo: update de.po (from translationproject.org)
Philipp Thomas [Sat, 31 May 2014 17:32:39 +0000 (13:32 -0400)]
po: update de.po (from translationproject.org)

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
10 years agofilefrag: exit with error code if an error is hit
Andreas Dilger [Tue, 27 May 2014 16:56:45 +0000 (12:56 -0400)]
filefrag: exit with error code if an error is hit

If an error is hit during filefrag operation, it will continue to run
(if multiple files are specified on the command-line), but will exit
with a non-zero value, so that callers can determine that some error
was hit.

Clean up the printing of FIEMAP flags and print some newer flags that
were missing.  Also print unknown flags as hex values.

Signed-off-by: Andreas Dilger <adilger@dilger.ca>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
10 years agolib/ext2fs: clean and build ext2_types.h as necessary
Theodore Ts'o [Tue, 27 May 2014 16:24:33 +0000 (12:24 -0400)]
lib/ext2fs: clean and build ext2_types.h as necessary

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
10 years agotst_libext2fs: add new debug program which used for libext2fs unit tests
Theodore Ts'o [Fri, 23 May 2014 14:28:04 +0000 (10:28 -0400)]
tst_libext2fs: add new debug program which used for libext2fs unit tests

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
10 years agomisc: use unsigned long long for file block count in filefrag
Vitaliy Filippov [Mon, 26 May 2014 16:08:35 +0000 (12:08 -0400)]
misc: use unsigned long long for file block count in filefrag

This patch fixes incorrect reporting of file block count on 32-bit platforms.

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
10 years agoe2fsprogs: don't run quota test if quota is not enabled
Eric Sandeen [Mon, 26 May 2014 15:43:24 +0000 (11:43 -0400)]
e2fsprogs: don't run quota test if quota is not enabled

The default configuration still has quota disabled, but
runs the f_quota test unconditionally, so we fail by
default.

Fix that...

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
10 years agoe2fsck: fix Makefile dependency for quota.o
Theodore Ts'o [Thu, 22 May 2014 22:52:27 +0000 (18:52 -0400)]
e2fsck: fix Makefile dependency for quota.o

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
10 years agodebugfs: fix debugfs/quota.c compile warnings
Andreas Dilger [Thu, 22 May 2014 06:38:07 +0000 (00:38 -0600)]
debugfs: fix debugfs/quota.c compile warnings

Fix type mismatch and unused variable warnings.

Signed-off-by: Andreas Dilger <adilger@dilger.ca>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
10 years agodebugfs: fix filehandle leak in copy_file()
Andreas Dilger [Tue, 20 May 2014 22:30:35 +0000 (16:30 -0600)]
debugfs: fix filehandle leak in copy_file()

Fix a file handle leak for the target file in copy_file() when error
handlers return without closing the file.  Instead, clean up at the
end of the function to handle cleanup in normal and error cases.

Minor other code style cleanups.

Signed-off-by: Andreas Dilger <adilger@dilger.ca>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
10 years agodebugfs: fix string_to_time for MacOS strptime()
Andreas Dilger [Tue, 20 May 2014 22:31:10 +0000 (16:31 -0600)]
debugfs: fix string_to_time for MacOS strptime()

The strptime() function does not update fields in struct tm that are
not specified in the input format.  The glibc implementation sets the
tm_yday field (%j) when any of the year (%Y), month (%m), or day (%d)
fields are changed, but the MacOS strptime() does not set tm_yday in
this case.  This caused string_to_time() to calculate the wrong Unix
epoch on MacOS. If tm_yday is unset, compute it in string_to_time().

This also fixes test regression failures for FreeBSD.

Signed-off-by: Andreas Dilger <adilger@dilger.ca>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
10 years agomke2fs: use ext2fs_open_file() in check_plausibility()
Eric Sandeen [Wed, 21 May 2014 17:47:44 +0000 (12:47 -0500)]
mke2fs: use ext2fs_open_file() in check_plausibility()

The commit:

802146c mke2fs: create a regular file if necessary

caused a regression on 32-bit machines; the open() fails if
the file size is > 4G.

Using ext2fs_open_file() fixes it.

Addresses-Red-Hat-Bugzilla: #1099892

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
10 years agoUpdate release notes, etc. for final 1.42.10 release v1.42.10
Theodore Ts'o [Mon, 19 May 2014 01:51:21 +0000 (21:51 -0400)]
Update release notes, etc. for final 1.42.10 release

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
10 years agodebian: override source-is-missing false positive
Theodore Ts'o [Mon, 19 May 2014 02:51:22 +0000 (22:51 -0400)]
debian: override source-is-missing false positive

See: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=748421

Once a new version of Lintian is uploaded with this fixed, we can drop
this override.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
10 years agodebian: fix debian/rules compatibility with gmake 4.0
Theodore Ts'o [Mon, 19 May 2014 02:29:01 +0000 (22:29 -0400)]
debian: fix debian/rules compatibility with gmake 4.0

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
10 years agoUpdate translation files for 1.42.10 release
Theodore Ts'o [Mon, 19 May 2014 01:47:32 +0000 (21:47 -0400)]
Update translation files for 1.42.10 release

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
10 years agoFix obvious typo in German translation
Theodore Ts'o [Mon, 19 May 2014 01:36:52 +0000 (21:36 -0400)]
Fix obvious typo in German translation

Addresses-Debian-Bug: #737800

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
10 years agopo: update vi.po (from translationproject.org)
Trần Ngọc Quân [Sun, 18 May 2014 13:46:34 +0000 (09:46 -0400)]
po: update vi.po (from translationproject.org)

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
10 years agopo: update sv.po (from translationproject.org)
Göran Uddeborg [Sun, 18 May 2014 13:46:34 +0000 (09:46 -0400)]
po: update sv.po (from translationproject.org)

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
10 years agopo: update pl.po (from translationproject.org)
Jakub Bogusz [Sun, 18 May 2014 13:46:34 +0000 (09:46 -0400)]
po: update pl.po (from translationproject.org)

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
10 years agopo: update nl.po (from translationproject.org)
Benno Schulenberg [Sun, 18 May 2014 13:46:34 +0000 (09:46 -0400)]
po: update nl.po (from translationproject.org)

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
10 years agopo: update fr.po (from translationproject.org)
Samuel Thibault [Sun, 18 May 2014 13:46:34 +0000 (09:46 -0400)]
po: update fr.po (from translationproject.org)

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
10 years agopo: update es.po (from translationproject.org)
Benno Schulenberg [Sun, 18 May 2014 13:46:34 +0000 (09:46 -0400)]
po: update es.po (from translationproject.org)

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
10 years agopo: update cs.po (from translationproject.org)
Petr Pisar [Sun, 18 May 2014 13:46:34 +0000 (09:46 -0400)]
po: update cs.po (from translationproject.org)

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
10 years agomke2fs: set gdt csum when creating packed fs
Darrick J. Wong [Mon, 12 May 2014 04:21:29 +0000 (00:21 -0400)]
mke2fs: set gdt csum when creating packed fs

When we're creating a fs with metadata blocks packed at the beginning
(packed_meta_blocks=1 in mke2fs.conf), set the group descriptor
checksum or else we create DOA filesystems with checksum errors.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Reviewed-by: Lukas Czerner <lczerner@redhat.com>
10 years agoresize2fs: fix sanity check in reserve_sparse_super2_last_group()
Darrick J. Wong [Mon, 12 May 2014 03:33:08 +0000 (23:33 -0400)]
resize2fs: fix sanity check in reserve_sparse_super2_last_group()

In reserve_sparse_super2_last_group, the old_desc check should only be
performed if ext2fs_super_and_bgd_loc2() gave us a location -- a
return value of 0 means that there is no old-style GDT block.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
10 years agoquota: remove mke2fs's and tune2fs's warning messages regarding quota
Theodore Ts'o [Sun, 11 May 2014 04:23:49 +0000 (00:23 -0400)]
quota: remove mke2fs's and tune2fs's warning messages regarding quota

We no longer need to reference https://ext4.wiki.kernel.org/index.php/Quota
since we've fixed the nasty bugs associated with e2fsck and the quota
feature.  The wiki page will be updated once we've done a release that
includes these fixes indicated the verison which these problems have
been fixed.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Reviewed-by: Aditya Kali <adityakali@google.com>
10 years agotests: add basic e2fsck regression test for fixing the quota inode
Theodore Ts'o [Sun, 11 May 2014 04:01:33 +0000 (00:01 -0400)]
tests: add basic e2fsck regression test for fixing the quota inode

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Reviewed-by: Aditya Kali <adityakali@google.com>
10 years agodebugfs: add commands to query the quota information
Theodore Ts'o [Sun, 11 May 2014 03:28:10 +0000 (23:28 -0400)]
debugfs: add commands to query the quota information

This allows us to verify quota information in an ext4 file systems
with the quota feature.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Reviewed-by: Aditya Kali <adityakali@google.com>
10 years agoquota: support storing the quota file handles in the quota context
Theodore Ts'o [Sun, 11 May 2014 03:19:12 +0000 (23:19 -0400)]
quota: support storing the quota file handles in the quota context

This makes memory management easier because when the quota context is
released, all of the quota file handles get released automatically.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Reviewed-by: Aditya Kali <adityakali@google.com>
10 years agoquota: integrate mkquota.h into quotaio.h
Theodore Ts'o [Sat, 10 May 2014 22:55:20 +0000 (18:55 -0400)]
quota: integrate mkquota.h into quotaio.h

There are interfaces that are used by mke2fs.c and tune2fs.c which are
in quotaio.h, and some future changes will be much simpler if we can
combine the two header files together.  Also the guard #ifdef for
mkquota.h was incorrect, which caused problems when both header files
needed to be included.

Also remove quota.pc and installation rules for libquota, since this
library is never going to be something that we can export externally
anyway.  Eventually we'll want to clean up the interfaces and move the
external publishable interfaces to the libext2fs library, and then
rename what's left from libquota.a to libsupport.a for internal use
only.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Reviewed-by: Aditya Kali <adityakali@google.com>
10 years agoquota: fix memory leak in quota_compare_and_update()
Theodore Ts'o [Sat, 10 May 2014 21:29:18 +0000 (17:29 -0400)]
quota: fix memory leak in quota_compare_and_update()

The quota_handle wasn't getting closed in quota_compare_and_update().
Fix this, and also make sure that quota_file_close() doesn't
unnecessarily modify the quota inode if it's not necessary.  Otherwise
e2fsck will claim that the file system is modified when it didn't need
to be.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Reviewed-by: Aditya Kali <adityakali@google.com>
10 years agoquota: fix e2fsck to notice missing quota entries
Theodore Ts'o [Sat, 10 May 2014 05:27:31 +0000 (01:27 -0400)]
quota: fix e2fsck to notice missing quota entries

Previously if there was a missing quota entry --- i.e., if there were
files owned by group "eng", but there was no quota record for group
"eng", e2fsck would not notice the missing entry.  This means that the
usage informtion would not be properly repaired.  This is unfortunate.
Fix this by marking each quota record in quota_dict that has a
corresponding record on disk, and then check to see if there are any
records in quota_dict that have not been marked as having been seen.
In that case, we know we need to update the relevant quota inode.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Reviewed-by: Aditya Kali <adityakali@google.com>