Re: [PATCH 4/6] lsattr: treat inode generation as an unsigned int

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sat, Mar 05, 2016 at 05:38:34PM -0700, Andreas Dilger wrote:
> 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@xxxxxxxxx>

Thanks, applied.

						- Ted
--
To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Reiser Filesystem Development]     [Ceph FS]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux FS]     [Yosemite National Park]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Device Mapper]     [Linux Media]

  Powered by Linux