staging/lustre: use 64-bit timestamps for mdc
authorArnd Bergmann <arnd@arndb.de>
Sun, 27 Sep 2015 20:45:27 +0000 (16:45 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 29 Sep 2015 02:06:16 +0000 (04:06 +0200)
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 <arnd@arndb.de>
Signed-off-by: Oleg Drokin <green@linuxhacker.ru>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/lustre/lustre/llite/llite_lib.c
drivers/staging/lustre/lustre/mdc/mdc_request.c
drivers/staging/lustre/lustre/obdclass/llog.c

index 524fcc9fc18881d8b318e7b9938408d9cc821175..a0ae892872f52b81c01a7c2e377286c3a3c88457 100644 (file)
@@ -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();
index d32ae761c05fc532ce3efc2e08a0db374424355a..fd6fc10349c3097c0267a97296d8c267b60fa3da 100644 (file)
@@ -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;
 
index 78d92269aab6dffc64da48010eec5992199eaa74..8cad470804567171b86a32c51cf157e0c3055968 100644 (file)
@@ -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));