Skip to content

fs: JIFS entries return epoch 0 so dir shows 1970 dates #988

Done

Description

@LSantha

Summary

Every JIFS entry reports getLastModified() == 0, so dir shows 1970.01.01 00:00 for /jifs and everything under it, while the ramfs mount point /jnode shows the current boot time.

Steps to Reproduce

  1. Boot JNode (reproduced live on the running VirtualBox VM "JNodePR", and on a stock QEMU boot):
    qemu-system-x86_64 -cdrom all/build/cdroms/jnode-x86-lite.iso -m 1024 -nographic
  2. At the shell prompt run dir, then dir /jifs and dir /jnode.

Buggy Outcome

$ dir
                2026.11.27 21:17  [devices]
                1970.01.01 00:00  [jifs]
                2026.11.27 21:17  [jnode]

$ dir /jifs
                1970.01.01 00:00  [extended]
                1970.01.01 00:00  [lib]
                1970.01.01 00:00  [plugins]
                1970.01.01 00:00  [threads]
         1404B  1970.01.01 00:00  devices
           98B  1970.01.01 00:00  meminfo
           62B  1970.01.01 00:00  uptime
          146B  1970.01.01 00:00  version

$ dir /jnode
                2026.11.27 21:17  [.systemPrefs]
                2026.11.27 21:17  [home]
                2026.11.27 21:17  [lib]
                2026.11.27 21:17  [tmp]

The whole JIFS subtree (directories and files) stamps 1970.01.01 00:00.

Expected Outcome

JIFS entries report the time they were created (the boot time), like ramfs does, so dir /jifs shows a 2026 date matching the rest of the root listing. Concretely, FSEntry.getLastModified(), and the created/accessed equivalents, return the entry's construction time instead of 0.

JIFS is a synthesized read-only view (plugin list, devices, threads, uptime, version), so there is no real filesystem timestamp to report - but an entry has a creation instant, and a client asking for it should get that, not the epoch.

Root Cause

fs/src/fs/org/jnode/fs/jifs/JIFSDirectory.java:128 and fs/src/fs/org/jnode/fs/jifs/JIFSFile.java:136 both hardcode:

public long getLastModified() {
    return 0;
}

public void setLastModified(long lastModified) {
}

The setters are no-ops too, so a caller cannot even stamp an entry afterwards. The consumer is the FSEntry.getLastModified() API (fs/src/fs/org/jnode/fs/FSEntry.java:65), which is what the dir column prints.

For contrast, ramfs records real times: fs/src/fs/org/jnode/fs/ramfs/RAMDirectory.java:69 does
this.created = this.lastModified = this.lastAccessed = System.currentTimeMillis();, with a working getter at :104 and setter at :143 - which is why /jnode prints the boot time.

Test Coverage Basis

  • Existing module: fs/src/test/org/jnode/fs/jifs/files/JIFSFpluginJarTest.java covers a JIFS file's read behaviour; nothing asserts any timestamp.
  • Gap: no test touches getLastModified() on a JIFS entry, so a 0 return passes everything.
  • Proposed test: host-JVM test in fs/src/test/org/jnode/fs/jifs/ that builds a JIFSDirectory and a JIFSFile (the existing test already constructs JIFS objects directly), asserts getLastModified() > 0, that created/last-modified are equal to each other, and that they fall within a sane window around the construction call. Register it in fs/src/test/org/jnode/test/fs/filesystem/FSTestSuite.java if that is where jifs tests are wired.

Explicit constraints

  • Java 1.6 only, US-ASCII, JNode formatter.
  • Do not invent per-entry data (there is no underlying on-disk timestamp); the entry's own construction time is the value.
  • Keep setLastModified an intentional no-op ONLY if the entry is genuinely read-only - if a no-op stays, it must be documented, but the getters must stop returning 0.
  • No changes under core/src/native/x86/, and no config/plugin-list touch.

