Skip to contentSkip to conversation

vfs: Add support to document max and min inode times

PATCH RESEND In review Deepa Dinamani 2 participants 2 messages Apr 8, 2016 – Apr 9, 2016 VFS

v1 of 3 In review Latest is v3 →

lore
Share & tools
lore
#0 lore raw

PATCH RESEND 1/1 vfs: Add support to document max and min inode times

This is a preparation patch to add range checking for inode timestamps.

Extend struct super_block to include information about the max and min inode times each filesystem can hold. These are dependent on the on-disk format of filesystems.

These range checks will be used to clamp timestamps to filesystem allowed ranges.

Individual filesystems do not have the same on disk format as the in memory inodes. Range checking and clamping times assigned to inodes will help keep in memory and on-disk timestamps to be in sync.

Another series will initialize these fields to appropriate values for every filesystem.

The fields are not used by vfs yet.
The exact policy and behavior will be decided in a separate patch.

The original idea for the feature comes from the discussion:
https://lkml.org/lkml/2014/5/30/669

---

Resending for inclusion in Thomas's tree.

 include/linux/fs.h | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)
include/linux/fs.h +8 -1
index d0bf64f..c936314 100644
@@ -1374,7 +1374,14 @@ struct super_block {
 
 	/* Granularity of c/m/atime in ns.
 	   Cannot be worse than a second */
-	u32		   s_time_gran;
+	u32		s_time_gran;
+
+	/*
+	 * Max and min values for timestamps
+	 * according to the range supported by filesystems.
+	 */
+	time64_t	s_time_min;
+	time64_t	s_time_max;
 
 	/*
 	 * The next field is for VFS *only*. No filesystems have any business
Signature · 1 line
1.9.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 18 lines · Deepa Dinamani

This is a preparation patch to add range checking for inode timestamps.

Extend struct super_block to include information about the max and min inode times each filesystem can hold. These are dependent on the on-disk format of filesystems.

These range checks will be used to clamp timestamps to filesystem allowed ranges.

Individual filesystems do not have the same on disk format as the in memory inodes. Range checking and clamping times assigned to inodes will help keep in memory and on-disk timestamps to be in sync.

Another series will initialize these fields to appropriate values for every filesystem.

Quoted 7 lines

The fields are not used by vfs yet.
The exact policy and behavior will be decided in a separate patch.

The original idea for the feature comes from the discussion:
https://lkml.org/lkml/2014/5/30/669