* [PATCH] pstore: Convert internal records to timespec64
@ 2018-05-12 6:57 Kees Cook
2018-05-12 17:45 ` Deepa Dinamani
0 siblings, 1 reply; 3+ messages in thread
From: Kees Cook @ 2018-05-12 6:57 UTC (permalink / raw)
To: linux-kernel; +Cc: Deepa Dinamani, Anton Vorontsov, Colin Cross, Tony Luck
This prepares pstore for converting the VFS layer to timespec64.
Cc: Deepa Dinamani <deepa.kernel@gmail.com>
Signed-off-by: Kees Cook <keescook@chromium.org>
---
fs/pstore/inode.c | 3 ++-
fs/pstore/platform.c | 2 +-
include/linux/pstore.h | 2 +-
3 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/fs/pstore/inode.c b/fs/pstore/inode.c
index 5fcb845b9fec..75afe5eb0574 100644
--- a/fs/pstore/inode.c
+++ b/fs/pstore/inode.c
@@ -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);
diff --git a/fs/pstore/platform.c b/fs/pstore/platform.c
index dc720573fd53..c238ab8ba31d 100644
--- a/fs/pstore/platform.c
+++ b/fs/pstore/platform.c
@@ -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());
}
/*
diff --git a/include/linux/pstore.h b/include/linux/pstore.h
index 61f806a7fe29..a15bc4d48752 100644
--- a/include/linux/pstore.h
+++ b/include/linux/pstore.h
@@ -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
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] pstore: Convert internal records to timespec64
2018-05-12 6:57 [PATCH] pstore: Convert internal records to timespec64 Kees Cook
@ 2018-05-12 17:45 ` Deepa Dinamani
2018-05-13 5:06 ` Kees Cook
0 siblings, 1 reply; 3+ messages in thread
From: Deepa Dinamani @ 2018-05-12 17:45 UTC (permalink / raw)
To: Kees Cook
Cc: Linux Kernel Mailing List, Anton Vorontsov, Colin Cross, Tony Luck
Acked-by: Deepa Dinamani <deepa.kernel@gmail.com>
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
On Fri, May 11, 2018 at 11:57 PM, Kees Cook <keescook@chromium.org> wrote:
> This prepares pstore for converting the VFS layer to timespec64.
>
> Cc: Deepa Dinamani <deepa.kernel@gmail.com>
> Signed-off-by: Kees Cook <keescook@chromium.org>
> ---
> fs/pstore/inode.c | 3 ++-
> fs/pstore/platform.c | 2 +-
> include/linux/pstore.h | 2 +-
> 3 files changed, 4 insertions(+), 3 deletions(-)
>
> diff --git a/fs/pstore/inode.c b/fs/pstore/inode.c
> index 5fcb845b9fec..75afe5eb0574 100644
> --- a/fs/pstore/inode.c
> +++ b/fs/pstore/inode.c
> @@ -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);
>
> diff --git a/fs/pstore/platform.c b/fs/pstore/platform.c
> index dc720573fd53..c238ab8ba31d 100644
> --- a/fs/pstore/platform.c
> +++ b/fs/pstore/platform.c
> @@ -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());
> }
>
> /*
> diff --git a/include/linux/pstore.h b/include/linux/pstore.h
> index 61f806a7fe29..a15bc4d48752 100644
> --- a/include/linux/pstore.h
> +++ b/include/linux/pstore.h
> @@ -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
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] pstore: Convert internal records to timespec64
2018-05-12 17:45 ` Deepa Dinamani
@ 2018-05-13 5:06 ` Kees Cook
0 siblings, 0 replies; 3+ messages in thread
From: Kees Cook @ 2018-05-13 5:06 UTC (permalink / raw)
To: Deepa Dinamani
Cc: Linux Kernel Mailing List, Anton Vorontsov, Colin Cross, Tony Luck
On Sat, May 12, 2018 at 10:45 AM, Deepa Dinamani <deepa.kernel@gmail.com> wrote:
> Acked-by: Deepa Dinamani <deepa.kernel@gmail.com>
Thanks for checking this over!
> 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
>
> -Deepa
>
> On Fri, May 11, 2018 at 11:57 PM, Kees Cook <keescook@chromium.org> wrote:
>> This prepares pstore for converting the VFS layer to timespec64.
>>
>> Cc: Deepa Dinamani <deepa.kernel@gmail.com>
>> Signed-off-by: Kees Cook <keescook@chromium.org>
>> ---
>> fs/pstore/inode.c | 3 ++-
>> fs/pstore/platform.c | 2 +-
>> include/linux/pstore.h | 2 +-
>> 3 files changed, 4 insertions(+), 3 deletions(-)
>>
>> diff --git a/fs/pstore/inode.c b/fs/pstore/inode.c
>> index 5fcb845b9fec..75afe5eb0574 100644
>> --- a/fs/pstore/inode.c
>> +++ b/fs/pstore/inode.c
>> @@ -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);
>>
>> diff --git a/fs/pstore/platform.c b/fs/pstore/platform.c
>> index dc720573fd53..c238ab8ba31d 100644
>> --- a/fs/pstore/platform.c
>> +++ b/fs/pstore/platform.c
>> @@ -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());
>> }
>>
>> /*
>> diff --git a/include/linux/pstore.h b/include/linux/pstore.h
>> index 61f806a7fe29..a15bc4d48752 100644
>> --- a/include/linux/pstore.h
>> +++ b/include/linux/pstore.h
>> @@ -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
--
Kees Cook
Pixel Security
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2018-05-13 5:07 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-05-12 6:57 [PATCH] pstore: Convert internal records to timespec64 Kees Cook
2018-05-12 17:45 ` Deepa Dinamani
2018-05-13 5:06 ` Kees Cook
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).