summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Spisla <david.spisla@iternity.com>2019-02-19 14:56:11 +0100
committerDavid Spisla <david.spisla@iternity.com>2019-02-20 14:00:05 +0000
commitf6c8b1771f71bec287437dbec2e3b2e4f5692ef6 (patch)
tree3d79dd6d5fb568072f02243e2746983efc3c5275
parentb2f561c069d38f5075907b9f5a255f585a602c79 (diff)
md-cache: Adapt integer data types to avoid integer overflow
The "struct iatt" in iatt.h is using int64_t types for storing the atime, mtime and ctime. Therefore the struct 'struct md_cache' in md-cache.c should also use this types to avoid an integer overflow. This can happen e.g. if someone uses a very high default-retention-period in the WORM-Xlator. Change-Id: I605268d300ab622b9c8ab30e459dc00d9340aad1 fixes: bz#1678726 Signed-off-by: David Spisla <david.spisla@iternity.com> (cherry picked from commit 15423e14f16dd1a15ee5e5cbbdbdd370e57ed59f)
-rw-r--r--xlators/performance/md-cache/src/md-cache.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/xlators/performance/md-cache/src/md-cache.c b/xlators/performance/md-cache/src/md-cache.c
index 02fc79e2267..038856f3578 100644
--- a/xlators/performance/md-cache/src/md-cache.c
+++ b/xlators/performance/md-cache/src/md-cache.c
@@ -100,12 +100,12 @@ struct md_cache {
uint32_t md_nlink;
uint32_t md_uid;
uint32_t md_gid;
- uint32_t md_atime;
uint32_t md_atime_nsec;
- uint32_t md_mtime;
uint32_t md_mtime_nsec;
- uint32_t md_ctime;
uint32_t md_ctime_nsec;
+ int64_t md_atime;
+ int64_t md_mtime;
+ int64_t md_ctime;
uint64_t md_rdev;
uint64_t md_size;
uint64_t md_blocks;