From d5bd821350e69f5f464c175455135727f986f793 Mon Sep 17 00:00:00 2001 From: Jan Kara Date: Tue, 19 Dec 2017 08:11:01 +0100 Subject: udf: Sanitize nanoseconds for time stamps Reportedly some UDF filesystems are recorded with bogus subsecond values resulting in nanoseconds being over 10^9. Sanitize nanoseconds in time stamps when loading them from disk. Reported-by: Ian Turner Signed-off-by: Jan Kara --- fs/udf/udftime.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'fs') diff --git a/fs/udf/udftime.c b/fs/udf/udftime.c index 14626b34d13e..0927a4b2ecaf 100644 --- a/fs/udf/udftime.c +++ b/fs/udf/udftime.c @@ -62,6 +62,11 @@ udf_disk_stamp_to_time(struct timespec *dest, struct timestamp src) dest->tv_sec -= offset * 60; dest->tv_nsec = 1000 * (src.centiseconds * 10000 + src.hundredsOfMicroseconds * 100 + src.microseconds); + /* + * Sanitize nanosecond field since reportedly some filesystems are + * recorded with bogus sub-second values. + */ + dest->tv_nsec %= NSEC_PER_SEC; return dest; } -- cgit From f463589a7cd2d156e3b6b64ee26588c0cdcce08a Mon Sep 17 00:00:00 2001 From: Julia Lawall Date: Wed, 27 Dec 2017 15:51:37 +0100 Subject: ext2: drop unneeded newline ext2_msg prints a newline at the end of the message string, so the message string does not need to include a newline explicitly. Done using Coccinelle. Reviewed-by: Theodore Ts'o Signed-off-by: Julia Lawall Signed-off-by: Jan Kara --- fs/ext2/super.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'fs') diff --git a/fs/ext2/super.c b/fs/ext2/super.c index 7646818ab266..15f90f5f3e13 100644 --- a/fs/ext2/super.c +++ b/fs/ext2/super.c @@ -1225,7 +1225,7 @@ static void ext2_clear_super_error(struct super_block *sb) * write and hope for the best. */ ext2_msg(sb, KERN_ERR, - "previous I/O error to superblock detected\n"); + "previous I/O error to superblock detected"); clear_buffer_write_io_error(sbh); set_buffer_uptodate(sbh); } -- cgit