Ticket #4225 (closed defect: invalid)

Opened 3 years ago

Last modified 3 years ago

FISH to OpenWrt, file modification time randomized

Reported by: opty Owned by:
Priority: major Milestone:
Component: mc-vfs Version: 4.8.26
Keywords: Cc:
Blocked By: Blocking:
Branch state: no branch Votes for changeset:

Description

When copying normal files using FISH to a router using OpenWrt? 19.07.7, it doesn't preserve mtime (modification time) and even uses seemingly random mtime, possibly cached somewhere?

Change History

comment:1 Changed 3 years ago by zaytsev

Is it only OpenWRT or FISH in general?

comment:2 Changed 3 years ago by opty

Only OpenWrt?. I use FISH often so I'd most probably notice.

comment:3 Changed 3 years ago by andrew_b

Probably related topic: touch command with option -d.

comment:4 Changed 3 years ago by opty

So FISH uses touch in /usr/libexec/mc/fish/utime to preserve the timestamps.

touch -d works*:

root@tplink:~# date && touch -m -a -d '2022-02-22 00:00' /tmp/testfile && ls -l /tmp/testfile && ls -lu /tmp/testfile && ls -lc /tmp/testfile
Sun Apr  4 23:18:30 CEST 2021
-rw-r--r--    1 root     root             0 Feb 22  2022 /tmp/testfile
-rw-r--r--    1 root     root             0 Feb 22  2022 /tmp/testfile
-rw-r--r--    1 root     root             0 Apr  4 23:18 /tmp/testfile

*Although touch pretends that it doesn't support atime (access time):

root@tplink:~# touch
BusyBox v1.30.1 () multi-call binary.

Usage: touch [-c] [-d DATE] [-t DATE] [-r FILE] FILE...

Update the last-modified date on the given FILE[s]

        -c      Don't create files
        -d DT   Date/time to use
        -t DT   Date/time to use
        -r FILE Use FILE's date/time

comment:5 Changed 3 years ago by opty

Got it! BusyBox?'s touch updates both mtime and atime with the same value so when FISH tries to preserve atime after mtime, it actually updates already preserved mtime with atime.

I guess this will get closed as wontfix?

comment:6 Changed 3 years ago by opty

Not sure if BusyBox?'s touch would get updating the times separately implemented as that would make it bigger but what about modifying FISH to preserve atime before mtime so on OpenWrt? it could preserve at least mtime? OpenWrt? uses noatime for / anyway and other systems using coreutils' touch shouldn't even notice any difference.

comment:7 Changed 3 years ago by opty

Fortunately, too pesimistic me, WIP now: touch: adding -a and -m

comment:8 Changed 3 years ago by andrew_b

  • Status changed from new to closed
  • Resolution set to invalid
  • Milestone Future Releases deleted

Thanks for the investigation!

Note: See TracTickets for help on using tickets.