All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Yan, Zheng" <ukernel@gmail.com>
To: Arnd Bergmann <arnd@arndb.de>
Cc: Ilya Dryomov <idryomov@gmail.com>, Zheng Yan <zyan@redhat.com>,
	Sage Weil <sage@redhat.com>,
	y2038 Mailman List <y2038@lists.linaro.org>,
	Linux FS-devel Mailing List <linux-fsdevel@vger.kernel.org>,
	ceph-devel <ceph-devel@vger.kernel.org>,
	Jeff Layton <jlayton@redhat.com>, Chengguang Xu <cgxu519@gmx.com>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 2/5] ceph: stop using current_kernel_time()
Date: Mon, 16 Jul 2018 08:46:01 +0800	[thread overview]
Message-ID: <CAAM7YA=a00DHGm3CrGVy=tQm+7OBFYT1rmKY9wamVCYt0gqJKA@mail.gmail.com> (raw)
In-Reply-To: <20180713201923.3200799-2-arnd@arndb.de>

The cephfs part (patch 2~5) looks good for me.

Regards
Yan, Zheng


On Sat, Jul 14, 2018 at 4:21 AM Arnd Bergmann <arnd@arndb.de> wrote:
>
> ceph_mdsc_create_request() is one of the last callers of the
> deprecated current_kernel_time() as well as timespec_trunc().
>
> This changes it to use the timespec64 based interfaces instead,
> though we still need to convert the result until we are ready to
> change over req->r_stamp.
>
> The output of the two functions, ktime_get_coarse_real_ts64() and
> current_kernel_time() is the same coarse-granular timestamp,
> the only difference here is that ktime_get_coarse_real_ts64()
> doesn't overflow in 2038.
>
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> ---
> v2: add clarification that this is the same timestamp
> ---
>  fs/ceph/mds_client.c | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/fs/ceph/mds_client.c b/fs/ceph/mds_client.c
> index dc8bc664a871..69c839316a7a 100644
> --- a/fs/ceph/mds_client.c
> +++ b/fs/ceph/mds_client.c
> @@ -1779,6 +1779,7 @@ 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 timespec64 ts;
>
>         if (!req)
>                 return ERR_PTR(-ENOMEM);
> @@ -1797,7 +1798,9 @@ 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);
>
> -       req->r_stamp = timespec_trunc(current_kernel_time(), mdsc->fsc->sb->s_time_gran);
> +       ktime_get_coarse_real_ts64(&ts);
> +       req->r_stamp = timespec64_to_timespec(timespec64_trunc(ts,
> +                                               mdsc->fsc->sb->s_time_gran));
>
>         req->r_op = op;
>         req->r_direct_mode = mode;
> --
> 2.9.0
>
> --
> To unsubscribe from this list: send the line "unsubscribe ceph-devel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

WARNING: multiple messages have this Message-ID (diff)
From: "Yan, Zheng" <ukernel@gmail.com>
To: Arnd Bergmann <arnd@arndb.de>
Cc: Jeff Layton <jlayton@redhat.com>, Sage Weil <sage@redhat.com>,
	y2038 Mailman List <y2038@lists.linaro.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Zheng Yan <zyan@redhat.com>, Chengguang Xu <cgxu519@gmx.com>,
	Linux FS-devel Mailing List <linux-fsdevel@vger.kernel.org>,
	Ilya Dryomov <idryomov@gmail.com>,
	ceph-devel <ceph-devel@vger.kernel.org>
Subject: Re: [PATCH 2/5] ceph: stop using current_kernel_time()
Date: Mon, 16 Jul 2018 08:46:01 +0800	[thread overview]
Message-ID: <CAAM7YA=a00DHGm3CrGVy=tQm+7OBFYT1rmKY9wamVCYt0gqJKA@mail.gmail.com> (raw)
In-Reply-To: <20180713201923.3200799-2-arnd@arndb.de>

The cephfs part (patch 2~5) looks good for me.

Regards
Yan, Zheng


On Sat, Jul 14, 2018 at 4:21 AM Arnd Bergmann <arnd@arndb.de> wrote:
>
> ceph_mdsc_create_request() is one of the last callers of the
> deprecated current_kernel_time() as well as timespec_trunc().
>
> This changes it to use the timespec64 based interfaces instead,
> though we still need to convert the result until we are ready to
> change over req->r_stamp.
>
> The output of the two functions, ktime_get_coarse_real_ts64() and
> current_kernel_time() is the same coarse-granular timestamp,
> the only difference here is that ktime_get_coarse_real_ts64()
> doesn't overflow in 2038.
>
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> ---
> v2: add clarification that this is the same timestamp
> ---
>  fs/ceph/mds_client.c | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/fs/ceph/mds_client.c b/fs/ceph/mds_client.c
> index dc8bc664a871..69c839316a7a 100644
> --- a/fs/ceph/mds_client.c
> +++ b/fs/ceph/mds_client.c
> @@ -1779,6 +1779,7 @@ 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 timespec64 ts;
>
>         if (!req)
>                 return ERR_PTR(-ENOMEM);
> @@ -1797,7 +1798,9 @@ 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);
>
> -       req->r_stamp = timespec_trunc(current_kernel_time(), mdsc->fsc->sb->s_time_gran);
> +       ktime_get_coarse_real_ts64(&ts);
> +       req->r_stamp = timespec64_to_timespec(timespec64_trunc(ts,
> +                                               mdsc->fsc->sb->s_time_gran));
>
>         req->r_op = op;
>         req->r_direct_mode = mode;
> --
> 2.9.0
>
> --
> To unsubscribe from this list: send the line "unsubscribe ceph-devel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
_______________________________________________
Y2038 mailing list
Y2038@lists.linaro.org
https://lists.linaro.org/mailman/listinfo/y2038

  reply	other threads:[~2018-07-16  0:46 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-13 20:18 [PATCH 1/5] ceph: use timespec64 in for keepalive Arnd Bergmann
2018-07-13 20:18 ` [PATCH 2/5] ceph: stop using current_kernel_time() Arnd Bergmann
2018-07-16  0:46   ` Yan, Zheng [this message]
2018-07-16  0:46     ` Yan, Zheng
2018-07-13 20:18 ` [PATCH 3/5] ceph: use timespec64 for inode timestamp Arnd Bergmann
2018-07-13 20:18 ` [PATCH 4/5] ceph: use timespec64 for r_mtime Arnd Bergmann
2018-07-13 20:18 ` [PATCH 5/5] ceph: use 64-bit timespec for r_stamp Arnd Bergmann
  -- strict thread matches above, loose matches on Subject: below --
2018-06-20 15:50 [PATCH 1/5] ceph: use timespec64 in for keepalive Arnd Bergmann
2018-06-20 15:50 ` [PATCH 2/5] ceph: stop using current_kernel_time() Arnd Bergmann
2018-06-21 12:29   ` Yan, Zheng
2018-06-21 14:53     ` Arnd Bergmann

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAAM7YA=a00DHGm3CrGVy=tQm+7OBFYT1rmKY9wamVCYt0gqJKA@mail.gmail.com' \
    --to=ukernel@gmail.com \
    --cc=arnd@arndb.de \
    --cc=ceph-devel@vger.kernel.org \
    --cc=cgxu519@gmx.com \
    --cc=idryomov@gmail.com \
    --cc=jlayton@redhat.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sage@redhat.com \
    --cc=y2038@lists.linaro.org \
    --cc=zyan@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.