From: Arnd Bergmann Date: Sun, 12 Feb 2017 17:18:25 +0000 (-0500) Subject: LU-4423 mdc: use 64-bit timestamps for mdc X-Git-Tag: 2.9.54~46 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=540fcd21849788d02ddef89ecdf1492e6eff23e2;p=fs%2Flustre-release.git LU-4423 mdc: use 64-bit timestamps for mdc These three are timestamps that are sent over the wire in mdc_lib and the obd logging 64-bit values, but are generated using the 32-bit get_seconds() function, which will eventually overflow. Changing them to use 64-bit ktime_get_real_seconds() solves the problem. Linux-commit: 14e3f92a4c46eedfe745b0dec42a4dcb1b16a989 Change-Id: I2063ae51a8335cd6887f800f0f30e8d90cfe7d2b Signed-off-by: Arnd Bergmann Signed-off-by: Oleg Drokin Signed-off-by: Greg Kroah-Hartman Signed-off-by: James Simmons Reviewed-on: https://review.whamcloud.com/25405 Tested-by: Jenkins Tested-by: Maloo Reviewed-by: Mike Pershin Reviewed-by: Fan Yong Reviewed-by: Andreas Dilger Reviewed-by: John L. Hammond --- diff --git a/lustre/llite/llite_lib.c b/lustre/llite/llite_lib.c index 3578e50..94b9a29 100644 --- a/lustre/llite/llite_lib.c +++ b/lustre/llite/llite_lib.c @@ -2246,7 +2246,7 @@ void ll_open_cleanup(struct super_block *sb, struct ptlrpc_request *open_req) op_data->op_fid1 = body->mbo_fid1; op_data->op_handle = body->mbo_handle; - op_data->op_mod_time = cfs_time_current_sec(); + op_data->op_mod_time = ktime_get_real_seconds(); md_close(exp, op_data, NULL, &close_req); ptlrpc_req_finished(close_req); ll_finish_md_op_data(op_data); diff --git a/lustre/mdc/mdc_request.c b/lustre/mdc/mdc_request.c index e129d3b..d931848 100644 --- a/lustre/mdc/mdc_request.c +++ b/lustre/mdc/mdc_request.c @@ -344,7 +344,7 @@ static int mdc_xattr_common(struct obd_export *exp,const struct req_format *fmt, rec->sx_suppgid2 = -1; rec->sx_fid = *fid; rec->sx_valid = valid | OBD_MD_FLCTIME; - rec->sx_time = cfs_time_current_sec(); + rec->sx_time = ktime_get_real_seconds(); rec->sx_size = output_size; rec->sx_flags = flags; } else { diff --git a/lustre/obdclass/llog.c b/lustre/obdclass/llog.c index 7251144..79a4dea 100644 --- a/lustre/obdclass/llog.c +++ b/lustre/obdclass/llog.c @@ -322,7 +322,7 @@ int llog_read_header(const struct lu_env *env, struct llog_handle *handle, LLOG_MIN_CHUNK_SIZE); llh->llh_hdr.lrh_len = handle->lgh_ctxt->loc_chunk_size; llh->llh_hdr.lrh_index = 0; - llh->llh_timestamp = cfs_time_current_sec(); + llh->llh_timestamp = ktime_get_real_seconds(); if (uuid) memcpy(&llh->llh_tgtuuid, uuid, sizeof(llh->llh_tgtuuid));