Skip to content

Commit 5ad32b3

Browse files
committed
isofs: Initialize filesystem timestamp ranges
Fill in the appropriate limits to avoid inconsistencies in the vfs cached inode times when timestamps are outside the permitted range. Reference: http://www.ecma-international.org/publications/standards/Ecma-119.htm Signed-off-by: Deepa Dinamani <deepa.kernel@gmail.com> Acked-by: Jeff Layton <jlayton@kernel.org>
1 parent 83b8a3f commit 5ad32b3

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

‎fs/isofs/inode.c‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,9 @@
3030
#include "isofs.h"
3131
#include "zisofs.h"
3232

33+
/* max tz offset is 13 hours */
34+
#define MAX_TZ_OFFSET (52*15*60)
35+
3336
#define BEQUIET
3437

3538
static int isofs_hashi(const struct dentry *parent, struct qstr *qstr);
@@ -801,6 +804,10 @@ static int isofs_fill_super(struct super_block *s, void *data, int silent)
801804
*/
802805
s->s_maxbytes = 0x80000000000LL;
803806

807+
/* ECMA-119 timestamp from 1900/1/1 with tz offset */
808+
s->s_time_min = mktime64(1900, 1, 1, 0, 0, 0) - MAX_TZ_OFFSET;
809+
s->s_time_max = mktime64(U8_MAX+1900, 12, 31, 23, 59, 59) + MAX_TZ_OFFSET;
810+
804811
/* Set this for reference. Its not currently used except on write
805812
which we don't have .. */
806813

0 commit comments

Comments
 (0)