All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] fat: Allow time_offset to be upto 24 hours
@ 2015-11-26 10:00 Jan Kara
  2015-11-26 15:45 ` OGAWA Hirofumi
  0 siblings, 1 reply; 2+ messages in thread
From: Jan Kara @ 2015-11-26 10:00 UTC (permalink / raw)
  To: OGAWA Hirofumi; +Cc: Volker Kuhlmann, linux-fsdevel, Jan Kara

Currently we limit values of time_offset mount option to be between -12
and 12 hours. However e.g. zone GMT+12 can have a DST correction on top
which makes the total time difference 13 hours. Update the checks in
mount option parsing to allow offset of upto 24 hours to allow for
unusual cases.

Reported-by: Volker Kuhlmann <list0570@paradise.net.nz>
Signed-off-by: Jan Kara <jack@suse.cz>
---
 fs/fat/inode.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/fs/fat/inode.c b/fs/fat/inode.c
index 509411dd3698..aa7bc11fe8fb 100644
--- a/fs/fat/inode.c
+++ b/fs/fat/inode.c
@@ -1146,7 +1146,12 @@ 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)
+			/*
+			 * GMT+-12 zones may have DST corrections so at least
+			 * 13 hours difference is needed. Make the limit 24
+			 * just in case someone invents something unusual.
+			 */
+			if (option < -24 * 60 || option > 24 * 60)
 				return -EINVAL;
 			opts->tz_set = 1;
 			opts->time_offset = option;
-- 
2.1.4


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] fat: Allow time_offset to be upto 24 hours
  2015-11-26 10:00 [PATCH] fat: Allow time_offset to be upto 24 hours Jan Kara
@ 2015-11-26 15:45 ` OGAWA Hirofumi
  0 siblings, 0 replies; 2+ messages in thread
From: OGAWA Hirofumi @ 2015-11-26 15:45 UTC (permalink / raw)
  To: Andrew Morton; +Cc: Jan Kara, Volker Kuhlmann, linux-fsdevel

Jan Kara <jack@suse.cz> writes:

> Currently we limit values of time_offset mount option to be between -12
> and 12 hours. However e.g. zone GMT+12 can have a DST correction on top
> which makes the total time difference 13 hours. Update the checks in
> mount option parsing to allow offset of upto 24 hours to allow for
> unusual cases.
>
> Reported-by: Volker Kuhlmann <list0570@paradise.net.nz>
> Signed-off-by: Jan Kara <jack@suse.cz>

Acked-by: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>

Thanks.

> ---
>  fs/fat/inode.c | 7 ++++++-
>  1 file changed, 6 insertions(+), 1 deletion(-)
>
> diff --git a/fs/fat/inode.c b/fs/fat/inode.c
> index 509411dd3698..aa7bc11fe8fb 100644
> --- a/fs/fat/inode.c
> +++ b/fs/fat/inode.c
> @@ -1146,7 +1146,12 @@ 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)
> +			/*
> +			 * GMT+-12 zones may have DST corrections so at least
> +			 * 13 hours difference is needed. Make the limit 24
> +			 * just in case someone invents something unusual.
> +			 */
> +			if (option < -24 * 60 || option > 24 * 60)
>  				return -EINVAL;
>  			opts->tz_set = 1;
>  			opts->time_offset = option;

-- 
OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-11-26 15:45 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-11-26 10:00 [PATCH] fat: Allow time_offset to be upto 24 hours Jan Kara
2015-11-26 15:45 ` OGAWA Hirofumi

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.