ufatfs

Timeline
Login

Timeline

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

50 most recent check-ins

2026-11-20
02:14
ufatfs version 0.1.0 leaf check-in: fcd3475e1b user: chungy tags: release, trunk, version-0.1.0
01:57
Get the Makefile targets for documentation ready. closed check-in: b931653d53 user: chungy tags: documentation
01:21
Get a good start on the Texinfo documentation done. There’s more that can be added, but this’ll be a good first draft. check-in: ecce765adc user: chungy tags: documentation
2026-11-18
23:44
Begin work on making ufatfs documentation, starting with manpages. check-in: 43ce06af84 user: chungy tags: documentation
00:02
Make some floppy-influenced options for smaller SQLite profiles, making floppy disks a viable option for ufatfs, even down to 360 KiB disks. check-in: 91b27a32aa user: chungy tags: trunk
2026-11-17
23:47
Floppy-sized volumes: an optional small database layout (mkfs.ufatfs -s), a rollback journal option (-j rollback), a space reserve for a full volume, and database rebuilds in fsck.ufatfs.

New options keys page_size, auto_vacuum, journal_mode, wal_autocheckpoint and journal_size_limit; absent keys mean the old defaults, so existing volumes are unchanged. The daemon applies them on every conne... closed check-in: cfd92cadab user: grok tags: floppy-optimization

22:36
Support non-UTF8 mounts and case-insensitive mounts; both are mkfs options only and cannot be switched afterward. check-in: f1548d336a user: chungy tags: trunk
22:28
Mount tests independent of the shell: bash (as /bin/sh) failed the case-variant O_EXCL test, since its noclobber checks with stat() and never opens with O_EXCL.
  • new helper tests/fuse/fsop: open(2) with exact flags and link(2), printing ok or the strerror
  • test_mount_names.sh: O_CREAT|O_EXCL and O_CREAT on a case variant, and EILSEQ on a UTF-8 vo...
closed check-in: 546baa9693 user: grok tags: name-options
21:02
Name options: case-insensitive volumes (case_sensitive = 0) and byte names (utf8_enforcing = 0), both set by mkfs.ufatfs (-i, -b) and fixed for the life of the volume.

Case-insensitive: lookups compare ufatfs_name_key() (the exFAT up-case key, as for host names), and a unique index idx_name_folded on (parent_id, key) keeps siblings apart. Entries keep their spelling.

  • create, mkdir, mkn...
check-in: 38ce7a51a4 user: grok tags: name-options
20:26
Alter ufatfs's version to print libfuse and features (currently statx or none) built in. Repairs one of the unit tests in the process. check-in: ca9cbe63e4 user: chungy tags: trunk
20:17
Fix order of the license line in test_fsck.sh check-in: 45de78e04e user: chungy tags: trunk
20:10
Rename ufatfs.dbg to debugfs.ufatfs: It both matches some other utilities and makes tab-complete nicer. check-in: c3141481df user: chungy tags: trunk
19:49
Add mkversion to ignore-glob check-in: ccaf4e24c6 user: chungy tags: trunk
18:02
Add COPYRIGHT license and a self-reporting version on all the programs. check-in: 785ffa9944 user: chungy tags: trunk
09:36
Try to keep low-level filesystem objects with similar timestamps and write/exec modes as the ufatfs view. check-in: 0da51e6d49 user: chungy tags: trunk
09:31
Keep host permission bits and times in line with the database

The host objects now follow the logical mode and times as far as the host can, best effort and never an error (new src/hostsync.c):

  • Regular files get host write permission if any write bit (0222) is set in the mode and lose it otherwise, the same for execute (0111), as umsdos did: plain chmod +w, -w, +x, -x under the daemon's umask, with a fallback for the all-or-...
closed check-in: 933d654a7d user: grok tags: host-sync
08:31
Fix tests with different umasks check-in: 970a1d3d7c user: chungy tags: trunk
08:25
Tests: run under umask 022 whatever the caller's, and check the umask through the mount.

