Thread (6 messages) flat view 6 messages, 3 authors, 2016-06-14

Re: [Y2038] [PATCH 02/21] fs: ext4: Use current_fs_time() for inode timestamps

From: Deepa Dinamani <hidden>
Date: 2016-06-14 17:55:39
Also in: linux-fsdevel, lkml

On Fri, Jun 10, 2016 at 3:19 PM, Arnd Bergmann [off-list ref] wrote:
On Thursday, June 9, 2016 11:45:01 AM CEST Linus Torvalds wrote:
quoted
On Wed, Jun 8, 2016 at 10:04 PM, Deepa Dinamani [off-list ref] wrote:
quoted
CURRENT_TIME_SEC and CURRENT_TIME are not y2038 safe.
current_fs_time() will be transitioned to be y2038 safe
along with vfs.

current_fs_time() returns timestamps according to the
granularities set in the super_block.
All existing users and all the ones in this patch (and the others too,
although I didn't go through them very carefully) really would prefer
just passing in the inode directly, rather than the superblock.

So I don't want to add more users of this broken interface.  It was a
mistake to use the superblock. The fact that the time granularity
exists there is pretty much irrelevant. If every single user wants to
use an inode pointer, then that is what the function should get.
I guess it would help to give the function a new name in the process,
if only to avoid possible conflicts. That new name of course needs to
be at least as intuitive as the old one. How about

struct timespec fs_timestamp(struct inode *);
Would moving the function to fs/ directory (filesystems.c/ super.c /
inode.c) and calling it current_time() or fs_current_time() make
sense?
The declaration is already part of fs.h.

This is actually a vfs function.
And, the time functions it uses are already exported.
Leaving it in the time.c by renaming to current_time() would be
confusing in spite of
the struct inode* argument.

-Deepa
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help