Re: [PATCH] fat: Allow time_offset to be upto 13 hours

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, 26 Nov 2015 03:32:52 OGAWA Hirofumi wrote:

> Hmmm, 13 is where come from?
> 
> TZ environment (of course, has much more complex format though. see
> tzset(3)) offset is +-24 hours (total different can have more than
> 24). Well, so I feel, more or less, 12 is sane, and also 24 is sane.

12 IS NOT SANE because it does not allow to apply DST in some parts of 
the world for half of the year!!! (Basic maths like 12 + 1 = 13 must be 
very difficult to understand for a lot of programmers... problem has 
persisted for decades.)

> But I'm not sure why 13?

It's the minimum that is absolutely required to cover the DST offset in 
New Zealand. At the moment. There may be other places around the date 
line for which even that is not sufficient. Someone's been thoughtless 
already (has happened regularly for decades, probably won't be the last 
time either). Fix it properly.

If the kernel uses +-24 in places then please stick to +-24. There may 
be a reason for that not everyone knows about. The purpose of the range 
check is to be a SANITY check, not to tell me, the user, how I have to 
operate my system. If I want 3 minutes, I want 3 minutes, and it's not 
the kernel programmer's job to enforce.

Or do you wish to track the legal time zone AND DST offsets in every 
place in the world, make a list, stick that into the kernel, and 
maintain it? I hope not.

A good limit would be 2 less of whatever fits into 8 bit. Or something 
like that. Like +-120.

> > Reported-by: Volker Kuhlmann <list0570@xxxxxxxxxxxxxxx>
> > Signed-off-by: Jan Kara <jack@xxxxxxx>
> > ---
> > 
> >  fs/fat/inode.c | 6 +++++-
> >  1 file changed, 5 insertions(+), 1 deletion(-)
> > 
> > diff --git a/fs/fat/inode.c b/fs/fat/inode.c
> > index 509411dd3698..2041031ab1c8 100644
> > --- a/fs/fat/inode.c
> > +++ b/fs/fat/inode.c
> > @@ -1146,7 +1146,11 @@ static int parse_options(struct super_block
> > *sb, char *options, int is_vfat,> 
> >  		case Opt_time_offset:
> >  			if (match_int(&args[0], &option))
> >  			
> >  				return -EINVAL;
> > 
> > -			if (option < -12 * 60 || option > 12 * 60)
> > +			/*
> > +			 * Allow for GMT+-12 zones to have DST like
> > +			 * corrections
> > +			 */
> > +			if (option < -13 * 60 || option > 13 * 60)
> > 
> >  				return -EINVAL;
> >  			
> >  			opts->tz_set = 1;
> >  			opts->time_offset = option;
-- 
Volker Kuhlmann
http://volker.top.geek.nz/	Please do not CC list postings to me.

--
To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [Samba]     [Device Mapper]     [CEPH Development]
  Powered by Linux