linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jan Kara <jack@suse.cz>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: Jan Kara <jack@suse.cz>,
	OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>,
	linux-fsdevel@vger.kernel.org
Subject: Re: [PATCH v2] fat: Provide option for setting timezone offset
Date: Thu, 15 Nov 2012 10:25:48 +0100	[thread overview]
Message-ID: <20121115092547.GC1394@quack.suse.cz> (raw)
In-Reply-To: <20121113171117.79ddefa7.akpm@linux-foundation.org>

On Tue 13-11-12 17:11:17, Andrew Morton wrote:
> On Wed, 14 Nov 2012 02:04:02 +0100
> Jan Kara <jack@suse.cz> wrote:
> 
> > On Tue 13-11-12 15:40:22, Andrew Morton wrote:
> > > On Mon, 12 Nov 2012 23:27:28 +0100
> > > Jan Kara <jack@suse.cz> 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.
> >   fat_remount() is actually:
> > 
> > static int fat_remount(struct super_block *sb, int *flags, char *data)
> > {
> >         struct msdos_sb_info *sbi = MSDOS_SB(sb);
> >         *flags |= MS_NODIRATIME | (sbi->options.isvfat ? 0 : MS_NOATIME);
> >         return 0;
> > }
> > 
> >   so all option changes are just ignored on remount.
> 
> Silently ignored?  That's a bit nasty.
  Yes. But people apparently don't tend to remount FAT...

> > > > @@ -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"?
> >   Right. I just copied it from other options without checking. Apparently
> > they are all wrong but logic in match_token() catches most of the faults so
> > noone noticed. So something like the attached patch?
> 
> How well tested was that patch? :)
  Umm, emm... not at all at that moment I'm afraid. Now I've tried and it
works as expected ;).

								Honza
-- 
Jan Kara <jack@suse.cz>
SUSE Labs, CR

      reply	other threads:[~2012-11-15  9:25 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-11-12 22:27 [PATCH v2] fat: Provide option for setting timezone offset Jan Kara
2012-11-13  2:23 ` OGAWA Hirofumi
2012-11-13 10:30   ` Jan Kara
2012-11-13 11:00     ` OGAWA Hirofumi
2012-11-13 23:40 ` Andrew Morton
2012-11-14  1:04   ` Jan Kara
2012-11-14  1:11     ` Andrew Morton
2012-11-15  9:25       ` Jan Kara [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20121115092547.GC1394@quack.suse.cz \
    --to=jack@suse.cz \
    --cc=akpm@linux-foundation.org \
    --cc=hirofumi@mail.parknet.co.jp \
    --cc=linux-fsdevel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).