Environment

  • Commit: 8a7e894
  • Host JDK: 8 for builds (build needs 1.6/1.7/1.8); reproduced interactively, so host-independent
  • Build target: cd-x86-lite
  • Bitness: 32-bit
  • Run: VirtualBox VM "JNodePR" (running, headless), also reproducible in QEMU with the command above
  • ISO: all/build/cdroms/jnode-x86-lite.iso
  • Boot reached shell prompt: yes

Triage Addendum (auto, 2026-11-27)

  • Area / Kind: area/fs (Sub: JIFS) + kind/bug
  • Blast radius: L2 package (org.jnode.fs.jifs, JIFSDirectory + JIFSFile; no FSEntry API or plugin descriptor change)
  • Expected scope: fs/src/fs/org/jnode/fs/jifs/JIFSDirectory.java + JIFSFile.java: store construction time and return it from getLastModified; honor or document setLastModified; add a host-JVM test under fs/src/test/org/jnode/fs/jifs/ and register it in FSTestSuite. No-go: FSEntry signature, RAMFS, native ASM, config/plugin lists.
  • Test path: sh build.sh -f fs/build-tests.xml all-junit
  • Merge signal: human-review (kind/bug; behavior change in FS entry timestamps)
  • Gaps: none blocking. JIFS implements neither FSEntryCreated nor FSEntryLastAccessed, so created/accessed coverage requires adding those optional interfaces; setters are no-ops on a read-only view and must be documented if kept.
  • Full report: ## Triage comment below.

✅ Ticket Runner Status

Field Value
Phase DONE
Turn 0/7
Retries 0/3
PR #989
Review in progress no
Started 2026-11-27T19:55:52.211Z

Activity

  1. added
    kind/bug
    area/fs
    on Nov 27, 2026
  2. LSantha commented on Nov 27, 2026

    @LSantha
    OwnerAuthor

    /oc triage issue #988

    Triage run ONLY. Load the jnode-triage-issue skill and obey it. Output is exactly one ## Triage comment plus kind/area label edits. FORBIDDEN in this run: git checkout -b, git push, gh pr create, any branch, any PR.

  3. LSantha commented on Nov 27, 2026

    @LSantha
    OwnerAuthor

    Triage

    • Area: area/fs (Sub: JIFS)
    • Kind: kind/bug
    • Repro: Boot qemu-system-x86_64 -cdrom all/build/cdroms/jnode-x86-lite.iso -m 1024 -nographic, run dir / dir /jifs; actual 1970.01.01 00:00 vs expected boot-time date. Code pointers: JIFSDirectory.java:128 and JIFSFile.java:136 return 0.
    • Blast radius: L2 package (org.jnode.fs.jifs, 2 classes; no FSEntry API or plugin descriptor change)
    • Expected scope: JIFSDirectory.java + JIFSFile.java (~10-15 lines) store construction time and return it from getLastModified; honor or document setLastModified; add a host-JVM test under fs/src/test/org/jnode/fs/jifs/ and register it in FSTestSuite. No-go: FSEntry signature, RAMFS, native ASM, config/plugin lists.
    • Test path: sh build.sh -f fs/build-tests.xml all-junit
    • Merge signal: human-review (kind/bug; behavior change in FS entry timestamps)
    • Gaps: none blocking. Non-blocking: JIFS implements neither FSEntryCreated nor FSEntryLastAccessed, so created/accessed coverage requires adding those optional interfaces; setters are no-ops on a read-only view and must be documented if kept.
    • Suggested next: fix
    • Split proposal: none - focused
    • Labels applied: kind/bug, area/fs (already present, verified; no removals)

    github run

  4. LSantha commented on Nov 27, 2026

    @LSantha
    OwnerAuthor

    /oc Please proceed with this task.

  5. LSantha commented on Nov 27, 2026

    @LSantha
    OwnerAuthor

    Created PR #989

    github run

  6. added
    agent/done
    on Nov 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    agent/donearea/fskind/bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions