CEPH filesystem development
 help / color / mirror / Atom feed
* [PATCH 12/21] block: rbd: Replace non inode CURRENT_TIME with current_fs_time()
       [not found] <1465448705-25055-1-git-send-email-deepa.kernel@gmail.com>
@ 2016-06-09  5:04 ` Deepa Dinamani
  2016-06-09  5:05 ` [PATCH 19/21] libceph: Remove CURRENT_TIME references Deepa Dinamani
  2016-06-09  5:05 ` [PATCH 20/21] libceph: Replace CURRENT_TIME with ktime_get_real_ts Deepa Dinamani
  2 siblings, 0 replies; 3+ messages in thread
From: Deepa Dinamani @ 2016-06-09  5:04 UTC (permalink / raw)
  To: linux-fsdevel, linux-kernel
  Cc: Alex Elder, Sage Weil, Arnd Bergmann, y2038, ceph-devel, Al Viro,
	Thomas Gleixner, Linus Torvalds, Ilya Dryomov

CURRENT_TIME macro is not appropriate for filesystems as it
doesn't use the right granularity for filesystem timestamps.
Use current_fs_time() instead.

This is also in preparation for the patch that transitions
vfs timestamps to use 64 bit time and hence make them
y2038 safe. As part of the effort current_fs_time() will be
extended to do range checks. Hence, it is necessary for all
file system timestamps to use current_fs_time().

Signed-off-by: Deepa Dinamani <deepa.kernel@gmail.com>
Cc: Ilya Dryomov <idryomov@gmail.com>
Cc: Sage Weil <sage@redhat.com>
Cc: Alex Elder <elder@kernel.org>
Cc: ceph-devel@vger.kernel.org
---
 drivers/block/rbd.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c
index 81666a5..4dcafe4 100644
--- a/drivers/block/rbd.c
+++ b/drivers/block/rbd.c
@@ -1888,7 +1888,7 @@ static void rbd_osd_req_format_write(struct rbd_obj_request *obj_request)
 {
 	struct ceph_osd_request *osd_req = obj_request->osd_req;
 
-	osd_req->r_mtime = CURRENT_TIME;
+	osd_req->r_mtime = current_fs_time(osd_req->r_inode->i_sb);
 	osd_req->r_data_offset = obj_request->offset;
 }
 
-- 
1.9.1

_______________________________________________
Y2038 mailing list
Y2038@lists.linaro.org
https://lists.linaro.org/mailman/listinfo/y2038

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [PATCH 19/21] libceph: Remove CURRENT_TIME references
       [not found] <1465448705-25055-1-git-send-email-deepa.kernel@gmail.com>
  2016-06-09  5:04 ` [PATCH 12/21] block: rbd: Replace non inode CURRENT_TIME with current_fs_time() Deepa Dinamani
@ 2016-06-09  5:05 ` Deepa Dinamani
  2016-06-09  5:05 ` [PATCH 20/21] libceph: Replace CURRENT_TIME with ktime_get_real_ts Deepa Dinamani
  2 siblings, 0 replies; 3+ messages in thread
From: Deepa Dinamani @ 2016-06-09  5:05 UTC (permalink / raw)
  To: linux-fsdevel, linux-kernel
  Cc: Arnd Bergmann, Thomas Gleixner, Al Viro, Linus Torvalds, y2038,
	Yan, Zheng, Sage Weil, Ilya Dryomov, ceph-devel

CURRENT_TIME is not y2038 safe.
The macro will be deleted and all the references to it
will be replaced by ktime_get_* apis.

struct timespec is also not y2038 safe.
Retain timespec for timestamp representation here as ceph
uses it internally everywhere.
These references will be changed to use struct timespec64
in a separate patch.

Signed-off-by: Deepa Dinamani <deepa.kernel@gmail.com>
Cc: "Yan, Zheng" <zyan@redhat.com>
Cc: Sage Weil <sage@redhat.com>
Cc: Ilya Dryomov <idryomov@gmail.com>
Cc: ceph-devel@vger.kernel.org
---
 net/ceph/messenger.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/net/ceph/messenger.c b/net/ceph/messenger.c
