From owner-freebsd-bugs@freebsd.org Sun Mar 5 11:14:08 2017 Return-Path: Delivered-To: freebsd-bugs@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2F5E2CF908A for ; Sun, 5 Mar 2017 11:14:08 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2001:1900:2254:206a::16:76]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1F5C8185B for ; Sun, 5 Mar 2017 11:14:08 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from bugs.freebsd.org ([127.0.1.118]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id v25BE7PT003415 for ; Sun, 5 Mar 2017 11:14:07 GMT (envelope-from bugzilla-noreply@freebsd.org) From: bugzilla-noreply@freebsd.org To: freebsd-bugs@FreeBSD.org Subject: [Bug 217560] FAT32 - Time stamp of file is one hour off Date: Sun, 05 Mar 2017 11:14:08 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: bin X-Bugzilla-Version: 11.0-RELEASE X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Only Me X-Bugzilla-Who: erik@nordstroem.no X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: freebsd-bugs@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version rep_platform op_sys bug_status bug_severity priority component assigned_to reporter Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Mar 2017 11:14:08 -0000 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D217560 Bug ID: 217560 Summary: FAT32 - Time stamp of file is one hour off Product: Base System Version: 11.0-RELEASE Hardware: amd64 OS: Any Status: New Severity: Affects Only Me Priority: --- Component: bin Assignee: freebsd-bugs@FreeBSD.org Reporter: erik@nordstroem.no I live in time zone GMT + 1. While trying something for another issue (#217440), I created a file on a F= AT32 formatted USB stick using my Sony PlayStation 4. The PlayStation 4 is showing the correct local time and I have verified tha= t it has its time zone configured correctly as "UTC+01:00 Oslo". My laptop is showing the correct local time and I have the TZ env variable = set correctly as "Europe/Oslo". I took a screenshot in the game Alien: Isolation on the PS4 and transferred= it to my USB stick. I mounted the USB stick with # mount_msdosfs -L en_US.UTF-8 /dev/da1s1 /mnt/ as per the discussion in issue #217440 but when I list the directory contents, the time stamp of the files is off = by one hour into the future compared to actual time when the file was created = as shown below. Note also that the file name itself contains the correct time = when the file was created. I transferred the file to my memory stick within minu= tes of having taken the screenshot. I don't have a windows system to create files from at the moment so I can't verify whether this is a problem with FreeBSD handling of FAT32 or if the incorrect timestamp was caused by the PS4. I have attached an image of a minimal FAT32 partition which contains the directory structure and the screenshot which was written to the USB stick by the PS4. The USB stick was prepared with # umount /dev/da1s1 $ gpart delete -i 1 /dev/da1 $ gpart destroy /dev/da1 # dd if=3D/dev/zero of=3D/dev/da1 bs=3D16m $ gpart create -s mbr /dev/da1 $ gpart add -t fat32 -s 4g -i 1 /dev/da1 # newfs_msdos -F32 /dev/da1s1 # sync $ gpart show da1 =3D> 63 30277569 da1 MBR (14G) 63 8161 - free - (4.0M) 8224 8388608 1 fat32 (4.0G) 8396832 21880800 - free - (10G) Unplugged the USB stick, put it in the PS4, took a screenshot and transferr= ed it to the USB stick. Put it back in the computer and made a minimal image of the FAT32 partition; # umount /dev/da1s1 $ dd if=3D/dev/da1s1 of=3Dusbstick.img conv=3Dsparse bs=3D16m count=3D1 $ hd usbstick.img > tmp.img $ xxd -r tmp.img > usbstick.img $ rm tmp.img $ ls -hal usbstick.img -rw-r--r-- 1 erikn erikn 1.5M Mar 5 12:10 usbstick.img To mount the image; # mdconfig -a -t vnode -f usbstick.img -u 0 # mount_msdosfs -L en_US.UTF-8 /dev/md0 /mnt/ Here we have the file with the mismatching timestamp. $ ls -al /mnt/PS4/SHARE/Screenshots/Alien_\ Isolation=E2=84=A2/ total 768 drwxrwxrwx 1 root wheel 32768 Mar 5 13:07 ./ drwxrwxrwx 1 root wheel 32768 Mar 5 13:07 ../ -rwxrwxrwx 1 root wheel 305981 Mar 5 13:07 Alien_ Isolation=E2=84=A2_20170305120653.jpg* Unmount image; # umount /dev/md0 # mdconfig -d -u 0 --=20 You are receiving this mail because: You are the assignee for the bug.=