Skip to contentSkip to conversation

pstore: Convert internal records to timespec64

PATCH Superseded Kees Cook 2 participants 3 messages May 12, 2018 – May 13, 2018 Pstore filesystem

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

Kees Cook

author
#0 lore raw

PATCH 1/1 pstore: Convert internal records to timespec64

This prepares pstore for converting the VFS layer to timespec64.

Cc Deepa Dinamani <[email protected]>
---
 fs/pstore/inode.c      | 3 ++-
 fs/pstore/platform.c   | 2 +-
 include/linux/pstore.h | 2 +-
 3 files changed, 4 insertions(+), 3 deletions(-)
fs/pstore/inode.c +2 -1
index 5fcb845b9fec..75afe5eb0574 100644
@@ -392,7 +392,8 @@ int pstore_mkfile(struct dentry *root, struct pstore_record *record)
 	inode->i_private = private;
 
 	if (record->time.tv_sec)
-		inode->i_mtime = inode->i_ctime = record->time;
+		inode->i_mtime = inode->i_ctime =
+			timespec64_to_timespec(record->time);
 
 	d_add(dentry, inode);
 
fs/pstore/platform.c +1 -1
index dc720573fd53..c238ab8ba31d 100644
@@ -328,7 +328,7 @@ void pstore_record_init(struct pstore_record *record,
 	record->psi = psinfo;
 
 	/* Report zeroed timestamp if called before timekeeping has resumed. */
-	record->time = ns_to_timespec(ktime_get_real_fast_ns());
+	record->time = ns_to_timespec64(ktime_get_real_fast_ns());
 }
 
 /*
include/linux/pstore.h +1 -1
index 61f806a7fe29..a15bc4d48752 100644
@@ -71,7 +71,7 @@ struct pstore_record {
 	struct pstore_info	*psi;
 	enum pstore_type_id	type;
 	u64			id;
-	struct timespec		time;
+	struct timespec64	time;
 	char			*buf;
 	ssize_t			size;
 	ssize_t			ecc_notice_size;
Signature · 6 lines
2.17.0


-- 
Kees Cook
Pixel Security
Acked-by on v1 1/1
#1 lore raw

I will rebase the vfs series on top of this.
I'm a little worried about merge strategy.
Whoever is taking that series should pull in this patch as well? I could include it as one of the patches in the series if you prefer.

-Deepa

Quoted 57 lines · Kees Cook

This prepares pstore for converting the VFS layer to timespec64.

Cc Deepa Dinamani <[email protected]>
---
 fs/pstore/inode.c      | 3 ++-
 fs/pstore/platform.c   | 2 +-
 include/linux/pstore.h | 2 +-
 3 files changed, 4 insertions(+), 3 deletions(-)
fs/pstore/inode.c +2 -1
index 5fcb845b9fec..75afe5eb0574 100644
@@ -392,7 +392,8 @@ int pstore_mkfile(struct dentry *root, struct pstore_record *record)
        inode->i_private = private;
 
        if (record->time.tv_sec)
-               inode->i_mtime = inode->i_ctime = record->time;
+               inode->i_mtime = inode->i_ctime =
+                       timespec64_to_timespec(record->time);
 
        d_add(dentry, inode);
 
fs/pstore/platform.c +1 -1
index dc720573fd53..c238ab8ba31d 100644
@@ -328,7 +328,7 @@ void pstore_record_init(struct pstore_record *record,
        record->psi = psinfo;
 
        /* Report zeroed timestamp if called before timekeeping has resumed. */
-       record->time = ns_to_timespec(ktime_get_real_fast_ns());
+       record->time = ns_to_timespec64(ktime_get_real_fast_ns());
 }
 
 /*
include/linux/pstore.h +1 -2
index 61f806a7fe29..a15bc4d48752 100644
@@ -71,7 +71,7 @@ struct pstore_record {
        struct pstore_info      *psi;
        enum pstore_type_id     type;
        u64                     id;
-       struct timespec         time;
+       struct timespec64       time;
        char                    *buf;
        ssize_t                 size;
        ssize_t                 ecc_notice_size;
--

2.17.0

--
Kees Cook
Pixel Security

author
#2 lore raw
Quoted 1 line · Deepa Dinamani

Thanks for checking this over!

Quoted 4 lines

I will rebase the vfs series on top of this.
I'm a little worried about merge strategy.
Whoever is taking that series should pull in this patch as well? I could include it as one of the patches in the series if you prefer.

I'll send a v2, I found some problems in my testing. I'll see if Linus will take it for v4.17, so it'll be out of your way for v4.18.

-Kees

Quoted 61 lines

-Deepa

Quoted 57 lines · Kees Cook

This prepares pstore for converting the VFS layer to timespec64.

Cc Deepa Dinamani <[email protected]>
---
 fs/pstore/inode.c      | 3 ++-
 fs/pstore/platform.c   | 2 +-
 include/linux/pstore.h | 2 +-
 3 files changed, 4 insertions(+), 3 deletions(-)
fs/pstore/inode.c +2 -1
index 5fcb845b9fec..75afe5eb0574 100644
@@ -392,7 +392,8 @@ int pstore_mkfile(struct dentry *root, struct pstore_record *record)
        inode->i_private = private;
 
        if (record->time.tv_sec)
-               inode->i_mtime = inode->i_ctime = record->time;
+               inode->i_mtime = inode->i_ctime =
+                       timespec64_to_timespec(record->time);
 
        d_add(dentry, inode);
 
fs/pstore/platform.c +1 -1
index dc720573fd53..c238ab8ba31d 100644
@@ -328,7 +328,7 @@ void pstore_record_init(struct pstore_record *record,
        record->psi = psinfo;
 
        /* Report zeroed timestamp if called before timekeeping has resumed. */
-       record->time = ns_to_timespec(ktime_get_real_fast_ns());
+       record->time = ns_to_timespec64(ktime_get_real_fast_ns());
 }
 
 /*
include/linux/pstore.h +1 -2
index 61f806a7fe29..a15bc4d48752 100644
@@ -71,7 +71,7 @@ struct pstore_record {
        struct pstore_info      *psi;
        enum pstore_type_id     type;
        u64                     id;
-       struct timespec         time;
+       struct timespec64       time;
        char                    *buf;
        ssize_t                 size;
        ssize_t                 ecc_notice_size;
--

2.17.0

--
Kees Cook
Pixel Security

Signature · 2 lines
Kees Cook
Pixel Security