Skip to content
Permalink
Browse files

ceph: use current_kernel_time() to get request time stamp

ceph uses ktime_get_real_ts() to get request time stamp. In most
other cases, current_kernel_time() is used to get time stamp for
filesystem operation (called by current_time()). It seems there
is time drift between ktime_get_real_ts() and current_kernel_time()

Signed-off-by: "Yan, Zheng" <zyan@redhat.com>
  • Loading branch information
ukernel committed Jun 2, 2017
1 parent a58dd86 commit 2e0f648da23167034a3cf1500bc90ec60aef2417
Showing with 1 addition and 3 deletions.
  1. +1 −3 fs/ceph/mds_client.c
@@ -1687,7 +1687,6 @@ struct ceph_mds_request *
ceph_mdsc_create_request(struct ceph_mds_client *mdsc, int op, int mode)
{
struct ceph_mds_request *req = kzalloc(sizeof(*req), GFP_NOFS);
struct timespec ts;

if (!req)
return ERR_PTR(-ENOMEM);
@@ -1706,8 +1705,7 @@ ceph_mdsc_create_request(struct ceph_mds_client *mdsc, int op, int mode)
init_completion(&req->r_safe_completion);
INIT_LIST_HEAD(&req->r_unsafe_item);

ktime_get_real_ts(&ts);
req->r_stamp = timespec_trunc(ts, mdsc->fsc->sb->s_time_gran);
req->r_stamp = timespec_trunc(current_kernel_time(), mdsc->fsc->sb->s_time_gran);

req->r_op = op;
req->r_direct_mode = mode;

0 comments on commit 2e0f648

Please sign in to comment.
You can’t perform that action at this time.