* [PATCH 8/8] net: sunrpc: Replace CURRENT_TIME by current_fs_time()
[not found] <1456154274-30487-1-git-send-email-deepa.kernel@gmail.com>
@ 2016-02-22 15:17 ` Deepa Dinamani
2016-02-22 15:34 ` Trond Myklebust
0 siblings, 1 reply; 4+ messages in thread
From: Deepa Dinamani @ 2016-02-22 15:17 UTC (permalink / raw)
To: linux-fsdevel, y2038
Cc: linux-nfs, Arnd Bergmann, netdev, Trond Myklebust, linux-kernel,
David S. Miller, J. Bruce Fields, Jeff Layton, Anna Schumaker
CURRENT_TIME macro is not appropriate for filesystems as it
doesn't use the right granularity for filesystem timestamps.
Use current_fs_time() instead.
Signed-off-by: Deepa Dinamani <deepa.kernel@gmail.com>
Cc: "J. Bruce Fields" <bfields@fieldses.org>
Cc: Jeff Layton <jlayton@poochiereds.net>
Cc: Trond Myklebust <trond.myklebust@primarydata.com>
Cc: Anna Schumaker <anna.schumaker@netapp.com>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: linux-nfs@vger.kernel.org
Cc: netdev@vger.kernel.org
---
net/sunrpc/rpc_pipe.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/net/sunrpc/rpc_pipe.c b/net/sunrpc/rpc_pipe.c
index 31789ef..bab3187 100644
--- a/net/sunrpc/rpc_pipe.c
+++ b/net/sunrpc/rpc_pipe.c
@@ -477,7 +477,9 @@ rpc_get_inode(struct super_block *sb, umode_t mode)
return NULL;
inode->i_ino = get_next_ino();
inode->i_mode = mode;
- inode->i_atime = inode->i_mtime = inode->i_ctime = CURRENT_TIME;
+ inode->i_atime = current_fs_time(sb);
+ inode->i_mtime = inode->i_atime;
+ inode->i_ctime = inode->i_atime;
switch (mode & S_IFMT) {
case S_IFDIR:
inode->i_fop = &simple_dir_operations;
--
1.9.1
_______________________________________________
Y2038 mailing list
Y2038@lists.linaro.org
https://lists.linaro.org/mailman/listinfo/y2038
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH 8/8] net: sunrpc: Replace CURRENT_TIME by current_fs_time()
2016-02-22 15:17 ` [PATCH 8/8] net: sunrpc: Replace CURRENT_TIME by current_fs_time() Deepa Dinamani
@ 2016-02-22 15:34 ` Trond Myklebust
2016-02-22 15:47 ` Deepa Dinamani
[not found] ` <CAHQdGtR26gqy7GzWui-bnb+W5W1PnUL_=okBZwz+XFmj_Q4A3A-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
0 siblings, 2 replies; 4+ messages in thread
From: Trond Myklebust @ 2016-02-22 15:34 UTC (permalink / raw)
To: Deepa Dinamani
Cc: Linux FS-devel Mailing List, y2038, Arnd Bergmann,
Linux Kernel Mailing List, J. Bruce Fields, Jeff Layton,
Anna Schumaker, David S. Miller, Linux NFS Mailing List,
Linux Network Devel Mailing List
On Mon, Feb 22, 2016 at 10:17 AM, Deepa Dinamani <deepa.kernel@gmail.com> wrote:
>
> CURRENT_TIME macro is not appropriate for filesystems as it
> doesn't use the right granularity for filesystem timestamps.
> Use current_fs_time() instead.
>
> Signed-off-by: Deepa Dinamani <deepa.kernel@gmail.com>
> Cc: "J. Bruce Fields" <bfields@fieldses.org>
> Cc: Jeff Layton <jlayton@poochiereds.net>
> Cc: Trond Myklebust <trond.myklebust@primarydata.com>
> Cc: Anna Schumaker <anna.schumaker@netapp.com>
> Cc: "David S. Miller" <davem@davemloft.net>
> Cc: linux-nfs@vger.kernel.org
> Cc: netdev@vger.kernel.org
> ---
> net/sunrpc/rpc_pipe.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/net/sunrpc/rpc_pipe.c b/net/sunrpc/rpc_pipe.c
> index 31789ef..bab3187 100644
> --- a/net/sunrpc/rpc_pipe.c
> +++ b/net/sunrpc/rpc_pipe.c
> @@ -477,7 +477,9 @@ rpc_get_inode(struct super_block *sb, umode_t mode)
> return NULL;
> inode->i_ino = get_next_ino();
> inode->i_mode = mode;
> - inode->i_atime = inode->i_mtime = inode->i_ctime = CURRENT_TIME;
> + inode->i_atime = current_fs_time(sb);
> + inode->i_mtime = inode->i_atime;
> + inode->i_ctime = inode->i_atime;
> switch (mode & S_IFMT) {
> case S_IFDIR:
> inode->i_fop = &simple_dir_operations;
Why would we care? This is a pseudo-fs. There is no expectation w.r.t.
timestamp accuracy or resolution.
Cheers,
Trond
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH 8/8] net: sunrpc: Replace CURRENT_TIME by current_fs_time()
2016-02-22 15:34 ` Trond Myklebust
@ 2016-02-22 15:47 ` Deepa Dinamani
[not found] ` <CAHQdGtR26gqy7GzWui-bnb+W5W1PnUL_=okBZwz+XFmj_Q4A3A-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
1 sibling, 0 replies; 4+ messages in thread
From: Deepa Dinamani @ 2016-02-22 15:47 UTC (permalink / raw)
To: Trond Myklebust
Cc: Linux FS-devel Mailing List, y2038, Arnd Bergmann,
Linux Kernel Mailing List, J. Bruce Fields, Jeff Layton,
Anna Schumaker, David S. Miller, Linux NFS Mailing List,
Linux Network Devel Mailing List
On Mon, Feb 22, 2016 at 9:04 PM, Trond Myklebust
<trond.myklebust@primarydata.com> wrote:
> On Mon, Feb 22, 2016 at 10:17 AM, Deepa Dinamani <deepa.kernel@gmail.com> wrote:
>>
>> CURRENT_TIME macro is not appropriate for filesystems as it
>> doesn't use the right granularity for filesystem timestamps.
>> Use current_fs_time() instead.
>>
>> Signed-off-by: Deepa Dinamani <deepa.kernel@gmail.com>
>> Cc: "J. Bruce Fields" <bfields@fieldses.org>
>> Cc: Jeff Layton <jlayton@poochiereds.net>
>> Cc: Trond Myklebust <trond.myklebust@primarydata.com>
>> Cc: Anna Schumaker <anna.schumaker@netapp.com>
>> Cc: "David S. Miller" <davem@davemloft.net>
>> Cc: linux-nfs@vger.kernel.org
>> Cc: netdev@vger.kernel.org
>> ---
>> net/sunrpc/rpc_pipe.c | 4 +++-
>> 1 file changed, 3 insertions(+), 1 deletion(-)
>>
>> diff --git a/net/sunrpc/rpc_pipe.c b/net/sunrpc/rpc_pipe.c
>> index 31789ef..bab3187 100644
>> --- a/net/sunrpc/rpc_pipe.c
>> +++ b/net/sunrpc/rpc_pipe.c
>> @@ -477,7 +477,9 @@ rpc_get_inode(struct super_block *sb, umode_t mode)
>> return NULL;
>> inode->i_ino = get_next_ino();
>> inode->i_mode = mode;
>> - inode->i_atime = inode->i_mtime = inode->i_ctime = CURRENT_TIME;
>> + inode->i_atime = current_fs_time(sb);
>> + inode->i_mtime = inode->i_atime;
>> + inode->i_ctime = inode->i_atime;
>> switch (mode & S_IFMT) {
>> case S_IFDIR:
>> inode->i_fop = &simple_dir_operations;
>
> Why would we care? This is a pseudo-fs. There is no expectation w.r.t.
> timestamp accuracy or resolution.
CURRENT_TIME is not y2038 safe.
We are switching all vfs timestamps to use 64 bit time.
And, deleting all references to CURRENT_TIME.
So CURRENT_TIME users will be replaced by either ktime_get_* apis
or current_fs_time_* apis.
There is going to be another series (based on
https://lkml.org/lkml/2016/2/12/76)
which switches vfs time to 64 bit.
This means [a,c,m] times in struct inode, struct attr and struct kstat
will be changed to use timespec64.
Even though this is a psuedo-fs, we choose to use filesystem apis
rather than ktime_get_* apis as current_fs_time_* apis will switch time
data types together with vfs.
-Deepa
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [Y2038] [PATCH 8/8] net: sunrpc: Replace CURRENT_TIME by current_fs_time()
[not found] ` <CAHQdGtR26gqy7GzWui-bnb+W5W1PnUL_=okBZwz+XFmj_Q4A3A-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
@ 2016-02-24 15:08 ` Arnd Bergmann
0 siblings, 0 replies; 4+ messages in thread
From: Arnd Bergmann @ 2016-02-24 15:08 UTC (permalink / raw)
To: y2038-cunTk1MwBs8s++Sfvej+rw
Cc: Trond Myklebust, Deepa Dinamani, Linux NFS Mailing List,
Linux Network Devel Mailing List, Linux Kernel Mailing List,
David S. Miller, J. Bruce Fields, Linux FS-devel Mailing List,
Jeff Layton, Anna Schumaker
On Monday 22 February 2016 10:34:31 Trond Myklebust wrote:
> > diff --git a/net/sunrpc/rpc_pipe.c b/net/sunrpc/rpc_pipe.c
> > index 31789ef..bab3187 100644
> > --- a/net/sunrpc/rpc_pipe.c
> > +++ b/net/sunrpc/rpc_pipe.c
> > @@ -477,7 +477,9 @@ rpc_get_inode(struct super_block *sb, umode_t mode)
> > return NULL;
> > inode->i_ino = get_next_ino();
> > inode->i_mode = mode;
> > - inode->i_atime = inode->i_mtime = inode->i_ctime = CURRENT_TIME;
> > + inode->i_atime = current_fs_time(sb);
> > + inode->i_mtime = inode->i_atime;
> > + inode->i_ctime = inode->i_atime;
> > switch (mode & S_IFMT) {
> > case S_IFDIR:
> > inode->i_fop = &simple_dir_operations;
>
> Why would we care? This is a pseudo-fs. There is no expectation w.r.t.
> timestamp accuracy or resolution.
As Deepa said, the primary goal is to unify the interface, so we have only
one place function that handles setting the time in an inode, and we want
to avoid CURRENT_TIME, as that is currently used in a couple of places
for things other than inode timestamps that we don't want to convert to
64-bit times at the same time.
current_fs_time() has a very small overhead compared to CURRENT_TIME,
if you think it's worth avoiding that, we could introduce a
current_pseudo_fs_time() function that does not take a superblock
argument but is more tied to inode timestamps than CURRENT_TIME is.
Arnd
--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2016-02-24 15:08 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <1456154274-30487-1-git-send-email-deepa.kernel@gmail.com>
2016-02-22 15:17 ` [PATCH 8/8] net: sunrpc: Replace CURRENT_TIME by current_fs_time() Deepa Dinamani
2016-02-22 15:34 ` Trond Myklebust
2016-02-22 15:47 ` Deepa Dinamani
[not found] ` <CAHQdGtR26gqy7GzWui-bnb+W5W1PnUL_=okBZwz+XFmj_Q4A3A-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2016-02-24 15:08 ` [Y2038] " Arnd Bergmann
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).