On Debian (umask 002) test_mount_perm.sh failed: a directory made in a setgid directory came out 2775 where the test wanted 2755. 2775 is correct for umask 002; the test assumed 022.

  • tests/testlib.sh, sourced by every test script, sets umask 022.
  • tests/unit/test.h sets it from a constructor, so the C tests run alone are covered too.
  • test_mount_rw...
closed check-in: 3bc0e72cbd user: grok tags: testdir
08:15
Support running tests on specific directories, especially to test capabilities on vfat and exfat. check-in: 54919ae3c4 user: chungy tags: trunk
08:09
test_db: bound the root's creation time with CLOCK_REALTIME, not time(2).

A fresh-clone make check failed once at test_db.c:89. glibc's time() reads a coarse clock that can lag the CLOCK_REALTIME the database stamps by up to a tick, so a second boundary between the two made the stamp look like it came from the future. check-in: 6c4cfe95c4 user: grok tags: testdir

08:06
Never open and close the database or -shm while connected; serialize connection closes.

Found with the fake FAT host. Closing any descriptor of a file drops all of the process's POSIX locks on it, SQLite's included. Setting the Hidden attribute did exactly that on .ufatfs.db: in a mount, and in fsck, while their connections were open. Another process could then take over the database or its shared memory. Hiding -shm the same way made the daemon die of SIGBUS when <cod... check-in: d5d0df8115 user: grok tags: testdir

08:06
FAT hosts: test fixtures carry the Hidden attribute; a fake FAT host for make check.

On real vfat and exfat drives test_fsck.sh failed four checks with exit codes off by the Hidden repairs: the test_fs --populate fixture never set the attribute, and every fresh copy (cp -R) lost it, so the default --hidden check found and fixed it in tests about other things. The fixtures now look like what mkfs and a mount leave, so the default b... check-in: 60a4f4bce2 user: grok tags: testdir

07:37
Tests on FAT-like hosts: fixes found on exFAT and vfat FUSE hosts.

Ran the whole suite with TESTDIR on fuse-exfat (case-insensitive, no permission bits, no :) and on fusefatfs (vfat).

  • testlib.sh: host_can_name probes in a subshell; a failed redirection on : ended test_fsck.sh silently.
  • test_fs: directory size and file blocks are compared with the host's own values (fusefatfs reports 0), not req...
check-in: 35982fcc95 user: grok tags: testdir
07:37
Append writes: never ask the host to append at an offset past its end.

A real exFAT run failed test_fs_write: on a new O_APPEND file, "a" written at offset 100 and "b" at offset 0 gave "a", 99 zero bytes and "b" instead of "ab". Linux exfat (since 6.8, until the 2026 patch "exfat: advance valid_size to EOF for append writes") reads the write position before generic_write_checks() moves it to EOF. It then zero-fills the file up to the stale offset, so the f... check-in: 1986fca2fe user: grok tags: testdir

07:24
make check TESTDIR=DIR: run the tests on a given directory, e.g. a real VFAT/exFAT drive.

All test volumes, mount points and temporary files now go under TESTDIR (the make parameter, else the environment, else TMPDIR, else /tmp, as before). It must be an existing, writable directory; make check and each test say so otherwise. Every test prints the directory and its host filesystem type (statfs f_type).

  • New tests/testlib.sh f...
check-in: 94fded6202 user: grok tags: testdir
07:09
Make tests never prompt for user interaction. check-in: cbdaf2bbe3 user: chungy tags: trunk
07:09
mount recovery keeps lefovers, and fix the access(2) checks so find -type f -executable works check-in: e3c11bba15 user: chungy tags: trunk
07:07
Make a /.ufatfs/lost+found for recovered objects, and set the FAT hidden attribte for dot-files. check-in: ff7aa1bf67 user: chungy tags: trunk
07:06
Add a fsck program and allow overmounting through a single directory parameter check-in: 0434c04f15 user: chungy tags: trunk
07:01
Tests never prompt, even when make check runs on a terminal.

