From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrew Morton Subject: Re: [PATCH v2] fat: Provide option for setting timezone offset Date: Tue, 13 Nov 2012 15:40:22 -0800 Message-ID: <20121113154022.4bd68ecd.akpm@linux-foundation.org> References: <1352759248-9447-1-git-send-email-jack@suse.cz> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: OGAWA Hirofumi , linux-fsdevel@vger.kernel.org To: Jan Kara Return-path: Received: from mail.linuxfoundation.org ([140.211.169.12]:56365 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755043Ab2KMXkX (ORCPT ); Tue, 13 Nov 2012 18:40:23 -0500 In-Reply-To: <1352759248-9447-1-git-send-email-jack@suse.cz> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: On Mon, 12 Nov 2012 23:27:28 +0100 Jan Kara wrote: > So far FAT either offsets time stamps by sys_tz.minuteswest or leaves them > as they are (when tz=UTC mount option is used). However in some cases it > is useful if one can specify time stamp offset on his own (e.g. when time > zone of the camera connected is different from time zone of the computer, > or when HW clock is in UTC and thus sys_tz.minuteswest == 0). > > So provide a mount option time_offset= which allows user to specify offset in > minutes that should be applied to time stamps on the filesystem. Did you test "mount -o remount"? I suspect it won't work correctly - inodes which are already in cache at remount time will not reflect the updated offset? If so, a quick fix would be to disallow the ability to set time_offset via remount (dunno how?) and document it. > > ... > > @@ -1005,8 +1011,17 @@ static int parse_options(struct super_block *sb, char *options, int is_vfat, > case Opt_flush: > opts->flush = 1; > break; > + case Opt_time_offset: > + if (match_int(&args[0], &option)) > + return 0; > + if (option < -12 * 60 || option > 12 * 60) > + return 0; Is it correct to return 0 here? 0 means "success"? > + opts->tz_set = 1; > + opts->time_offset = option; > + break; > case Opt_tz_utc: > - opts->tz_utc = 1; > + opts->tz_set = 1; > + opts->time_offset = 0; > break; > case Opt_err_cont: > opts->errors = FAT_ERRORS_CONT; > > ... >