[RFC 06/32] isofs: fix timestamps beyond 2027

From
Arnd Bergmann <arnd@arndb.de>
Date
2014-05-30 20:01:30
Also in
linux-fsdevel, lkml
Reply to
Arnd Bergmann, 2014-05-30
isofs uses a 'char' variable to load the number of years since
1900 for an inode timestamp. On architectures that use a signed
char type by default, this results in an invalid date for
anything beyond 2027.

This adds a cast to 'u8' for the year number, which should extend
the shelf life of the file system until 2155.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 fs/isofs/util.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/fs/isofs/util.c b/fs/isofs/util.c
index 01e1ee7..28e7ff1 100644
--- a/fs/isofs/util.c
+++ b/fs/isofs/util.c
@@ -19,7 +19,7 @@ int iso_date(char * p, int flag)
 	int year, month, day, hour, minute, second, tz;
 	int crtime, days, i;
 
-	year = p[0] - 70;
+	year = (int)(u8)p[0] - 70;
 	month = p[1];
 	day = p[2];
 	hour = p[3];
-- 
1.8.3.2
Thread (101 messages) 101 messages, 17 authors, last reply 2014-06-03
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help