I think I found the bug in the linux 5.4, but I have no idea whether or how to 
submit a patch...
The handling of exfat changes completely in the following (but not LTS) 
versions.

In the file drivers/staging/exfat/exfat_super.c, in lines 60-

static void exfat_time_fat2unix(struct timespec64 *ts, struct date_time_t *tp)
{
        ts->tv_sec = mktime64(tp->Year + 1980, tp->Month + 1, tp->Day,   // 
shouldn't it be tp->Month, tp->Day .... ?????!!!
                              tp->Hour, tp->Minute, tp->Second);

        ts->tv_nsec = tp->MilliSecond * NSEC_PER_MSEC;
}

static void exfat_time_unix2fat(struct timespec64 *ts, struct date_time_t *tp)
{
        time64_t second = ts->tv_sec;
        struct tm tm;

        time64_to_tm(second, 0, &tm);
[...]
        tp->MilliSecond = ts->tv_nsec / NSEC_PER_MSEC;
        tp->Second      = tm.tm_sec;
        tp->Minute      = tm.tm_min;
        tp->Hour        = tm.tm_hour;
        tp->Day         = tm.tm_mday;
        tp->Month       = tm.tm_mon + 1;
        tp->Year        = tm.tm_year + 1900 - 1980;
}

The meaning of the field Month in struct date_time_t has no
documentation in the header exfat.h, but the function unix2fat produces
a month from 1-12 in date_time_t by adding 1 to the result of
time64_to_tm.

-- 
You received this bug notification because you are a member of Ubuntu
Touch seeded packages, which is subscribed to ubuntu-meta in Ubuntu.
https://bugs.launchpad.net/bugs/1872504

Title:
  date modified is wrong for files on an exfat formatted drive

Status in ubuntu-meta package in Ubuntu:
  Confirmed

Bug description:
  When using exfat formatted drives (e.g. my camera card) with focal
  fossa any access causes the date modified to be set, even when it
  would not normally be set, and it is set a month into the future.

  Installing exfat-fuse and exfat-utils results in the correct
  behaviour.

  ProblemType: Bug
  DistroRelease: Ubuntu 20.04
  Package: ubuntu-release-upgrader-core 1:20.04.18
  ProcVersionSignature: Ubuntu 5.4.0-21.25-generic 5.4.27
  Uname: Linux 5.4.0-21-generic x86_64
  ApportVersion: 2.20.11-0ubuntu26
  Architecture: amd64
  CasperMD5CheckResult: skip
  CrashDB: ubuntu
  CurrentDesktop: ubuntu:GNOME
  Date: Mon Apr 13 17:27:30 2020
  InstallationDate: Installed on 2020-04-12 (1 days ago)
  InstallationMedia: Ubuntu 20.04 LTS "Focal Fossa" - Beta amd64 (20200409)
  PackageArchitecture: all
  ProcEnviron:
   LANGUAGE=en_GB:en
   PATH=(custom, no user)
   XDG_RUNTIME_DIR=<set>
   LANG=en_GB.UTF-8
   SHELL=/bin/bash
  SourcePackage: ubuntu-release-upgrader
  Symptom: dist-upgrade
  UpgradeStatus: No upgrade log present (probably fresh install)

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/ubuntu-meta/+bug/1872504/+subscriptions

-- 
Mailing list: https://launchpad.net/~touch-packages
Post to     : touch-packages@lists.launchpad.net
Unsubscribe : https://launchpad.net/~touch-packages
More help   : https://help.launchpad.net/ListHelp

Reply via email to