Discussion:
[edk2] [ShellPkg] I think there is an issue in ls.
Andrew Fish
2015-06-11 01:26:22 UTC
Permalink
Dear ShellPkg maintainer,

I think there is an issue with the ls command. It does not use the TImeZone, so it seems it is hard coded to assume that a filesystem stores time like FAT, in local time. The FAT driver always returns EFI_UNSPECIFIED_TIMEZONE, which implies the values are local time. But what if a filesystem is storing time in UTC (EFI_TIME.TimeZone == 0)? it seems the current path in the shell assumes EFI_UNSPECIFIED_TIMEZONE (thus all time is local time). I don’t think this follows the UEFI spec. I think the correct algorithm is:

if FileSystemTime.TimeZone == EFI_UNSPECIFIED_TIMEZONE
// This is the current path in the code
Assume time is local time, and print it out
else:
// This is the missing path.
Adjust the FileSystemTime.TimeZone for the System.TimeZone (and System.Daylight), thus display the time in local time.

Thanks,

Andrew Fish


------------------------------------------------------------------------------
Carsey, Jaben
2015-06-11 01:33:51 UTC
Permalink
Andrew,

I agree, that looks like an issue. Can you submit a patch with this fixed? I will put this on the list of issues.

-Jaben
-----Original Message-----
Sent: Wednesday, June 10, 2015 6:26 PM
Subject: [edk2] [ShellPkg] I think there is an issue in ls.
Importance: High
Dear ShellPkg maintainer,
I think there is an issue with the ls command. It does not use the TImeZone,
so it seems it is hard coded to assume that a filesystem stores time like FAT, in
local time. The FAT driver always returns EFI_UNSPECIFIED_TIMEZONE, which
implies the values are local time. But what if a filesystem is storing time in UTC
(EFI_TIME.TimeZone == 0)? it seems the current path in the shell assumes
EFI_UNSPECIFIED_TIMEZONE (thus all time is local time). I don’t think this
if FileSystemTime.TimeZone == EFI_UNSPECIFIED_TIMEZONE
// This is the current path in the code
Assume time is local time, and print it out
// This is the missing path.
Adjust the FileSystemTime.TimeZone for the System.TimeZone (and
System.Daylight), thus display the time in local time.
Thanks,
Andrew Fish
------------------------------------------------------------------------------
_______________________________________________
edk2-devel mailing list
https://lists.sourceforge.net/lists/listinfo/edk2-devel
------------------------------------------------------------------------------
Andrew Fish
2015-06-11 01:38:58 UTC
Permalink
Post by Carsey, Jaben
Andrew,
I agree, that looks like an issue. Can you submit a patch with this fixed?
Sorry don’t have time right now.
Post by Carsey, Jaben
I will put this on the list of issues.
Thanks, I hit this issue in another location and look to see what the shell did. Since the shell seemed to be doing the wrong thing I decided to at least report it to the mailing list.

I’m guessing more modern filesystems probably store the time in UTC?

Thanks,

Andrew Fish
Post by Carsey, Jaben
-Jaben
-----Original Message-----
Sent: Wednesday, June 10, 2015 6:26 PM
Subject: [edk2] [ShellPkg] I think there is an issue in ls.
Importance: High
Dear ShellPkg maintainer,
I think there is an issue with the ls command. It does not use the TImeZone,
so it seems it is hard coded to assume that a filesystem stores time like FAT, in
local time. The FAT driver always returns EFI_UNSPECIFIED_TIMEZONE, which
implies the values are local time. But what if a filesystem is storing time in UTC
(EFI_TIME.TimeZone == 0)? it seems the current path in the shell assumes
EFI_UNSPECIFIED_TIMEZONE (thus all time is local time). I don’t think this
if FileSystemTime.TimeZone == EFI_UNSPECIFIED_TIMEZONE
// This is the current path in the code
Assume time is local time, and print it out
// This is the missing path.
Adjust the FileSystemTime.TimeZone for the System.TimeZone (and
System.Daylight), thus display the time in local time.
Thanks,
Andrew Fish
------------------------------------------------------------------------------
_______________________________________________
edk2-devel mailing list
https://lists.sourceforge.net/lists/listinfo/edk2-devel
------------------------------------------------------------------------------
_______________________________________________
edk2-devel mailing list
https://lists.sourceforge.net/lists/listinfo/edk2-devel
------------------------------------------------------------------------------
Blibbet
2015-06-11 02:04:56 UTC
Permalink
Post by Andrew Fish
I’m guessing more modern filesystems probably store the time in UTC?
https://msdn.microsoft.com/en-us/library/windows/desktop/ms724290%28v=vs.85%29.aspx

says FAT uses local time, NTFS uses UTC, and CDFS (CDs/DVDs) use local time.

I haven't found info on ZFS, or Ext2, or Apple's HFS+, nor the other
half dozen that're actively used...

Unfortunately the timezone epoc column is missing from the Wikipedia page...

http://en.wikipedia.org/wiki/Comparison_of_file_systems

Is there some existing file system perf/diagnostic tool that'd help dump
out this info, to help augment their docs/specs?



------------------------------------------------------------------------------
Continue reading on narkive:
Loading...