UTC timestamp option for FAT filesystems
Moin moin!
May I just add a resounding YES-YES-YES to the message which was posted earlier today as
Message-ID: <>
oh b*gger, that doesn't help when snarfing from a web archive (voluntary use as a non-subscirber of a webmail interface prevents me from including a References: header without more effort than I care to do now, not that this would help)
I was actually just about to post an almost identical message today to clean out my repository of hacks, with almost the same justifications.
In addition, may I request that not only the option -o utc,...' be accepted, but also as an alternate, the string gmt', not because it's more accurate (it isn't) but because it seems to be tradition to use GMT+/-xxxx in lots of places.
Another justification which wasn't mentioned, but which I would put forth, is that last time I checked, the BSDen were using UTC as their MSDOS timestamp base, so such an option would make it easier to exchange data between BSD and Linux machines with a normal USB stick or flash card. And I was doing that a year or three ago when I hacked my hack.
I'll have to do a line-by-line comparison with my hacked code (last applied to 2.6.24-ish) to make sure I don't have any differences, but in order to allow users the option to specify the seeped-in-tradition- especially-for-us-old-f*rts `gmt', here's the trivial-to-correct section of code -- may well be different than in the patch since I didn't save it before being kicked offline:
in fs/fat/inode.c
880 {Opt_debug, "debug"},
881 {Opt_immutable, "sys_immutable"},
882 /* XXX HACK */
883 {Opt_utc, "utc"},
884 {Opt_utc, "gmt"},
885 {Opt_obsolate, "conv=binary"},
886 {Opt_obsolate, "conv=text"},(I use `-o utc' myself but would prefer to be flexible to alternate uses) I notice this most when I fail to include the needed patches when updating kernel
thanks
barry bouwsma
Quoted 1 line · barry bouwsma
May I just add a resounding YES-YES-YES...
Thanks for your feedback and support!
Quoted 4 lines
In addition, may I request that not only the option
-o utc,...' be accepted, but also as an alternate, the stringgmt', not because it's more accurate (it isn't) but because it seems to be tradition to use GMT+/-xxxx in lots of places.
I do understand what you are saying, however I would suggest not making "gmt" a synonym for the following reasons:
1) Better to keep the options simple and less cluttered
2) GMT is not strictly the same as UTC (according to Wikipedia, it usually is used to mean the same thing, but it can also mean "UT1" (or the less exact "UT"), which is not exactly equal to UTC). So UTC is the more precise term.
Quoted 6 lines
Another justification which wasn't mentioned, but which I would put forth, is that last time I checked, the BSDen were using UTC as their MSDOS timestamp base, so such an option would make it easier to exchange data between BSD and Linux machines with a normal USB stick or flash card. And I was doing that a year or three ago when I hacked my hack.
Ah, then that is, indeed, another good reason.
-Thanks, Joe
Quoted 8 lines · Joe Peterson
Quoted 1 line
In addition, may I request that not only the option
`-o utc,...' be
Quoted 1 line
accepted, but also as an alternate, the string
`gmt', not because it's
I do understand what you are saying, however I would suggest not making
"gmt" a synonym for the following reasons:
Fair enough, I won't press the matter. I'm just one of those old f*rts who still remembers the american WWV talking clock and how unnerving it was after years to be hearing ``Coordinated Universal Time'' so I deserve to wither and drop off the vine. Also, in case of all my consumer equipment, I think 100% of it refers to GMT+2 (in my present time zone), so I wonder if in different languages, there's a preference for casual use of the phrase GMT (a quick look in my dictionary shows an entry for GMT, nothing for UTC, but then, it has no entry for `operating system' or its translated equivalent.
Wait, I said I wouldn't press the matter.
Anyway, I'm doing a quick diff against my code. (Mine also contains no documentation either, which is why I didn't post my hacks a couple days earlier.) I see some things that are likely irrelevant; however, here's something missing -- WARNING, line numbers are based on hacked 2.6.24-ish code; later kernels I've built so far have been without these hacks -- PLEASE REVIEW AND IF APPLICABLE, APPLY BY HAND
mnt/usr/local/src/linux-2.6.24/fs/fat/inode.c 2008-04-13 07:09:10.000000000 +0200 renamed from mnt/usr/local/src/linux-2.6.24/fs/fat/inode.c-DIST 2008-01-30 10:59:19.000000000 +0100 +3 -0
@@ -826,6 +829,9 @@ static int fat_show_options(struct seq_f seq_puts(m, ",showexec"); if (opts->sys_immutable) seq_puts(m, ",sys_immutable"); +/* XXX HACK */ + if (opts->utc) + seq_puts(m, ",utc"); if (!isvfat) { if (opts->dotsOK) seq_puts(m, ",dotsOK=yes");
The above will result in something like/dev/sdc1 on /opt type vfat (ro,utc,dmask=222,fmask=133,shortname=win95) (sorry if your code has this and I overlooked it)
Apart from this, if your diffs compile and work, it looks like only trivial coding style differences between ours (thus yours are better).
thanks,
barry bouwsma
Quoted 6 lines · barry bouwsma
I think 100% of it refers to GMT+2
(in my present time zone), so I wonder if in different languages, there's a preference for casual use of the phrase GMT (a quick look in my dictionary shows an entry for GMT, nothing for UTC, but then, it has no entry for `operating system' or its translated equivalent.
Well, your question certainly prompted me to go and read up on it again.
In my work (unmanned space missions - solar system stuff), we deal with
many representations of time, and so I am used to being anal about it. For example, there is GMT, UTC, TDT, ET, etc. They all differ ever so slightly.
mnt/usr/local/src/linux-2.6.24/fs/fat/inode.c 2008-04-13 07:09:10.000000000 +0200 static int fat_show_options(struct seq_f · line 837
Quoted 13 lines
mnt/usr/local/src/linux-2.6.24/fs/fat/inode.c 2008-04-13 07:09:10.000000000 +0200 renamed from mnt/usr/local/src/linux-2.6.24/fs/fat/inode.c-DIST 2008-01-30 10:59:19.000000000 +0100 +3
-0@@ -826,6 +829,9 @@ static int fat_show_options(struct seq_f seq_puts(m, ",showexec"); if (opts->sys_immutable) seq_puts(m, ",sys_immutable"); +/* XXX HACK */ + if (opts->utc) + seq_puts(m, ",utc"); if (!isvfat) { if (opts->dotsOK) seq_puts(m, ",dotsOK=yes");
Indeed! Thanks, I'll put this in the patch. The above is actually not needed for the mount command or /etc/mtab, but it *is* used for, e.g., /proc/mounts.
-Joe
Quoted 6 lines · Joe Peterson
Quoted 3 lines
(in my present time zone), so I wonder if in different languages, there's a preference for casual use of the phrase GMT (a quick look in my dictionary shows an entry for GMT, nothing for UTC,
Well, your question certainly prompted me to go and read up on it again.
Oops, didn't mean to... Very sorry.
Thinking more about my hack (dates back to at least Aug.2005, if not before -- can't find older code I ran), originally I wanted to be able to allow the user to specify the timezone/ offset -- for example, if you were, hypothetically, to visit me where I am now, and your camera had been set to your local time, there's no way I'd easily be seeing the correct times.
Fortunately, I began to think better of it after realizing how much work and bother it would be, and decided that if my friends were to be giving me USB sticks and whatnot to mount that weren't with UTC timestamps or in my local timezone, then they weren't going to remain my friends for much longer. Unless they meant to give me those sticks without expecting them back, in which case I'd compromise and let them remain my friends just to see what else they might have up their sleeves to give me.
Quoted 4 lines
In my work (unmanned space missions - solar system stuff), we deal with many representations of time, and so I am used to being anal about it. For example, there is GMT, UTC, TDT, ET, etc. They all differ ever so slightly.
Agreed. And technically UTC is correct. And while for you, the difference between UTC and GMT by now would be the difference between a probe floating gently down to the surface of the sun (oops, make that some planet) or embedding itself a metre or two under the surface, for too many casual users, GMT and UTC are interchangeable. In the case of my camera, technically it's drifted to something that's neither UTC or GMT. If this notebook doesn't get it's NTP sync from my other machine's radio clock, it rapidly becomes far removed from either.
Unfortunately, even the Linux filesystem codes are either careless about referring to GMT (I too am guilty, rereading the comment to explain my hack which I wrote, before I decided to add `gmt' as an inaccurate alternative), or are indeed accurate and some filesystems are in fact based on GMT, not UTC -- I don't wish to know. I see some 35-odd references to GMT in the fs/*/* files, try a grep just for, well, to see whether people are as careful with UTC/GMT as they should be.
And it's even worse in the next timezone over from me -- I've seen websites referring to broadcasts in GMT -- no, they are in *local* *British* time, whether summer or winter time. Arrgh. NURSE!
As it's a new option, no need to cater to (or encourage) inaccurate usage. I'd rather advocate and see compatibility in userspace utilities for my BSD-afflicted brain, like mount -u' == mount -o remount -o rw' and patch -C' == patch --dry-run', but that's off-topic, as is this whole discussion. Blacklist this e-mail, please?
Anyway, thanks for trying to get this patch (probably 3 1/2 years old by me, if I find my oldest source) into the kernel, and I'll shut up now.
barry bouwsma