summaryrefslogtreecommitdiffstats
path: root/xlators/performance/quick-read/src/quick-read.c
diff options
context:
space:
mode:
Diffstat (limited to 'xlators/performance/quick-read/src/quick-read.c')
-rw-r--r--xlators/performance/quick-read/src/quick-read.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/xlators/performance/quick-read/src/quick-read.c b/xlators/performance/quick-read/src/quick-read.c
index a64e63de4..1d682b62d 100644
--- a/xlators/performance/quick-read/src/quick-read.c
+++ b/xlators/performance/quick-read/src/quick-read.c
@@ -3164,12 +3164,14 @@ qr_inodectx_dump (xlator_t *this, inode_t *inode)
gf_proc_dump_write ("entire-file-cached", "%s", qr_inode->xattr ? "yes" : "no");
- tm = localtime (&qr_inode->tv.tv_sec);
- strftime (buf, 256, "%Y-%m-%d %H:%M:%S", tm);
- snprintf (buf + strlen (buf), 256 - strlen (buf),
- ".%"GF_PRI_SUSECONDS, qr_inode->tv.tv_usec);
+ if (qr_inode->tv.tv_sec) {
+ tm = localtime (&qr_inode->tv.tv_sec);
+ strftime (buf, 256, "%Y-%m-%d %H:%M:%S", tm);
+ snprintf (buf + strlen (buf), 256 - strlen (buf),
+ ".%"GF_PRI_SUSECONDS, qr_inode->tv.tv_usec);
- gf_proc_dump_write ("last-cache-validation-time", "%s", buf);
+ gf_proc_dump_write ("last-cache-validation-time", "%s", buf);
+ }
ret = 0;
out: