From 14e3f92a4c46eedfe745b0dec42a4dcb1b16a989 Mon Sep 17 00:00:00 2001 From: Arnd Bergmann Date: Sun, 27 Sep 2015 16:45:27 -0400 Subject: [PATCH] staging/lustre: 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. Signed-off-by: Arnd Bergmann Signed-off-by: Oleg Drokin Signed-off-by: Greg Kroah-Hartman --- drivers/staging/lustre/lustre/llite/llite_lib.c | 2 +- drivers/staging/lustre/lustre/mdc/mdc_request.c | 2 +- drivers/staging/lustre/lustre/obdclass/llog.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/staging/lustre/lustre/llite/llite_lib.c b/drivers/staging/lustre/lustre/llite/llite_lib.c index 524fcc9fc188..a0ae892872f5 100644 --- a/drivers/staging/lustre/lustre/llite/llite_lib.c +++ b/drivers/staging/lustre/lustre/llite/llite_lib.c @@ -2218,7 +2218,7 @@ struct md_op_data *ll_prep_md_op_data(struct md_op_data *op_data, op_data->op_name = name; op_data->op_namelen = namelen; op_data->op_mode = mode; - op_data->op_mod_time = get_seconds(); + op_data->op_mod_time = ktime_get_real_seconds(); op_data->op_fsuid = from_kuid(&init_user_ns, current_fsuid()); op_data->op_fsgid = from_kgid(&init_user_ns, current_fsgid()); op_data->op_cap = cfs_curproc_cap_pack(); diff --git a/drivers/staging/lustre/lustre/mdc/mdc_request.c b/drivers/staging/lustre/lustre/mdc/mdc_request.c index d32ae761c05f..fd6fc10349c3 100644 --- a/drivers/staging/lustre/lustre/mdc/mdc_request.c +++ b/drivers/staging/lustre/lustre/mdc/mdc_request.c @@ -402,7 +402,7 @@ static int mdc_xattr_common(struct obd_export *exp, rec->sx_suppgid2 = -1; rec->sx_fid = *fid; rec->sx_valid = valid | OBD_MD_FLCTIME; - rec->sx_time = get_seconds(); + rec->sx_time = ktime_get_real_seconds(); rec->sx_size = output_size; rec->sx_flags = flags; diff --git a/drivers/staging/lustre/lustre/obdclass/llog.c b/drivers/staging/lustre/lustre/obdclass/llog.c index 78d92269aab6..8cad47080456 100644 --- a/drivers/staging/lustre/lustre/obdclass/llog.c +++ b/drivers/staging/lustre/lustre/obdclass/llog.c @@ -188,7 +188,7 @@ static int llog_read_header(const struct lu_env *env, llh->llh_hdr.lrh_type = LLOG_HDR_MAGIC; llh->llh_hdr.lrh_len = llh->llh_tail.lrt_len = LLOG_CHUNK_SIZE; llh->llh_hdr.lrh_index = llh->llh_tail.lrt_index = 0; - llh->llh_timestamp = get_seconds(); + llh->llh_timestamp = ktime_get_real_seconds(); if (uuid) memcpy(&llh->llh_tgtuuid, uuid, sizeof(llh->llh_tgtuuid)); -- 2.30.2