Commit 14e3f92a authored by Arnd Bergmann's avatar Arnd Bergmann Committed by Greg Kroah-Hartman
Browse files

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: default avatarArnd Bergmann <arnd@arndb.de>
Signed-off-by: default avatarOleg Drokin <green@linuxhacker.ru>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 8d7eed54
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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();
+1 −1
Original line number Diff line number Diff line
@@ -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;

+1 −1
Original line number Diff line number Diff line
@@ -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));