diff options
author | Theodore Ts'o <tytso@mit.edu> | 2024-05-01 16:58:50 -0400 |
---|---|---|
committer | Theodore Ts'o <tytso@mit.edu> | 2024-05-01 16:58:50 -0400 |
commit | 1b9e68e0ff22933d1bab5defa761268e904daf28 (patch) | |
tree | aea61f7f564a3dd0e93e71e5c2f04b0f3a4b6251 | |
parent | 80abfebc673bb2a1496dec88f7f0601e7325d3c2 (diff) | |
download | e2fsprogs-1b9e68e0ff22933d1bab5defa761268e904daf28.tar.gz |
libsupport: use explicit type widths instead of time_t
The in-memory data structures used time_t for the grace period (which
is a delta timestamp denominated in seconds), as well as the soft
limit expiration time (which is an actual time_t). Use an explicit
__u32 for the former, and the __u64 for the latter.
This silences a Coverity warning, but more importantly, using an
explicit __u64 for the expiration time means that running e2fsck on a
platform with a 32-bit time_t, and it needs to read and then modify a
quota structure, we won't lose the high 32-bits of the quota
expiration time.
Addresses-Coverity-Bug: 1531824
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
-rw-r--r-- | lib/support/quotaio.h | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/support/quotaio.h b/lib/support/quotaio.h index 390f7dc92..6152416fb 100644 --- a/lib/support/quotaio.h +++ b/lib/support/quotaio.h @@ -101,8 +101,8 @@ struct quotafile_ops; /* Generic information about quotafile */ struct util_dqinfo { - time_t dqi_bgrace; /* Block grace time for given quotafile */ - time_t dqi_igrace; /* Inode grace time for given quotafile */ + __u32 dqi_bgrace; /* Block grace time for given quotafile */ + __u32 dqi_igrace; /* Inode grace time for given quotafile */ union { struct v2_mem_dqinfo v2_mdqi; } u; /* Format specific info about quotafile */ @@ -137,8 +137,8 @@ struct util_dqblk { qsize_t dqb_bhardlimit; qsize_t dqb_bsoftlimit; qsize_t dqb_curspace; - time_t dqb_btime; - time_t dqb_itime; + __u64 dqb_btime; + __u64 dqb_itime; union { struct v2_mem_dqblk v2_mdqb; } u; /* Format specific dquot information */ |