On a terminal, rm -r in the -o permissions part of test_mount_perm.sh asked "remove write-protected regular file?" for the files the caller may not write there (mode 0000, 0010, and someone else's 0700): rm asks whenever faccessat(W_OK) fails and stdin is a terminal. Without an answer the files stayed and a later check failed.

  • Every test script now starts with <co...
closed check-in: 11058ae92b user: grok tags: test-noninteractive
06:52
access(2) in fakeroot mode: root-like answers, so find -executable and test -x work.

Without default_permissions the kernel asks the daemon for access(2), faccessat(2) and chdir (FUSE_ACCESS); ufatfs had no handler, so the kernel granted everything and every file looked executable. The new ufatfs_fs_access() (decision in ufatfs_access_check()) answers as for root:

  • F_OK, R_OK and W_OK a...
closed check-in: 7a762e84f9 user: grok tags: lostfound-followups
06:52
lost+found follow-ups: mount recovery keeps leftovers, cycles under -p, Hidden check by default.

Mount recovery never deletes leftovers. The new src/lostfound.c (and .h), shared by the daemon and fsck, opens .ufatfs/lost+found (created on demand), moves an object there as #TAG, or #TAG.N when that name or its note is taken, and writes the note NAME.txt: where it came from, why, and what the database knows abou... check-in: 477b34ca04 user: grok tags: lostfound-followups

06:06
Host-only lost+found for fsck, and the FAT Hidden attribute.

lost+found. fsck no longer creates a logical /lost+found. What it takes out of the database goes to the host directory /.ufatfs/lost+found, created on demand (mkfs creates nothing extra):

  • a directory cycle (needs -y) or a directory without an entry (safe): the whole tree leaves the database in one transaction; then its host directory, if found, moves to #INODE, and sto...
closed check-in: 60c3a2ac9d user: grok tags: hidden-lostfound
05:52
Permission modes by who mounts, and mounting over the volume.

Permissions:

  • Mounted by root, the kernel checks the stored owners and modes (default_permissions), as before.
  • Mounted by anyone else, ufatfs behaves like fuse2fs -o fakeroot: no default_permissions, so the mounting user passes every check and may chmod, chown and utimens anything to any value. Stored owners and modes are kept and reported as they are; new files belong to the caller. ...
closed check-in: 22ecc63087 user: grok tags: fakeroot-overmount
05:52
Open the database through the volume descriptor, not its path name.

Per-thread connections are opened lazily, after the mount. They now use /proc/self/fd/N/.ufatfs.db (N the volume's root descriptor), which the kernel resolves to the host directory itself even when the volume's path leads into a FUSE mount by then. This prepares mounting over the volume.

  • src/db.c registers an ufatfs VFS: the default unix VFS, except that an absolute name is used as...
check-in: a2e202f913 user: grok tags: fakeroot-overmount
05:39
Add fsck.ufatfs: offline check and repair of a volume.

Modes as e2fsck: -n (default without a terminal), -p/-a preen (safe fixes), -y, and a prompt on a terminal (y/n/all/quit); -f, -v, -u/-g for adopted objects, --strays=adopt|delete|ignore. Exit codes as fsck(8): 0, 1, 4, 8, 16, 32. A mounted (locked) volume is refused.

Checks, each with a fix:

  • database in...
closed check-in: a6f40143ea user: grok tags: fsck
05:39
Library hooks for an offline checker.
  • UFATFS_FS_NORECOVER: open a volume without the mount-time recovery (staged objects, orphans), so a checker can report the state before it changes anything.
  • ufatfs_fs_db(), ufatfs_fs_drop_caches(): the thread's database handle, and dropping cached directory descriptors after host changes made behind the library's back.
  • ufatfs_fs_recover(), ufatfs_fs_recover_ino(), ufatfs_fs...
check-in: 85ab40c6d2 user: grok tags: fsck
05:30
Make case-only renames possible by doing it in two steps. check-in: 56442fae09 user: chungy tags: trunk
05:24
Case-only renames now change the host spelling too.

Linux VFAT and exFAT refuse to rename a to A in place. So a rename in the same directory whose new name mangles to a different spelling with the same host key now goes through the two-step move that other renames use:

  • Before COMMIT, the object moves to /.ufatfs/data/<ino>.
  • After COMMIT, it moves to the new mangled name.

This means the move uses no temporary name that could collide, recov... closed check-in: 0268859769 user: grok tags: case-rename

05:24
Get basic read/write mounts working. check-in: 146a2ac113 user: chungy tags: trunk
04:33
rename (plain, RENAME_NOREPLACE, RENAME_EXCHANGE) and link, with crash-safe staging of host objects.

The core is in src/fs_write.c; its header comment documents the crash ordering of every operation.

Staging:

  • A host rename cannot be atomic with a COMMIT. So before the transaction, every host object that has to move goes to /.ufatfs/data/<ino> (renameat2 RENAME_NOREPLACE).
  • After COMMIT, each object is placed at it...
closed check-in: c5b60eae11 user: grok tags: rename-link
04:33
DB layer for rename and link: rewrite a dirent in place, test for children.
  • ufatfs_db_update_dirent() sets a dirent's parent, logical name, inode and host name in one statement and recomputes host_key. It reports EEXIST for a logical-name clash and UFATFS_E_HOSTKEY for a host-key clash, as insert does, plus ENOENT and EILSEQ. Rename, exchange and host-name changes all use it.
  • ufatfs_db_has_children()</...
check-in: 9b11ecbcf0 user: grok tags: rename-link
04:16
Read/write mount: create, write, truncate, mkdir, rmdir, unlink, symlinks, special files, chmod/chown/utimens.

The mount is now read/write by default; -o ro keeps the old behaviour, and a read-only host volume forces it.

Code layout:

  • src/fs_write.c (new) holds every mutating operation. Its header comment documents the crash ordering of each operation: the database is the truth, host objects are created with O_EXCL or RENAME_NOREPLACE, a...
closed check-in: 0eef3043f2 user: grok tags: rw-basic
04:16
DB layer for the read/write mount: inode updates and orphan rows.

New prepared statements and functions in src/db.c:

  • ufatfs_db_update_inode() stores permission bits, owner, group and the four timestamps; the file type bits never change.
  • ufatfs_db_add_orphan(), ufatfs_db_remove_orphan() and ufatfs_db_list_orphans() manage the orphans table (unlinked inodes still open or known to the kernel).

tests/uni... check-in: 32f57c86a2 user: grok tags: rw-basic

04:01
Add the host-name mangler, src/mangle.c, which turns logical names into names that both VFAT and exFAT accept.
  • Forbidden characters ("*/:<>?\| and U+0000 to U+001F), invalid UTF-8 bytes, and trailing dots and spaces become _.
  • Reserved DOS device names (CON, PRN, AUX, NUL, COM0 to COM9, LPT0 to LPT9, the superscript-digit forms, CONIN$ and CONOUT$), with or without an extension, get a _ after the device part.
  • Results are li...
check-in: 69a3327ba5 user: grok tags: rw-basic
03:53
Report birth times through the FUSE statx operation, and document inode number reuse and missing host data. check-in: aebd649541 user: chungy tags: trunk
02:54
Report birth times through the FUSE statx operation, and document inode number reuse and missing host data.
  • auto.def: check whether libfuse has the statx operation and fuse_reply_statx() (libfuse 3.18 and later); if so add -DUFATFS_HAVE_FUSE_STATX=1 to FUSE_CFLAGS. Older libfuse, or plain make without ./configure, still builds without it. --with-fuse=PREFIX now finds <code...
closed check-in: 45d7182866 user: grok tags: statx-btime
02:36
Don’t use sbin for binaries, plain bin is fine and desirable. check-in: 5559392dac user: chungy tags: trunk
02:35
Rename .gitignore to .fossil-settings/ignore-glob check-in: c3589d7a18 user: chungy tags: trunk
01:09
Read-only FUSE mount (libfuse3 low-level API), autosetup configure
  • src/fs.[ch]: filesystem core without libfuse: per-thread SQLite connections (lazy, closed on thread exit), kernel lookup counts, host directory fd cache, data location (host name chain / .ufatfs/data / .ufatfs/orphans), lookup, getattr, readlink, readdir(plus) with dirents.id offsets, open, statfs; flock on /.ufatfs for one mount.
  • src/ufatfs.c: daemon; lookup, forget(_multi), getattr, readlin...
check-in: 9c5036f488 user: grok tags: trunk