All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ceph: use ktime_get_real_seconds()
@ 2018-06-20 10:00 Allen Pais
  2018-06-20 12:33 ` Ilya Dryomov
  2018-06-20 15:47 ` [Y2038] " Arnd Bergmann
  0 siblings, 2 replies; 6+ messages in thread
From: Allen Pais @ 2018-06-20 10:00 UTC (permalink / raw)
  To: netdev; +Cc: davem, linux-kernel, ceph-devel, y2038, Allen Pais

Use ktime_get_real_seconds() as get_seconds() is deprecated.

Signed-off-by: Allen Pais <allen.lkml@gmail.com>
---
 net/ceph/auth_x.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/net/ceph/auth_x.c b/net/ceph/auth_x.c
index 2f4a1ba..99561c2 100644
--- a/net/ceph/auth_x.c
+++ b/net/ceph/auth_x.c
@@ -154,7 +154,7 @@ static int process_one_ticket(struct ceph_auth_client *ac,
 	void **ptp;
 	struct ceph_crypto_key new_session_key = { 0 };
 	struct ceph_buffer *new_ticket_blob;
-	unsigned long new_expires, new_renew_after;
+	u32 new_expires, new_renew_after;
 	u64 new_secret_id;
 	int ret;
 
@@ -191,9 +191,9 @@ static int process_one_ticket(struct ceph_auth_client *ac,
 
 	ceph_decode_timespec(&validity, dp);
 	dp += sizeof(struct ceph_timespec);
-	new_expires = get_seconds() + validity.tv_sec;
+	new_expires = (u32)ktime_get_real_seconds() + validity.tv_sec;
 	new_renew_after = new_expires - (validity.tv_sec / 4);
-	dout(" expires=%lu renew_after=%lu\n", new_expires,
+	dout(" expires=%u renew_after=%u\n", new_expires,
 	     new_renew_after);
 
 	/* ticket blob for service */
@@ -385,13 +385,13 @@ static bool need_key(struct ceph_x_ticket_handler *th)
 	if (!th->have_key)
 		return true;
 
-	return get_seconds() >= th->renew_after;
+	return ktime_get_real_seconds() >= th->renew_after;
 }
 
 static bool have_key(struct ceph_x_ticket_handler *th)
 {
 	if (th->have_key) {
-		if (get_seconds() >= th->expires)
+		if (ktime_get_real_seconds() >= th->expires)
 			th->have_key = false;
 	}
 
-- 
2.7.4


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

* Re: [PATCH] ceph: use ktime_get_real_seconds()
  2018-06-20 10:00 [PATCH] ceph: use ktime_get_real_seconds() Allen Pais
@ 2018-06-20 12:33 ` Ilya Dryomov
  2018-06-20 14:42     ` Allen
  2018-06-20 15:47 ` [Y2038] " Arnd Bergmann
  1 sibling, 1 reply; 6+ messages in thread
From: Ilya Dryomov @ 2018-06-20 12:33 UTC (permalink / raw)
  To: allen.lkml; +Cc: netdev, David S. Miller, linux-kernel, Ceph Development, y2038

On Wed, Jun 20, 2018 at 12:00 PM Allen Pais <allen.lkml@gmail.com> wrote:
>
> Use ktime_get_real_seconds() as get_seconds() is deprecated.
>
> Signed-off-by: Allen Pais <allen.lkml@gmail.com>
> ---
>  net/ceph/auth_x.c | 10 +++++-----
>  1 file changed, 5 insertions(+), 5 deletions(-)
>
> diff --git a/net/ceph/auth_x.c b/net/ceph/auth_x.c
> index 2f4a1ba..99561c2 100644
> --- a/net/ceph/auth_x.c
> +++ b/net/ceph/auth_x.c
> @@ -154,7 +154,7 @@ static int process_one_ticket(struct ceph_auth_client *ac,
>         void **ptp;
>         struct ceph_crypto_key new_session_key = { 0 };
>         struct ceph_buffer *new_ticket_blob;
> -       unsigned long new_expires, new_renew_after;
> +       u32 new_expires, new_renew_after;
>         u64 new_secret_id;
>         int ret;
>
> @@ -191,9 +191,9 @@ static int process_one_ticket(struct ceph_auth_client *ac,
>
>         ceph_decode_timespec(&validity, dp);
>         dp += sizeof(struct ceph_timespec);
> -       new_expires = get_seconds() + validity.tv_sec;
> +       new_expires = (u32)ktime_get_real_seconds() + validity.tv_sec;

Why the change to u32 and this cast?  If the type has to change,
wouldn't time64_t make more sense?  ktime_get_real_seconds() returns
time64_t, after all.

Thanks,

                Ilya

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

* Re: [PATCH] ceph: use ktime_get_real_seconds()
  2018-06-20 12:33 ` Ilya Dryomov
@ 2018-06-20 14:42     ` Allen
  0 siblings, 0 replies; 6+ messages in thread
From: Allen @ 2018-06-20 14:42 UTC (permalink / raw)
  To: idryomov; +Cc: netdev, David Miller, linux-kernel, ceph-devel, y2038

> >
> > Use ktime_get_real_seconds() as get_seconds() is deprecated.
> >
> > Signed-off-by: Allen Pais <allen.lkml@gmail.com>
> > ---
> >  net/ceph/auth_x.c | 10 +++++-----
> >  1 file changed, 5 insertions(+), 5 deletions(-)
> >
> > diff --git a/net/ceph/auth_x.c b/net/ceph/auth_x.c
> > index 2f4a1ba..99561c2 100644
> > --- a/net/ceph/auth_x.c
> > +++ b/net/ceph/auth_x.c
> > @@ -154,7 +154,7 @@ static int process_one_ticket(struct ceph_auth_client *ac,
> >         void **ptp;
> >         struct ceph_crypto_key new_session_key = { 0 };
> >         struct ceph_buffer *new_ticket_blob;
> > -       unsigned long new_expires, new_renew_after;
> > +       u32 new_expires, new_renew_after;
> >         u64 new_secret_id;
> >         int ret;
> >
> > @@ -191,9 +191,9 @@ static int process_one_ticket(struct ceph_auth_client *ac,
> >
> >         ceph_decode_timespec(&validity, dp);
> >         dp += sizeof(struct ceph_timespec);
> > -       new_expires = get_seconds() + validity.tv_sec;
> > +       new_expires = (u32)ktime_get_real_seconds() + validity.tv_sec;
>
> Why the change to u32 and this cast?  If the type has to change,
> wouldn't time64_t make more sense?  ktime_get_real_seconds() returns
> time64_t, after all.
>

 Right. I'll drop the cast and send out V2.

- Allen

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

* Re: [PATCH] ceph: use ktime_get_real_seconds()
@ 2018-06-20 14:42     ` Allen
  0 siblings, 0 replies; 6+ messages in thread
From: Allen @ 2018-06-20 14:42 UTC (permalink / raw)
  To: idryomov; +Cc: y2038, netdev, ceph-devel, David Miller, linux-kernel

> >
> > Use ktime_get_real_seconds() as get_seconds() is deprecated.
> >
> > Signed-off-by: Allen Pais <allen.lkml@gmail.com>
> > ---
> >  net/ceph/auth_x.c | 10 +++++-----
> >  1 file changed, 5 insertions(+), 5 deletions(-)
> >
> > diff --git a/net/ceph/auth_x.c b/net/ceph/auth_x.c
> > index 2f4a1ba..99561c2 100644
> > --- a/net/ceph/auth_x.c
> > +++ b/net/ceph/auth_x.c
> > @@ -154,7 +154,7 @@ static int process_one_ticket(struct ceph_auth_client *ac,
> >         void **ptp;
> >         struct ceph_crypto_key new_session_key = { 0 };
> >         struct ceph_buffer *new_ticket_blob;
> > -       unsigned long new_expires, new_renew_after;
> > +       u32 new_expires, new_renew_after;
> >         u64 new_secret_id;
> >         int ret;
> >
> > @@ -191,9 +191,9 @@ static int process_one_ticket(struct ceph_auth_client *ac,
> >
> >         ceph_decode_timespec(&validity, dp);
> >         dp += sizeof(struct ceph_timespec);
> > -       new_expires = get_seconds() + validity.tv_sec;
> > +       new_expires = (u32)ktime_get_real_seconds() + validity.tv_sec;
>
> Why the change to u32 and this cast?  If the type has to change,
> wouldn't time64_t make more sense?  ktime_get_real_seconds() returns
> time64_t, after all.
>

 Right. I'll drop the cast and send out V2.

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

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

* Re: [Y2038] [PATCH] ceph: use ktime_get_real_seconds()
  2018-06-20 10:00 [PATCH] ceph: use ktime_get_real_seconds() Allen Pais
  2018-06-20 12:33 ` Ilya Dryomov
@ 2018-06-20 15:47 ` Arnd Bergmann
  2018-06-21  5:41   ` Allen
  1 sibling, 1 reply; 6+ messages in thread
From: Arnd Bergmann @ 2018-06-20 15:47 UTC (permalink / raw)
  To: Allen Pais
  Cc: Networking, y2038 Mailman List, ceph-devel, David Miller,
	Linux Kernel Mailing List

On Wed, Jun 20, 2018 at 12:00 PM, Allen Pais <allen.lkml@gmail.com> wrote:
> Use ktime_get_real_seconds() as get_seconds() is deprecated.
>
> Signed-off-by: Allen Pais <allen.lkml@gmail.com>

I have done a similar patch and will post it soon along with the rest of the
ceph y2038 series. Please have a look at "ceph: use timespec64 in for
keepalive" and comment if you see something that I missed.

       Arnd

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

* Re: [Y2038] [PATCH] ceph: use ktime_get_real_seconds()
  2018-06-20 15:47 ` [Y2038] " Arnd Bergmann
@ 2018-06-21  5:41   ` Allen
  0 siblings, 0 replies; 6+ messages in thread
From: Allen @ 2018-06-21  5:41 UTC (permalink / raw)
  To: arnd; +Cc: netdev, y2038, ceph-devel, David Miller, linux-kernel

> > Signed-off-by: Allen Pais <allen.lkml@gmail.com>
>
> I have done a similar patch and will post it soon along with the rest of the
> ceph y2038 series. Please have a look at "ceph: use timespec64 in for
> keepalive" and comment if you see something that I missed.
>

Oh Okay. Thank you Arnd.

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

end of thread, other threads:[~2018-06-21  5:41 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-06-20 10:00 [PATCH] ceph: use ktime_get_real_seconds() Allen Pais
2018-06-20 12:33 ` Ilya Dryomov
2018-06-20 14:42   ` Allen
2018-06-20 14:42     ` Allen
2018-06-20 15:47 ` [Y2038] " Arnd Bergmann
2018-06-21  5:41   ` Allen

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.