index a550289..1825eed 100644
--- a/net/ceph/messenger.c
+++ b/net/ceph/messenger.c
@@ -1366,8 +1366,9 @@ static void prepare_write_keepalive(struct ceph_connection *con)
 	dout("prepare_write_keepalive %p\n", con);
 	con_out_kvec_reset(con);
 	if (con->peer_features & CEPH_FEATURE_MSGR_KEEPALIVE2) {
-		struct timespec now = CURRENT_TIME;
+		struct timespec now;
 
+		ktime_get_real_ts(&now);
 		con_out_kvec_add(con, sizeof(tag_keepalive2), &tag_keepalive2);
 		ceph_encode_timespec(&con->out_temp_keepalive2, &now);
 		con_out_kvec_add(con, sizeof(con->out_temp_keepalive2),
@@ -3149,8 +3150,9 @@ bool ceph_con_keepalive_expired(struct ceph_connection *con,
 {
 	if (interval > 0 &&
 	    (con->peer_features & CEPH_FEATURE_MSGR_KEEPALIVE2)) {
-		struct timespec now = CURRENT_TIME;
+		struct timespec now;
 		struct timespec ts;
+		ktime_get_real_ts(&now);
 		jiffies_to_timespec(interval, &ts);
 		ts = timespec_add(con->last_keepalive_ack, ts);
 		return timespec_compare(&now, &ts) >= 0;
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [PATCH 20/21] libceph: Replace CURRENT_TIME with ktime_get_real_ts
       [not found] <1465448705-25055-1-git-send-email-deepa.kernel@gmail.com>
  2016-06-09  5:04 ` [PATCH 12/21] block: rbd: Replace non inode CURRENT_TIME with current_fs_time() Deepa Dinamani
  2016-06-09  5:05 ` [PATCH 19/21] libceph: Remove CURRENT_TIME references Deepa Dinamani
@ 2016-06-09  5:05 ` Deepa Dinamani
  2 siblings, 0 replies; 3+ messages in thread
From: Deepa Dinamani @ 2016-06-09  5:05 UTC (permalink / raw)
  To: linux-fsdevel, linux-kernel
  Cc: Sage Weil, Arnd Bergmann, y2038, ceph-devel, Yan, Zheng, Al Viro,
	Thomas Gleixner, Linus Torvalds, Ilya Dryomov

CURRENT_TIME is not y2038 safe.
The macro will be deleted and all the references to it
will be replaced by ktime_get_* apis.

struct timespec is also not y2038 safe.
Retain timespec for timestamp representation here as ceph
uses it internally everywhere.
These references will be changed to use struct timespec64
in a separate patch.

Signed-off-by: Deepa Dinamani <deepa.kernel@gmail.com>
Cc: "Yan, Zheng" <zyan@redhat.com>
Cc: Sage Weil <sage@redhat.com>
Cc: Ilya Dryomov <idryomov@gmail.com>
Cc: ceph-devel@vger.kernel.org
---
 net/ceph/osd_client.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/net/ceph/osd_client.c b/net/ceph/osd_client.c
index 8946959..44eb2d0 100644
--- a/net/ceph/osd_client.c
+++ b/net/ceph/osd_client.c
@@ -3567,7 +3567,7 @@ ceph_osdc_watch(struct ceph_osd_client *osdc,
 	ceph_oid_copy(&lreq->t.base_oid, oid);
 	ceph_oloc_copy(&lreq->t.base_oloc, oloc);
 	lreq->t.flags = CEPH_OSD_FLAG_WRITE | CEPH_OSD_FLAG_ONDISK;
-	lreq->mtime = CURRENT_TIME;
+	ktime_get_real_ts(&lreq->mtime);
 
 	lreq->reg_req = alloc_linger_request(lreq);
 	if (!lreq->reg_req) {
@@ -3625,7 +3625,7 @@ int ceph_osdc_unwatch(struct ceph_osd_client *osdc,
 	ceph_oid_copy(&req->r_base_oid, &lreq->t.base_oid);
 	ceph_oloc_copy(&req->r_base_oloc, &lreq->t.base_oloc);
 	req->r_flags = CEPH_OSD_FLAG_WRITE | CEPH_OSD_FLAG_ONDISK;
-	req->r_mtime = CURRENT_TIME;
+	ktime_get_real_ts(&req->r_mtime);
 	osd_req_op_watch_init(req, 0, lreq->linger_id,
 			      CEPH_OSD_WATCH_OP_UNWATCH);
 
-- 
1.9.1

_______________________________________________
Y2038 mailing list
Y2038@lists.linaro.org
https://lists.linaro.org/mailman/listinfo/y2038

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-06-09  5:05 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <1465448705-25055-1-git-send-email-deepa.kernel@gmail.com>
2016-06-09  5:04 ` [PATCH 12/21] block: rbd: Replace non inode CURRENT_TIME with current_fs_time() Deepa Dinamani
2016-06-09  5:05 ` [PATCH 19/21] libceph: Remove CURRENT_TIME references Deepa Dinamani
2016-06-09  5:05 ` [PATCH 20/21] libceph: Replace CURRENT_TIME with ktime_get_real_ts Deepa Dinamani

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox