Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

quota: avoid time_t in v1_disk_dqblk definition

The time_t type is part of the user interface and not always the
same, with the move to 64-bit timestamps and the difference between
architectures.

Make the quota format definition independent of this type and use
a basic type of the same length. Make it unsigned in the process
to keep the v1 format working until year 2106 instead of 2038
on 32-bit architectures.

Hopefully, everybody has already moved to a newer format long
ago (v2 was introduced with linux-2.4), but it's hard to be sure.

Link: https://lore.kernel.org/r/20191213205221.3787308-6-arnd@arndb.de
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Jan Kara <jack@suse.cz>

authored by

Arnd Bergmann and committed by
Jan Kara
1ead083a 4d5c1ada

+4 -2
+4 -2
fs/quota/quotaio_v1.h
··· 25 25 __u32 dqb_ihardlimit; /* absolute limit on allocated inodes */ 26 26 __u32 dqb_isoftlimit; /* preferred inode limit */ 27 27 __u32 dqb_curinodes; /* current # allocated inodes */ 28 - time_t dqb_btime; /* time limit for excessive disk use */ 29 - time_t dqb_itime; /* time limit for excessive inode use */ 28 + 29 + /* below fields differ in length on 32-bit vs 64-bit architectures */ 30 + unsigned long dqb_btime; /* time limit for excessive disk use */ 31 + unsigned long dqb_itime; /* time limit for excessive inode use */ 30 32 }; 31 33 32 34 #define v1_dqoff(UID) ((loff_t)((UID) * sizeof (struct v1_disk_dqblk)))