mirror of
https://git.kernel.org/pub/scm/fs/ext2/e2fsprogs.git
synced 2024-11-24 02:25:03 +08:00
1e3f5c889d
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> |
||
---|---|---|
.. | ||
e2p.h | ||
e2p.pc.in | ||
feature.c | ||
fgetflags.c | ||
fgetversion.c | ||
fsetflags.c | ||
fsetversion.c | ||
getflags.c | ||
getversion.c | ||
hashstr.c | ||
iod.c | ||
ls.c | ||
Makefile.in | ||
mntopts.c | ||
ostype.c | ||
parse_num.c | ||
pe.c | ||
percent.c | ||
pf.c | ||
ps.c | ||
setflags.c | ||
setversion.c | ||
uuid.c |