Whamcloud - gitweb
LU-4423 mdc: use 64-bit timestamps for mdc 05/25405/2
authorArnd Bergmann <arnd@arndb.de>
Sun, 12 Feb 2017 17:18:25 +0000 (12:18 -0500)
committerOleg Drokin <oleg.drokin@intel.com>
Sat, 18 Feb 2017 23:51:19 +0000 (23:51 +0000)
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 <arnd@arndb.de>
Signed-off-by: Oleg Drokin <green@linuxhacker.ru>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: James Simmons <uja.ornl@yahoo.com>
Reviewed-on: https://review.whamcloud.com/25405
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Mike Pershin <mike.pershin@intel.com>
Reviewed-by: Fan Yong <fan.yong@intel.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Reviewed-by: John L. Hammond <john.hammond@intel.com>
lustre/llite/llite_lib.c
lustre/mdc/mdc_request.c
lustre/obdclass/llog.c

index 3578e50..94b9a29 100644 (file)
@@ -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);
index e129d3b..d931848 100644 (file)
@@ -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 {
index 7251144..79a4dea 100644 (file)
@@ -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));