linux-ext4.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 06/10] fs: ext4: Replace CURRENT_TIME_SEC with current_fs_time_sec()
       [not found] <1454479670-8204-1-git-send-email-deepa.kernel@gmail.com>
@ 2016-02-03  6:07 ` Deepa Dinamani
  2016-02-03  6:07 ` [PATCH 07/10] fs: ext4: Replace CURRENT_TIME with ext4_current_time() Deepa Dinamani
  1 sibling, 0 replies; 2+ messages in thread
From: Deepa Dinamani @ 2016-02-03  6:07 UTC (permalink / raw)
  To: linux-fsdevel, y2038
  Cc: Arnd Bergmann, Dave Chinner, Theodore Ts'o, linux-kernel,
	Andreas Dilger, linux-ext4

The macro CURRENT_TIME_SEC does not represent filesystem times
correctly as it cannot perform range checks.
current_fs_time_sec() will be extended to include this.

CURRENT_TIME_SEC is also not y2038 safe. current_fs_time_sec()
will be transitioned to use 64 bit time along with vfs in a
separate series.

Signed-off-by: Deepa Dinamani <deepa.kernel@gmail.com>
Cc: "Theodore Ts'o" <tytso@mit.edu>
Cc: Andreas Dilger <adilger.kernel@dilger.ca>
Cc: linux-ext4@vger.kernel.org
---
 fs/ext4/ext4.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/ext4/ext4.h b/fs/ext4/ext4.h
index 0662b28..8dd04f8 100644
--- a/fs/ext4/ext4.h
+++ b/fs/ext4/ext4.h
@@ -1489,7 +1489,7 @@ static inline struct ext4_inode_info *EXT4_I(struct inode *inode)
 static inline struct timespec ext4_current_time(struct inode *inode)
 {
 	return (inode->i_sb->s_time_gran < NSEC_PER_SEC) ?
-		current_fs_time(inode->i_sb) : CURRENT_TIME_SEC;
+		current_fs_time(inode->i_sb) : current_fs_time_sec(inode->i_sb);
 }
 
 static inline int ext4_valid_inum(struct super_block *sb, unsigned long ino)
-- 
1.9.1

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

* [PATCH 07/10] fs: ext4: Replace CURRENT_TIME with ext4_current_time()
       [not found] <1454479670-8204-1-git-send-email-deepa.kernel@gmail.com>
  2016-02-03  6:07 ` [PATCH 06/10] fs: ext4: Replace CURRENT_TIME_SEC with current_fs_time_sec() Deepa Dinamani
@ 2016-02-03  6:07 ` Deepa Dinamani
  1 sibling, 0 replies; 2+ messages in thread
From: Deepa Dinamani @ 2016-02-03  6:07 UTC (permalink / raw)
  To: linux-fsdevel, y2038
  Cc: Arnd Bergmann, Dave Chinner, Theodore Ts'o, linux-kernel,
	Andreas Dilger, linux-ext4

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

Signed-off-by: Deepa Dinamani <deepa.kernel@gmail.com>
Cc: "Theodore Ts'o" <tytso@mit.edu>
Cc: Andreas Dilger <adilger.kernel@dilger.ca>
Cc: linux-ext4@vger.kernel.org
---
 fs/ext4/super.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/ext4/super.c b/fs/ext4/super.c
index 3ed01ec..5e6c866 100644
--- a/fs/ext4/super.c
+++ b/fs/ext4/super.c
@@ -5139,7 +5139,7 @@ static int ext4_quota_off(struct super_block *sb, int type)
 	handle = ext4_journal_start(inode, EXT4_HT_QUOTA, 1);
 	if (IS_ERR(handle))
 		goto out;
-	inode->i_mtime = inode->i_ctime = CURRENT_TIME;
+	inode->i_mtime = inode->i_ctime = ext4_current_time(inode);
 	ext4_mark_inode_dirty(handle, inode);
 	ext4_journal_stop(handle);
 
-- 
1.9.1

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

end of thread, other threads:[~2016-02-03  6:07 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <1454479670-8204-1-git-send-email-deepa.kernel@gmail.com>
2016-02-03  6:07 ` [PATCH 06/10] fs: ext4: Replace CURRENT_TIME_SEC with current_fs_time_sec() Deepa Dinamani
2016-02-03  6:07 ` [PATCH 07/10] fs: ext4: Replace CURRENT_TIME with ext4_current_time() Deepa Dinamani

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).