Go to file
Andreas Dilger 1e3f5c889d lsattr: treat inode generation as an unsigned int
The EXT2_GETVERSION ioctl is defined to take a "long" parameter, but
fgetversion() calls ioctl() with an "int" parameter instead.  This is
handled in the kernel correctly, but the generation is sign-extended
in fgetversion() before return on 64-bit systems and lsattr prints
it as a huge positive number for inode generation above 0x80000000:

        1635574212 -------------e-- /mnt/ost0/O/0/d0/12928
        18446744073045131735 -------------e-- /mnt/ost0/O/0/d0/166240
        782808861 -------------e-- /mnt/ost0/O/0/d0/31744
        18446744072181134840 -------------e-- /mnt/ost0/O/0/d0/135008

Correctly assign the returned generation number as an unsigned value,
and print it with a 10-character field width.  The version is printed
left-aligned for consistency with the old code and to ensure it is
always printed in the first column for use with tools like "cut":

        1635574212 -------------e-- /mnt/ost0/O/0/d0/12928
        3630547415 -------------e-- /mnt/ost0/O/0/d0/166240
        782808861  -------------e-- /mnt/ost0/O/0/d0/31744
        2766550520 -------------e-- /mnt/ost0/O/0/d0/135008

Do not return a random value from the stack as the version on error.
Clean up some style issues and consolidate some duplicate code.

Signed-off-by: Andreas Dilger <adilger@dilger.ca>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2016-03-06 18:12:57 -05:00
config Update to latest version of config.* files 2014-07-04 23:49:39 -04:00
contrib tests: avoid using mktemp -t 2014-07-04 16:39:49 -04:00
debian debian: remove trailing spaces from control.in file 2015-05-18 02:14:55 -04:00
debugfs debugfs: improve dump_mmp handling 2016-03-06 18:11:48 -05:00
doc Update release notes, etc. for final 1.42.13 release 2015-05-17 21:33:25 -04:00
e2fsck e2fsck: fix e2fsck -fD directory truncation 2015-11-30 15:26:35 -05:00
ext2ed Add coverage testing using gcov 2014-02-23 00:17:09 -05:00
include/nonunix Remove trailing whitespace for the entire source tree 2008-08-27 23:07:54 -04:00
install-utils Remove Changelog files since they're not used after the git migration 2007-07-08 08:50:41 -04:00
intl Add coverage testing using gcov 2014-02-23 00:17:09 -05:00
lib lsattr: treat inode generation as an unsigned int 2016-03-06 18:12:57 -05:00
misc lsattr: treat inode generation as an unsigned int 2016-03-06 18:12:57 -05:00
po Update release notes, etc. for final 1.42.13 release 2015-05-17 21:33:25 -04:00
resize Fix clang warning and a resource leak 2015-01-19 16:31:49 -05:00
tests Fix build system to be compatible with BSD pmake 2016-01-02 01:29:55 -05:00
util misc: add missing declarations on maint 2016-03-06 18:12:06 -05:00
.gitignore Use a wildcard for static libs in the git ignore list 2014-07-12 11:57:27 -04:00
.hgignore Ignore quilt work files 2005-07-19 08:41:27 -05:00
.missing-copyright Many files: 1997-04-29 16:15:03 +00:00
.release-checklist Update release checklist to include reminder to update translation 2008-07-10 17:25:22 -04:00
ABOUT-NLS Update to gettext 0.11.5. We now enable NLS support by default. 2003-05-03 16:35:17 -04:00
acinclude.m4 Fix up configure so it finds mkinstalldirs 2014-07-10 00:20:49 -04:00
aclocal.m4 aclocal.m4: update to newer versions of autoconf macros 2014-07-04 23:49:23 -04:00
configure util: allow subst to build on systems that do not have utimes() 2014-10-19 22:13:09 -04:00
configure.in util: allow subst to build on systems that do not have utimes() 2014-10-19 22:13:09 -04:00
COPYING Clarify the copyright licenses used by the various libraries in COPYING 2007-06-23 01:04:53 -04:00
depfix.sed Update Release Notes, Changelogs, version.h, etc. for 1.42 release 2011-11-29 16:48:14 -05:00
e2fsprogs.lsm Update release notes, etc. for final 1.42.13 release 2015-05-17 21:33:25 -04:00
e2fsprogs.spec.in misc: clean up compiler warnings 2011-06-11 10:58:25 -04:00
INSTALL Add a comment in INSTALL regarding --disable-tls on older systems 2008-07-10 09:08:44 -04:00
INSTALL.elfbin ChangeLog, INSTALL.elfbin: 1999-01-02 04:15:29 +00:00
Makefile.in Fix build system to be compatible with BSD pmake 2016-01-02 01:29:55 -05:00
MCONFIG.in Fix build system to be compatible with BSD pmake 2016-01-02 01:29:55 -05:00
README Update release notes, etc. for final 1.42.13 release 2015-05-17 21:33:25 -04:00
README.subset Update release notes, version files for 1.40.4 release 2008-01-01 00:35:17 -05:00
RELEASE-NOTES Update release notes, etc. for final 1.42.13 release 2015-05-17 21:33:25 -04:00
SHLIBS Many files: 1997-04-29 16:15:03 +00:00
SUBMITTING-PATCHES Added SUBMITTING-PATCHES file 2005-07-05 22:30:13 -05:00
TODO Update TODO to remove item which is already completed. 2006-05-13 09:28:04 -04:00
version.h Update release notes, etc. for final 1.42.13 release 2015-05-17 21:33:25 -04:00
wordwrap.pl Fix wordwrap.pl so it is more portable 2012-09-21 12:50:04 -04:00

	This is the new version (1.42.13) of the second extended file
system management programs.

	From time to time, I release new versions of e2fsprogs, to fix
bugs and to make the utilities more robust.  You can always find
information about the latest version at the the e2fsprogs web page,
which is:

	http://e2fsprogs.sourceforge.net

	The INSTALL file has instructions on building and installing
e2fsprogs.  Provisions for building Red Hat RPMs and Debian dpkg files
are supplied as well.

	In case of bugs in these programs, please contact Ted Ts'o at
tytso@mit.edu or tytso@alum.mit.edu.  See the e2fsck man page for
suggestions of what sort of information to include when submitting bug
reports for these programs.