Repository navigation
fix(operations): make file operations safe and fast on NFS, SMB, FUSE, FAT and case-insensitive filesystems - #1615
Conversation
exfat-fuse got the racy recheck only once udev named its device's format. Without a record, or with one the process cannot read (Flatpak without /run/udev, containers, a mount seen before udev finished), it got none, and a same-size rewrite within one tick deleted the newer source. For the barrier the unrecognised case is the safe one; for the recheck it is not, so a fuseblk mount of unknown format now counts as exFAT's two-second window.
The racy recheck took the source's time granularity from the first file a moved item's copy read. The walk crosses mounts, so a coarse mount inside a moved folder went unchecked whenever a file outside it was read first, and a fine-grained folder holding a coarse mount read first made every other file take the digest copy. Each file now asks its own mount, one statx that never syncs, cached per mount.
Filesystems that are not multigrain, vfat among them, stamp times from the kernel's coarse clock, which runs up to a tick behind the clock the recheck reads. A file read just after its tick ended was taken as settled while a rewrite could still be stamped within that tick, and the wait woke exactly at the tick's end, when a rewrite right after the comparison could too. Both the classification and the wait now allow 100 ms more.
The racy recheck read the source to its end before comparing digests. A source that kept growing kept it reading, and batched deletions run with a cancellable nothing cancels, so the move could not finish while the source grew. It now reads at most one byte past what the copy holds, which already tells a file that grew.
The racy recheck waited on the wall clock until a rewrite would move the source's modification time. A clock set back after the copy read the file made that wait last as long as it went back, with nothing to cancel it in a batched deletion, and a rewrite could then be stamped within the tick the copy read. A clock found before the copy's read now keeps the source as changed; otherwise the wait lasts at most the mount's window.
…e it reaches them FAT stores local times, so files written by Windows or a camera in a time zone ahead of ours read as modified in the future. The racy recheck counted every such file as unsettled and read it again before deleting it. On mounts our own clock stamps (FAT, exFAT, fuseblk, HFS), a rewrite gets a time no later than that clock, so it cannot leave a time ahead of it as it is: such a file is now deleted without reading it again while the clock is still before its time, checked after the last stat. Once the clock reaches that time, the file is compared as before. sshfs keeps comparing them, as the server's clock stamps its times.
Rows for a FAT file dated ahead of our clock that the clock reaches: before the deletion, rewritten right after the comparison, which must wait a full window from the file's time rather than from the read; and as the deletion looks at it, which the check after the stat must catch.
The racy recheck's rows read 8-byte files in one read, so comparing or digesting only the first chunk went unseen. Rows with four-byte reads: an unchanged source is deleted, and one whose first chunk is rewritten right after the comparison read it is kept by the stat that follows.
A copy that opens a name of a linked file on an SMB source holds that file so no other copy opens another name of it meanwhile. The hold was released after the descriptor only because its field was declared after the descriptor's, which reordering the fields would silently undo, and the descriptor is closed by dropping it, which tests cannot observe. The descriptor and the hold now live in one type whose drop closes the descriptor first, whatever the field order, and the hold joins it as soon as the name is open.
…rlaps The test held the first linked name open for up to five seconds until the other was looked at, then went on either way: with one bulk worker (one CPU, or a rotational disk) the names never ran at once and it passed without testing the hold. It now skips with a message where the bulk path has one worker and fails when the hold runs out elsewhere. A new test swaps a linked name for another file between the copy's look and its open: the hold is on the file seen, so that name must not be opened, and the copy fails as changed.
The racy recheck knew coarse times only from the source's mount type, which does not show an SMB or NFS share of a FAT disk, ext2 and ext3 with small inodes, or FUSE daemons serving another protocol's times. A modification time with no fraction of a second is how such a filesystem shows itself, so a file read within two seconds of such a time is now compared too, as one whose times a server's clock stamps. Only recently modified files pay for it, and files that filesystems keeping nanoseconds wrote almost never have no fraction.
exFAT keeps modification times to the hundredth of a second, but the racy rows gave every coarse source whole seconds, which the rule for times with no fraction now compares whatever the mount. The exFAT and unrecognised fuseblk rows, and the coarse mount inside a moved folder, now carry a fraction, so they still need their mount's own window.
Copying a folder that holds two names of one file from an SMB share failed with "<name> changed while it was being copied: An unexpected system error occurred" wherever the destination keeps no hard links (a FAT stick, sshfs): the folder's file jobs opened both names at once, and the kernel SMB client refuses an open of one name of a file while another is being opened. Only top-level files waited for each other. Every open of a file on an SMB source now waits until no other copy has a name of it open, keyed by device and inode, whatever its link count: without POSIX extensions the client reports the link count of a file it listed as 1, which hid the names from the old check. Lab (Linux 7.2.5, Samba 4.24.7), 20 linked pairs written on the server and copied to vfat: cifs-nocase and cifs-posix failed 3 of 3 rounds before and pass 3 of 3 after; fresh pairs opened by two threads at once fail with EINVAL 149 of 150 times on both shares.
Copying a folder whose names are all claimed (one holds a "~1" short name) onto an SMB share stalled for 35 s, Samba's lease break timeout, in the rename that publishes the folder: names made with mknod and looked up by name while other files of the folder were being written left the server waiting on a break the client never answered. On SMB a claim now creates the file exclusively, read-only, and reads its identity from the descriptor, as where nodes are refused. Lab (Linux 7.2.5, Samba 4.24.7), 2,001 claimed 1 KiB files from tmpfs, 3 rounds: cifs-nocase 36.15-36.25 s before, 0.61-0.67 s after; cifs 1.20 s then 36 s before, 0.59-0.64 s after; cifs-posix 0.75 s before, 0.69-0.72 s after. A Python replay of the same calls stalls 35.0 s in the rename every time with mknod and stat, and never with exclusive read-only creates (up to 6,001 files).
Add a "Copying" section to the filesystem compatibility guide: how native copies are published (O_TMPFILE, .strata-copy-* stages, in place where nothing can be placed), the data ladder and its kernel gates, the metadata order and what each lab mount keeps, read-only folders, case aliases and claims, hard links, special files, sparse files, merge stages, how a move decides which sources to delete (manifest, hard-link accounting, relaxed identity, the racily clean recheck), the durability barrier of each filesystem family with batches and parallel moves, restores through the engine and the completion report. List .strata-copy-* as safe to delete and narrow .strata-replacement-* to Replace stages, record the residual limits, the copy quirks the tests emulate and the lab's flush and claim measurements, and drop the statements the engine made false: the stage identity read by name, a copy that loses writes and xattrs, flushes for removable drives only, and restore copies without metadata or a flush.
… tests only The paste and undo now go through move_owing and replace_owing, so move_local, move_local_with_progress and replace_local_with are called only by tests, and the kernel override is the only user of lock in data.rs. The binary target warned about all four, which fails clippy with -D warnings.
Name the complex table row and helper return types, take a slice from a reference instead of cloning into one, use then_some for an eager value and arrays instead of vec! where nothing grows.
…ystem The pinned quality container keeps TMPDIR on overlayfs (here over btrfs), where three tests failed: - the sparse copy's one-mount dense row asserted a fully allocated copy, but copy_file_range within one btrfs or XFS filesystem shares the source's extents, holes included; the content and progress checks of that row stay - the in-place merge expected the alias order of folders that create their files, but overlayfs is a claiming family; the destination is now an emulated ext4 mount - the SMB Replace test located the displacement by its EXCHANGE, which only filesystems on the exchange list use; the emulated share now reports the SMB filesystem type and the original is set aside by a rename the test finds instead
…rite test On kernel exFAT, change times advance in 10 ms ticks, so the racer's rewrite often landed in the tick the file was created in and left its change time as it was. The row emulating cifs with noserverino has no content comparison to fall back on, and the source was deleted. The racer now waits until the filesystem stamps a later change time before it rewrites, so both rows check what they claim on any base.
…anged
Every error from opening a listed file or folder read "changed while it
was being copied", so an unreadable file showed "keys changed while it
was being copied: Permission denied". Only errors that say the name no
longer holds what was listed (ENOENT, ENOTDIR, ELOOP, ESTALE, ENXIO,
ENODEV) keep that wording; the others, such as EACCES, EPERM, EIO and
the SMB client's EINVAL, now read "Could not copy %{name}: %{error}".
A cancel that comes after the last item was copied still closes the pending batch, deletes every source and records every item as moved, on the sequential and the parallel path. The paste then reports Cancelled with every item completed and none failed or left out, as a cancel too late to stop anything has been reported since the removable flush work. No test covered the parallel path's cancel or the final batch close after a late cancel.
After this machine writes a file on an SMB share, the kernel client keeps its handle open for the mount's closetimeo and refuses an open of another name of the file with EINVAL meanwhile, so copying a hard-linked second name right after a write failed with "Could not copy". Opens of SMB sources that fail with EINVAL are now tried again, backing off, for closetimeo (from mountinfo, one second by default) plus half a second, then fail as before. The wait stops at once on cancel, runs on the copy's worker thread, and costs nothing when the open succeeds. Other errors and other filesystems are not retried.
A real second name of a just-written file is refused by a real SMB mount in real time, which the test clock cannot move past, so the emulated refusal applies to a plain file.
The worker panic, start, stop and record errors of the copy engine and the deletion reached the failure dialog as hard-coded English. They now go through the catalogs like the neighbouring messages, under six strings added to all eleven languages.
The barrier gave up with Permission denied when no folder of the destination's mount could be opened for reading, so a durable move into a write-only folder that is a mount root failed before copying anything. Where only the filesystem is flushed, syncfs accepts any descriptor on it, so an unnamed file made in the destination serves once the readable ancestors run out. A folder's fsync still needs a readable folder.
A tilde followed by a digit anywhere in any sibling name sent every child of the folder through the claim-first path on every destination that may alias names, at two to three extra calls per file. Only BASE~N of at most eight characters with at most three of extension can be a generated short name, so only that shape counts.
Ordinary folder monitors request rescans too, and their columns still get the incremental removal before the reload.
Route::new looked the source mount up twice per sparse file, and the move path once more in copy_file for the same family. The route now takes the mount copy_file already resolved and asks the filesystem at most once otherwise.
stores_holes excluded only the kernel's FAT, exFAT and ntfs3 drivers. A fuseblk mount of the same formats is the FUSE family with a format tag, so a sparse source was copied with hole skipping onto exfat-fuse, which zero-fills every skipped hole inside one uncancellable write. Both FUSE formats now get their holes written as zeros like the kernel drivers.
|
Review follow-up pushed, one commit per confirmed finding (each thread has a reply naming its commit):
Also updated: the PR body's sparse-copy and lost-reply lines, and the lost-reply paragraph in Validation, scoped as AGENTS.md asks, all through
Not run locally: the full |
vboxsf keeps a name's inode number for whatever a rename puts there, as the compatibility notes already say, yet stable_inodes() called it stable because its type falls in the Other family. A rename over a reserved placeholder whose reply was lost then took the moved empty file for the placeholder and unlinked it. The lost-reply placement test gains vboxsf rows that emulate the kept number.
Before 6.10 an unprivileged linkat(AT_EMPTY_PATH) fails with ENOENT before the name is looked at, so the engine retries through /proc and the seam counted two LinkFd calls, firing `after` racers on the failed first one. CI saw a racer remove a copy that was not there yet and a link count of 2. The seam now stands in with the /proc form where the host refuses the plain one, and the ProcOnly and Unavailable quirks keep covering the older kernels. The taken-name test asserts that every link targets the taken name instead of counting calls.
… alike On kernels before 6.13 two inodes created within one coarse clock tick share a birth time, so on CI the replacement of a merged copy on an emulated exFAT mount passed for the copy by type, birth, size and time and the source was deleted. The row now waits until a new inode is born in a later tick before the move starts.
The "Preparing items" layer of a transfer whose destination is slow to answer lives in the window overlay and was dismissed only once the conflict check returned, so closing the tab left it covering the window. Disposing the view now cancels the check and dismisses the layer, and the transfer copies nothing.
A rename keeps the inode, so checking its mode and time after checking its identity cannot fail.
Drop comments that restate the code, reword garbled or imprecise ones, and say that the completion report lists the names the destination changed, since same-name numbering inside an archive is not reported.
… check put_back_unreplaced left an original in the aside folder when its name turned out taken between the stat and the put-back rename, and remove() then deleted it with the folder after the flush although the merge had replaced nothing there: a merge without Trash whose incoming item was left out, with another program creating the name in that window. A taken name now ends the merge like any failed put-back, with the aside folder kept and named in the error.
Drop docs that restate signatures, reword a replace doc that promised no window without the original, and say that merge originals go aside where Trash is unavailable.
|
Review of 382a4a3 with Prior review threads. All seven follow-ups do what their replies say: f134591 ( Fixed
Not changed, for a follow-up (#1729 or here as you prefer)
Validation (worktree, private Xvfb and D-Bus,
CI. On the first push every check passed except Rust shard 1, which failed the |
…ed folder too On CI's kernel the folder another program made at the merged folder's name was born in the same coarse clock tick as that folder, so on the emulated vfat mount it passed for the copy by type and birth time and the source was deleted. The row now waits for a later tick after making the target folder, as the replaced-alike row already does.
# Conflicts: # src/ui/notice.rs
Replace without Trash, archive Replace and the case-only rename now move an original into a fresh .strata-originals-<uuid>/ folder under its own name, so Restore never has to ask what it was called. The move is a plain rename plus an identity check: nothing else knows the folder, and the placement ladder's link and reserved-name rungs left states there that a restore takes for an original (lab block 5). Merge's set-aside into its own mirror folders uses the same rename. Putting back goes through the ladder, and the folder is removed through the leftover-aware rmdir. Linux lets a folder change parent only when the user may write to it, so a read-only folder its owner can open is made writable to them for the instant of each move into or out of the originals folder, and its mode is put back at once. A replacing move on one filesystem whose original cannot be removed afterwards no longer fails the item: the source already sits at the target, so the move completes with its undo record and reports the original kept in its folder (#1615 follow-up F11). Messages name the folder and the item's own name rather than a flat hidden file. Where the device barrier fsyncs both the folder and the filesystem, it now fsyncs the folder before syncfs as well as after it, and ntfs3 gets that pair too: ntfs3's syncfs reported success for renames a lost device never received, while FAT's writes the copy back without flushing the device's cache, which only the later folder fsync does.
…e mounts (#1729) * chore(operations): start filesystem compatibility steps 4-8 Steps 4-8 of #1590 follow #1615; implementation starts once #1615 is merged. * refactor(operations): keep every hidden name prefix in one table Add model::hidden_names: the prefixes Strata creates, including the .strata-originals- containers set-aside originals move into, the legacy forms released builds left (.strata-symlink-, tempfile's six-character suffixes), and the names other programs leave: the silly renames the NFS, FUSE and SMB clients make, and the <name>.ntfs-3g-<ten digits> link ntfs-3g makes while renaming over an entry. classify and foreign_leftover recognise a name only by its whole prefix and suffix. Placement, the copy engine, archives and merges now create names from the table. No behaviour change. Refs #1590 * test(operations): emulate an unplugged device in the syscall seam Add Quirks::unplugged_after: once the matching call has run, every later call in the scope fails with EIO, as a yanked device does, so an operation's own cleanup fails too, until FsQuirks::replug. Only the unplugged scope fails; a source in its own scope keeps answering. Trash in a scope now reports the seam's error instead of success without moving anything. A copy cut off at its stage's second write leaves only that stage, classified as an incomplete copy, holding the bytes written before the unplug. Refs #1590 * fix(archive): try every numbered name Keep Both allows a new archive Publishing a new archive under Keep Both computed each numbered name after the one before it was found taken, so the loop ended having computed its last candidate without trying it. The candidates are now made before each attempt, so all of the bound's names are tried. * fix(archive): number an extracted name that ends in a dot as Keep Both does Extraction split a name such as readme. into the stem readme and the extension ".", so a taken readme. became "readme (2).", a name that ends in a dot again, while Keep Both gives "readme. (1)". Both now take the stem and extension from one helper in names.rs. * fix(operations): drop a published stage off the main thread Publishing a stage without replacing returned on success, and on an unconfirmed placement, with the stage still owned by the async step, so its parent folder's descriptor was closed on the GTK main thread. The stage is now held through OffMain like the module's other descriptors. * fix(operations): leave another item found at a placement's destination When a placed item turned out to be another one at its new name, the placement moved whatever was there back to the source name. That item could be one another program put at the destination just after the move, which then landed at the source, possibly a hidden set-aside or Trash name. A placement that knows which item it moves now checks the source name just before the move and refuses another item there without moving anything. Another item found at the destination afterwards is left where it is and reported as unconfirmed. Where that destination is a hidden name Strata chose, as when it sets an original aside or parks an item during a case-only rename, the error names it. * fix(operations): remove read-only folders a merge placed when it is undone Undoing a merge without Trash deletes what it placed by its record, but a folder the copy gave a mode such as 0555 kept the undo from deleting anything inside it, so the undo always ended with "Permission denied". Each folder of that record is one the merge made, so the undo now gives its owner access while its entries go, and gives the folder its mode back if it stays, also when the undo is cancelled. Folders outside the record, such as the one the item sits in, and the sources a move deletes are never changed. * fix(operations): put originals back when a merge without Trash is cancelled A merge without Trash sets the originals it overwrites aside in a hidden .strata-merge-<id> folder. Cancelled after it placed a copy at one of their names, it could not put that original back, as its own copy held the name, so it ended with "The merge stopped. Originals that could not be put back are in ..." instead of as cancelled, and left the folder. The merge now remembers what it placed at the names of set-aside originals. A stopped merge deletes such a copy while it is still as placed, puts the original back, and removes the emptied folder, so a cancel ends as cancelled. Anything else at the name stays, and so does the original in the folder, which the error names. * refactor(operations): share the wait for an SMB deferred close Move the budget and backoff of the SMB source-open retry into a deferred_close module, so the leftover wait and the SMB folder-rename retry of #1590 step 4 can use the same capped, cancellable wait. No behaviour change: closetimeo plus 0.5 s, at most 10 s in total, 10 ms pauses doubling to 50 ms, on the operation's worker. Refs #1590 * feat(services): register Strata's reads and running operations Add services::file_activity, one process-wide registry of the reads Strata holds open and of the file operations it runs, so step 4's provider wrapper can release previews before an operation changes files, and steps 7 and 8 can tell which folders an operation touches without guards of their own. Reads register a hold under the path they were given and its real path before they open anything: the sandbox, pool and media funnels, the in-process content, text and Markdown image reads, and the background folder listings behind item counts, audio folder art, video subtitle lookups, numbered-name checks and the renamed-folder probe. A release stops those holds and waits for them, a fence refuses new ones, and begin, is_changing and is_active_in answer for running operations. Queries are in memory, one lock each. A refused or stopped read fails with "This item is being changed by a file operation.", so item counts, media details, folder art and subtitle counts do not cache it as a failure, and a preview whose type needs sniffing reports it instead of letting GIO open the file. Stopping a song's folder cover leaves its tags. Nothing fences or releases yet. Refs #1590 * fix(operations): learn tmpfile linking and copy_file_range support per mount How unnamed files link and whether copy_file_range exists were process-wide statics that every test scope reset on install and drop, so a concurrent test could see another mount's state, or a reset, mid-copy. Keep both with the mount's other learned capabilities instead: each scope then starts and ends with its own state, and the seam resets nothing global. * test: keep a failing test's main-context tasks from aborting the run A test that panicked while a paste was in flight left its local task, and the GIO calls that task awaited, on the default main context. The next test to iterate it, on another thread, polled or dropped the task, or ran a call's thread-bound callback, there: the thread-guard panic cannot unwind out of GLib, so the whole run aborted and the first failure's output was lost. The main-context lock now destroys the glib-rs tasks attached while a panicking test held it, on that test's thread, then runs the context there until it has been idle for 100 ms (2 s at most). Dropping a GIO future does not cancel its call, so the calls those tasks awaited complete on the thread their callbacks belong to. Sources GIO owns are not destroyed, since that frees memory GIO still uses. * test(operations): ask the filesystem seam whether a disk spins Worker counts read the host disk's rotational flag straight from sysfs, so the parallel move test failed on a machine with a spinning disk and the SMB linked-file test skipped there. Read it through FsEnvironment instead: a test scope answers from its quirks and never asks the host, and the move test now covers a spinning source, a spinning destination and neither. * fix(i18n): localize the copy and move worker failures with progress A copy or move whose GIO worker with progress died reached the failure dialog as "Copy/Move worker stopped unexpectedly" in English. The copy now reuses "The copy stopped unexpectedly", and "The move stopped unexpectedly" joins all eleven catalogs. * test(operations): fold overlapping refused-name and hidden-copy tests into tables The outright refusal of a given-back name was the default-policy row of the refused-as-missing test plus a message check, and the tmpfile visibility test repeated the hidden-stage test's listing on another path. Each pair is now one table: the EINVAL row keeps the invalid-name message, single write and empty folder checks, and the tmpfile row keeps the empty listing and the 2 MiB content check beside the stage rows. * test(operations): fail the shared-name restore when its copies never meet The racer that holds the first sync until both Trash items were copied gave up silently after 5 s, so on a loaded shard the "neither Trash copy deleted before both copied" check could pass without having waited. It now waits up to 20 s, as the file's other deadlines do, and the test fails if it gave up. * fix(browser): quote names left undeleted and give one item a singular heading The report line for an item that could not be deleted, and the error a delete or a merge undo shows for it, showed its name unquoted while every sibling line quotes it. A section holding one item also read in the plural: one renamed item was headed "These names were already taken", one left-out special file "These special files can't be copied and were left out", and the undo note for one item spoke of "these items". The name is now quoted, and each rename cause, both left-out headings and the undo note have a singular message, chosen when the section holds one item, as whole messages in all eleven languages. * test(operations): evict only unheld entries and emulate cifs inode autodisable The seam's renumbering made an entry report another inode number even while a descriptor of the process held it, which the kernel never does: a held dentry keeps its inode in memory, so it is neither evicted nor renumbered. evict() renumbers an entry only when no descriptor of the process refers to it, O_PATH ones included, and says whether it did, so a test can require the eviction it relies on. The descriptor scan that emulates NFS silly renames is shared with it. autodisable_serverino() does what the cifs client does after a server inode collision, with no mount-table event: serverino leaves the mount's options and every entry no descriptor holds reports another number. The made_up_births quirk reports the earlier of a file's modification and change times as its birth time, as Samba makes one up for a file whose DOS attributes it does not store. exFAT's folder birth reset was already emulated. Only the seam changes; the identity tests use these. * test(operations): report a mount type of their own for the default and vboxsf presets Quirks::vboxsf() set no mount type or filesystem magic, so its rows ran with the family, inode-number rule and clock of whatever filesystem holds the test's temporary folder, and so did every row built on Quirks::default(). The vboxsf preset now reports vboxsf's mountinfo type, magic and missing birth times, and a scope without a mount type or magic of its own reports ext4's instead of the host's, so a row tests the same mount on every machine. * refactor(operations): decide every identity through one rule per mount Two rules disagreed about which mounts keep inode numbers: the move manifest took FAT, FUSE, vboxsf and cifs without server numbers for renumbering mounts, while the copy engine counted only FUSE, so a FAT copy failed as changed when the kernel renumbered an entry it had made, and lost-reply placeholders, exFAT folder births and the manifest each kept a check of their own. The mount profile now derives IdentityTraits once per mount: whether inode numbers are kept, renewed or unknown, and whether folders keep their birth times. One pure rule in services, Evidence::compare, decides from them whether an entry is still one that was recorded: by device and type, then the birth time where both report one (for folders only where renames keep it), then the number where the mount keeps numbers, and, for files and links only, the recorded size and modification time. It touches no disk, so records can later be compared on any thread. The copy engine, the move manifest and destination provenance, restrictive folders, links, the names a copy claims, and the placement ladder's lost-reply placeholders all decide through it. A copy no longer fails on an entry of its own, or on its selected source folder, that the kernel renumbered after eviction. Only mount types known to keep inode numbers are trusted to: an unlisted type, or a mount whose type cannot be read, still needs equal numbers but never has a lost-reply placeholder removed on their strength. A move's check of a hard-linked file accepted any change time on its other names once it had deleted one of them. It now reads the change time through another name of the file in the same item right after each removal, and later names must show it; across items the remaining acceptance is documented. * refactor(services): add the identity record shared by Trash, navigation and load stamps Trash records keep a device and inode number only, and an open folder's identity its number and birth time, so neither survives a mount that renumbers its entries, and both trust a number another item reused. ItemIdentity keeps what an item was when it was read together with its mount's identity traits, and same() decides through the one rule the operations use, by the traits of whichever mount proves less; what the rule leaves unproven is not the same item. It touches no disk, so the interface can compare records on its own thread. No site records it yet: Trash matching, the folders a window follows and the load stamp move to it next. * refactor(ui): mark the UI thread and assert file calls stay off it * feat(volume): watch the mount table on its own thread * refactor(files): list native folders through the filesystem seam * feat(volume): bound requests to mounts that stop answering * feat(operations): add off-thread probes for presence, folders and listings * fix(operations): prove moved copies by the mount's identity rule Before deleting its sources, a move checks that each entry of its copy is still the one it made. Where the destination numbers an evicted entry afresh, an entry was known by its type and birth time, or by its type, size and time where no birth time is reported, so on sshfs, exfat-fuse and vboxsf another file of the copy's size and time renamed to its name passed for it and the move deleted the source. The birth time now stands in for the inode number only where both stats report one, as on vfat, exFAT and cifs with noserverino. Elsewhere the inode must still match, and a copy the kernel renumbered before the check keeps its sources, reported as gone. Folders on kernel exFAT, whose birth time renames reset, are still known by their type and checked through their entries, and files keep their size, time and contents checks. This deliberately flips the sshfs row of the renumbered-copies test, which now keeps its source. A new sshfs row evicts only a copied folder, and a vfat row shows birth times proving renumbered folders. The copied links test now evicts only the link, so on sshfs the merged folder's own eviction no longer hides the link a merge made again. The settled-copy test now rewrites the copy in place, as another client's file keeps the number a path-keyed daemon gave the name, so it still shows that settling keeps the size the copy was written with. * fix(launch): resolve and start programs and terminals off the UI thread Opening a terminal, running a program and the AUR or Omarchy update buttons resolved the terminal with a metadata call per PATH entry and spawned the child on the UI thread. std's spawn waits until the child has changed into its folder and exec'd, so a folder or PATH entry on a dead mount froze the window. spawn_reaped now takes a start closure and runs it on the reaper thread that already waited for the child: terminal resolution, the spawn and its error happen there, and the error comes back to the UI thread for the dialog. The PATH check asserts it runs off the UI thread. The AUR button's search for an installed helper, another PATH scan, runs on a worker before the launch. Opening an executable without a handler now reads its type and mode from the asynchronous query it already made instead of a metadata call on the UI thread. * fix(browser): forget settings of deleted folders off the UI thread A folder that fails to load forgets its saved sort and Icons size only when it was deleted. That proof read the folder and its parent on the UI thread, exactly when a dead mount's load had just timed out. It now asks the deletion probe on a worker, through the mount lanes, and drops the values when the answer arrives. A drive's root is still never taken for a deleted folder. Refs #1590 * fix(location): complete typed paths off the UI thread Every keystroke in the location bar listed the typed folder, and checked each symbolic link and the typed path itself, on the UI thread. The parsing stays there; the listing now goes to the child-folder probe on a worker, one request per text change. Only the latest text's answer is shown, and the list appears when it arrives. Tab, the selection keys, and Enter once any of them is waiting, pressed while the folder is being listed, wait for its answer and then run in the order they were pressed; once one of them changes the text, the rest wait for the new text's list. Refs #1590 * fix(window): restore tabs and the default folder without touching the disk on the UI thread Starting Strata, opening a new tab and the go chords for standard folders checked their folders with is_dir() on the UI thread, so a tab or default folder on an offline share froze the window, and any failure, a timeout included, cleared the default-folder preference. Saved tabs and the default folder are now taken as written and checked by the folder probe on a worker before they open. A folder counts as gone only when it is not a folder, or when the deletion probe finds it missing beside other entries in a parent without mount points, so a folder on an unplugged drive or an unmounted share is kept. A restored tab whose folder is gone closes, and stays in the saved session while its check runs; the default-folder preference is cleared only for a gone folder. Any other answer, or a check still running after the mount lanes' stall time, opens the folder so the pane shows its error. Go chords open standard folders the same way and still report the ones that are missing. Refs #1590 * fix(files): close enumerators and streams off the UI thread GLib closes an enumerator or stream that is still open when its last reference goes, in place. Dropped by a future on the main context, that close ran on the UI thread: closedir for every folder a paste measured, a merge classified or a selection summary walked, and a round trip to the GVfs backend for remote text previews and camera thumbnails. Closing a read-only descriptor can block on NFSv4 and exfat-fuse. Closing<T> holds such an object and, when the UI thread lets go of it, starts the close on GLib's worker pool, waiting first for a call still running on it. A merge now lists a local source folder through the filesystem seam on a worker; remote sources keep their GIO enumerator, whose close does no I/O. Local folders are opened without a cancellable, and the cancel is checked once the open returns: a local open runs to its end once started, and GTask frees the enumerator of an open cancelled meanwhile on the UI thread. * test(operations): put held files aside per mount family in the syscall seam Unlinking a held file now leaves the leftover each family makes: the kernel's `.nfs` and `.__smbfile_silly` names, libfuse's `.fuse_hidden` names, or, with SMB POSIX extensions, a folder that refuses `rmdir` with `EACCES` until the last close. A leftover lingers after the close for the time the lab measured, by the test clock, and unlinking one while it is held fails or hides it again as on the real mount. SMB and FUSE count only open handles, NFS any reference. `FsQuirks::hold` stands for another program keeping a file open. The NFS, SMB, sshfs and fuseblk presets carry their family's behaviour. * fix(operations): wait for silly-rename leftovers before removing a folder A file unlinked while another program still holds it stays as a hidden leftover until the last close: `.nfs…` on NFS, `.__smbfile_silly…` on SMB, `.fuse_hidden…` on libfuse daemons, and on SMB with POSIX extensions a folder that refuses `rmdir` with `EACCES` behind an empty listing. Deleting a folder, deleting a move's sources, and cleaning up a failed copy or a merge stage then failed with "Directory not empty" or "Permission denied", or kept the moved folder as changed, though the leftover goes moments later. `leftovers::remove_folder` now retries `rmdir` while only the mount's own leftovers are listed: 10 ms pauses doubling to 50 ms, for 2 s on NFS and FUSE and for `closetimeo` plus 0.5 s, at most 10 s, on SMB, the budgets the lab confirmed. A folder found empty after a refusal is retried at once, even when the wait has run out. A folder that anything else keeps fails at once, as before, and each retry first checks that the name still holds the folder the caller verified, so a folder put in its place is never removed. A Delete, and a transfer's deletions, share one wait however many folders they remove. Cancelling a Delete or a move ends its wait; the cleanup of a cancelled copy still waits. `MountType::silly_names` tells each family's leftovers. * fix(operations): leave other programs' leftovers in place A recursive delete unlinked the `.nfs…`, `.__smbfile_silly…` and `.fuse_hidden…` files it found in a folder like any other entry. They are files another program still reads: NFS refuses the unlink with "Device or resource busy", SMB answers that the file is already gone, and libfuse hides it again under a fresh name, so the delete failed on the leftover itself. Inside a folder being deleted, a leftover of the family its mount makes now stays, and the folder goes once the leftover does, through the mount's wait, including when the leftover is already gone by the time the delete looks at it. Otherwise the folder stays with the leftover and the delete reports it. Leftovers are never deleted, whether a program still holds them or not. A name like a leftover on any other mount is an ordinary file, and an item the user selected by name is deleted as before. * fix(ui): build context menus and the delete dialog without disk access * fix(devices): read device facts off the UI thread * fix(search): register index walks as reads operations can stop Each folder listing of the in-process search index walk now holds the folder in the file activity registry under its own and its real name. An operation that fences the folder refuses the listing, or stops it between entries, and the walk reports the search as partial instead of keeping a directory handle open below a folder being renamed or moved. * fix(search): filter search hits off the UI thread The search worker now drops hits whose files are proven gone before it publishes them, so neither List, Icons nor Columns checks a hit on the interface thread. Each batch still reports how many candidates were ranked, so asking for more continues past dropped hits. Pruning after a file operation sends one presence batch through the probe module and removes only hits proven absent; an unreadable or timed-out answer keeps the hit. The removable-device destination chooser checks containment by path on the interface thread and where a folder really leads on a worker, through a new real_folder probe. Its validation, listing, folder monitor and search start only once that probe places the folder inside the device, so routes that skip validation never show what lies outside. * fix(browser): check undo and redo targets off the UI thread * fix(archive): check archive names and chooser folders off the UI thread * fix(sidebar): update pinned folders off the UI thread Pin, unpin, reorder and the cleanup after a deletion or restore now run as one read-modify-write job on a background settings writer. The job reads the GTK bookmarks file, applies the change, checks just before its rename that no other program changed the file and starts over (at most twice) if one did, then every open sidebar adopts the pins the file holds. A deletion or restore run unpins everything it removed in one update when it ends, however it ends, instead of one GIO replace per item. The GIO writer and atomic_write_config become one writer with the dotfile ownership rules. Later windows start from the last adopted pins and re-read the file in the background; quitting waits up to 10 s for queued saves. * feat(settings): save settings and state files through one background writer Preferences, folder settings, the tabs session, folder history, recent applications, custom themes and the source-preview style scheme now save on the settings writer instead of the UI thread. Saves of one file that are still waiting keep only the newest contents, the writer remembers the stamp of everything it wrote or read, and the setter returns once the change is published. Re-reads after another process changed a file (folder settings and defaults saved by the portal chooser, custom themes, Omarchy theme changes) parse on the writer and apply on the UI thread; a change of this process's own that is still being saved wins. A folder-view save always merges this process's unsaved edits over the file under the cross-process lock and marks only the edits it wrote as saved, so changes made while it ran stay unsaved. Omarchy state is read once and re-read only when its files change. The reads that build the first window stay synchronous as a documented exception, and atomic writes assert they run off the UI thread; the custom action store's writes from the Settings page take a named exception until it moves to the writer. * fix(operations): register every operation and release Strata's reads before it changes files Every mutating provider entry and Empty Trash now registers the operation in file_activity and, before its first change, fences the items it changes, stops Strata's reads under them and waits up to two seconds for them to end. Parents are resolved off the UI thread through the mount's lane, so a symbolic link to the folder still matches; a mount that does not answer falls back to the names as given. A merge fences each original only as it moves it to Trash or aside, so the rest of its target stays previewable. This keeps previews and thumbnails from turning a delete or move on NFS, SMB and FUSE mounts into silly-rename leftovers, "Directory not empty" or a source kept as changed. * fix(preview): stop previews and thumbnails on files an operation changes When an operation releases an item, the registry tells the UI first: each window's and chooser's preview drawer clears a preview of that item or of anything inside it, which ends its decoders without the stall recovery that would restart them, and shows the browser's focused entry again once the operation ends. A thumbnail refused or stopped by an operation is no longer cached as failed; it is admitted again when the operation ends. The Properties folder-size walk now registers each folder it enumerates, so a release ends the walk as incomplete and closes its folders instead of keeping them open below a folder being renamed, moved or deleted. * fix(sandbox): wait for a sandbox's namespace to exit bwrap's monitor can be reaped while the init of its PID namespace still runs, after a normal exit as well as after a kill, and the bind of the user's file lives until that init is gone. Each sandbox now asks bwrap for its namespace init on --info-fd, opens a pidfd on it while the sandbox runs, and after every exit of bwrap waits up to one second for that init to exit before the read is reported done. The info goes to bwrap's stderr, which every sandbox already discarded; inside the sandbox that descriptor is closed and the helper reopens it on /dev/null. * fix(devices): release Strata's reads before unmounting a drive Releasing a drive now fences its mount root and ends Strata's previews, thumbnails and probes there, waiting for each sandbox's namespace to exit, before it flushes and unmounts. A held file made the unmount fail with "target is busy"; a sandbox's bind of a file let it report success while the filesystem stayed alive until the sandbox ended. * test(operations): emulate the attribute, daemon and listing caches of network mounts * feat(files): revalidate the stat that starts a folder load * feat(files): report a folder's change stamp with each load and on request * fix(app): follow renamed folders by the mount's identity rule * fix(browser): validate local folders off the UI thread * fix(browser): start folder monitors off the UI thread once the folder has answered * fix(volume): identify SMB entries by creation time and by server numbers while they hold The cifs client never prints noserverino, so the option check took every share for one that keeps its server inode numbers, including shares mounted without them; and it turns server numbers off at any moment, after a collision or once another client renames a folder it has looked up, dropping serverino from the options without a mount-table event. An SMB mount now counts as renewing its numbers in the cached profile, and each decision on one (a move's deletion check of its sources, the check of its copy, a lost-reply placeholder) reads the mount's options again from the kernel's table, once, and compares inode numbers only while serverino still shows. The server's creation time stands in for them otherwise. Samba makes that time up for files it did not create with stored DOS attributes, so a replacement keeping the modification time repeats it, and once numbers are off the client keeps an entry's cached number and creation time across a replacement made elsewhere: where a site records a file's size and times, the rule then compares them too, and its change time where recorded. A birth time of zero counts as none on SMB and NFSv4 as on FUSE. The seam's autodisable now keeps cached entries' numbers and creation times until they are evicted, eviction gives cifs entries the server's number while serverino holds or with POSIX extensions, and Samba's made-up creation times are emulated per entry as the client first saw them. Fixtures carry real cifs option strings. * fix(operations): stop comparing birth times of exFAT folders The kernel's exFAT driver sets a folder's birth time again, on disk, at every rename whose destination is the folder. A merge without Trash sets originals aside by renaming them into its hidden merge folder, so on exFAT the folder no longer matched the identity recorded when it was made: removing it after a successful merge failed as changed while the operation was in progress, and a merge cancelled after placing a copy put every original back but ended as stopped, naming an empty merge folder it left behind. One rule now covers what the move check of a copy did on its own: a folder whose birth time the mount resets, where both stats report one, is known by its device and type where only an empty folder is removed, where its entries are checked one by one, or where it sits at a hidden name of Strata's own. A udev-exFAT fuseblk mount is marked the same, and the copy check keeps requiring the exact folder where no birth time is reported, as before. * fix(operations): check Replace targets, set-aside originals and cleanups by the mount's rule Replace compared its target with the identity read before the staging copy by device and inode alone, so on vfat, exFAT and SMB without server inode numbers a target the kernel evicted meanwhile failed after the whole copy as changed. After SMB turned server numbers off it was the other way round: the client keeps the number and creation time it cached for an entry across a replacement another client makes, so a file a sync tool replaced with one of the same size and modification time passed for the confirmed original and was replaced. The target, of Replace and of an archive, is now checked right before it goes by the mount's rule as of then, a file with its recorded size, times and change time where the rule calls for them, and the steps after use the identity it has now. An original set aside, by Replace or a merge without Trash, goes back only while the rule still knows it, by its identity then, and a removal by a recorded identity (an original set aside, a stage, a cancelled copy's folder, the operation's own entries after a failure) follows the rule too. Where the rule proves nothing, the exact identity is still required. The seam keeps an entry's renumbering across renames, as the kernel keeps an inode's number. * feat(operations): pin single items by path where numbers and births prove nothing On sshfs, exfat-fuse, vboxsf and other mounts that number an entry afresh once the kernel evicts it and report no birth time, an item read before a long step could only be known again by its size and times: a Replace target a program renamed a file of its size and time over during the staging copy was replaced, a stage evicted before sshfs published it (without RENAME_NOREPLACE) failed as changed, and an item GLib's Trash left in place (GLib #4060) passed for trashed once the kernel had renumbered it, recording an Undo for nothing. Those single items are now held from the stat that reads them to the decision with an O_PATH descriptor, which opens nothing on a FUSE daemon or SMB server and keeps the kernel from evicting the entry, so it keeps its number: Replace and archive-Replace targets from the plan, file and archive stages from their last write to their publication, and the item under the Trash check. A held entry whose name went (ESTALE or ENOENT on FUSE) matches nothing, and nothing is read by path instead. A held target still has to pass the mount's rule, since sshfs and vboxsf keep a name's number for a file put there on the server or by another client. A folder on kernel exFAT, whose birth time renames reset, is held the same way. NFS keeps numbers and is never held. Elsewhere the Trash check follows the mount's rule. A merge compares its stage with the descriptor it holds before dropping it. A FUSE daemon whose probe link keeps the file's number and counts two links, as ntfs-3g passes the real inode numbers on, now counts as keeping numbers, so its entries need no holding. * feat(operations): say which program still has a file open When only another program's leftovers kept a folder, Delete reported "Directory not empty" or "Permission denied" after the wait, and a move kept its source folder as "changed during the move". The error now says a file in the folder is still open, and names the program when this computer shows it. Strata's own reads and the roots of its other running operations are looked up first, in memory; an operation that also covers the folder is the caller's own and is skipped. Otherwise `/proc` is read once, only for the folder that failed: a descriptor, or else a mapping, whose path lies in the folder, confirmed by the mount id and inode `fdinfo` reports for the leftover. Nothing is called through another process's descriptors. A holder in Strata's process, in a helper it started as its own process group (sandboxes, custom actions, file providers), or in another process of its executable is reported as Strata. A terminal or program Strata started for the user is named like any other program. Programs are named by their systemd app unit (uwsm, GNOME, KDE), skipping the units Strata itself runs in, or GIO's launch variable and the app's desktop file, otherwise by their process name. With no holder found, NFS and FUSE say another program holds the file, SMB says a program on this or another computer, and SMB with POSIX extensions keeps "Permission denied". A move reports the folder with `KeptCause::StillOpen`, and the undo of a Replace or Merge without Trash says the folder is still open instead of calling it changed. * fix(operations): name what blocks an SMB rename after a bounded retry Samba refuses to rename a folder while any handle below it is open, from this computer or another, and Linux reports that as "Permission denied". Renaming, moving or trashing such a folder failed with that alone. A folder rename, move or Trash on SMB refused with `EACCES` is now retried through the shared deferred-close wait, `closetimeo` plus 0.5 s and at most 10 s, cancellable and on the operation's worker, for the kernels that may keep this client's closed handles open below the folder (Linux 6.17 to 7.1, not verified; the lab's 7.2.5 closes them before the rename, so the retry never ran there). One wait covers every folder of a Trash, as it does for a Delete. A rename that works costs nothing extra, and SMB with POSIX extensions, where this computer's open files never block a folder rename, is not retried. When the rename is still refused, a program on this computer that keeps a file below open is named, or Strata when it is Strata's own; otherwise "Permission denied" stays, since Samba gives the same answer for a real permission problem. A cancel is reported only when it cut the wait short, never in place of another failure. An item on SMB refused with `EBUSY`, which a handle on another computer that does not share delete access causes, is reported as still open in a program on this or another computer. * fix(devices): read the Format dialog's facts off the UI thread The Format dialog ran lsblk for the current filesystem and, on Continue, for the drive's size, and scanned PATH for the mkfs tools on every keystroke; the missing-tools dialog read os-release. All of it ran on the UI thread. The dialog now opens at once and one worker job answers: the tool scan, then gather_drive_facts, or the package manager when a tool is missing. Its rows appear and Continue becomes available when the answer arrives; a missing tool replaces it with the missing-tools dialog, which now takes the package manager from the job. The missing-tools dialog and the formatting progress open on the dialog's own overlay, not on the sidebar row it was opened from, which a sidebar rebuild during the job removes. tool_path and PackageManager::detect assert that they run off the UI thread. * fix(settings): find AUR helpers off the UI thread install_source::on_path read the metadata of every PATH entry each time Settings built the update instruction or the update button's label, on the UI thread; a PATH entry can sit on a dead NFS home. The worker that already detects the update method now also looks the helpers up once and caches the answer in the managed install. The update instruction, the update button and dialog labels, and launch_aur_update read that answer, so the label and the action always agree and the click scans nothing. on_path asserts that it runs off the UI thread. * fix(launch): read recent-app history off the UI thread for Open With Building the Open With dialog read recent-apps.toml on the UI thread to place the Recently Used section. The history is now read on the settings writer, after any launch still being recorded, before the dialog is shown: in resolve() for selections and the keyboard command (so a newer interaction still drops the lookup), and when the folder menu opens for a folder's own Open With, which stays unavailable until the read answers so the click still opens the chooser at once. The activation fallback shows its chooser only if no other dialog, such as a repeated activation's chooser, opened during the read. The dialog is built from the split result and reads no file. Loading the history asserts that it runs off the UI thread. * fix(operations): match Trash items by type, birth and attributes Trash records now carry the shared identity record: device, type, birth time, the inode number, size and modification time for files, and the mount's identity traits (with SMB server numbers while they still show). The archive Replace undo and the trashed views and colors find a Trash item by that rule instead of by device and inode number alone, so an item the mount renumbered in Trash is still found (vfat by its birth time, sshfs-like mounts by size and time), and a reused number with another birth time no longer brings back the wrong item. Where the rule proves nothing either way, the exact number still decides. GLib trashes whatever holds the name when it gets there. The Trash check now holds the item it checked across the call, except on NFS where a held file another program removes would linger, and reports it only once the kernel shows it inside a Trash; when another item took the name first, it reports the newest Trash entry GLib made for the path, so undo and saved views follow what actually went to Trash. * fix(ui): restore trashed views and customizations by the identity the restore reports A restore now reports, per item, the identity the Trash item had when the restore worker placed it (ItemRestored, from the stat it already makes before placing), and the browser passes it with the restored location. Folder views, colors and icons kept for a trashed item come back only when that identity passes the mount's identity rule against the one recorded when the item went to Trash, so a folder renumbered in Trash on vfat or exFAT gets them back by its birth time, while another number where numbers are kept is another item. The UI no longer stats the restored path on the main thread to decide: ItemIdentity::at_path is gone. * fix(browser): accept case-only renames on mounts that number each spelling The rename prompt's "already exists" check compared the raw device and inode numbers of the two spellings with std::fs, so on exfat-fuse and other path-keyed FUSE daemons, and on cifs once it turned server numbers off, renaming foo to Foo was refused before placement could accept it. The check now runs on the seam and asks placement's alias rule, the one the rename applies a moment later: the new spelling counts as the item itself where the folder lists no such name, the item's own name is the only one matching it ignoring case, and type, size and time agree. A paste's top-level case variants use the same rule, so on a case-insensitive server behind sshfs a later spelling that leads to the item saved earlier is numbered as an alias instead of failing; anything else at the name still keeps it taken. * feat(operations): tell reused inode numbers apart by file handle where no birth time exists NFS and ext2/3/4 hand a freed inode number straight to the next file. Where a stat reports no birth time (or a zero one) on those mounts, the stat now also reads the entry's file handle with name_to_handle_at, by the same folder and name or on the held descriptor, and keeps a digest of it in the identity. Unequal handles make two entries different under the identity rule and in exact comparisons. Lab block 2 (P6) measured the handle change on every reused fileid on NFSv3 and on NFSv4.2 over a backend without birth times (198/198 on ext4 and ext3 exports), the handle staying stable across renames and moves, at no extra RPC. So a Replace without Trash on NFSv3 no longer removes a file another client put at the target's name that got the old number, and Trash matching no longer brings back such a file instead. FUSE handles change once an entry is evicted, so they are never used, and exFAT and cifs give none. * fix(operations): set originals aside under their own names Replace without Trash, archive Replace and the case-only rename now move an original into a fresh .strata-originals-<uuid>/ folder under its own name, so Restore never has to ask what it was called. The move is a plain rename plus an identity check: nothing else knows the folder, and the placement ladder's link and reserved-name rungs left states there that a restore takes for an original (lab block 5). Merge's set-aside into its own mirror folders uses the same rename. Putting back goes through the ladder, and the folder is removed through the leftover-aware rmdir. Linux lets a folder change parent only when the user may write to it, so a read-only folder its owner can open is made writable to them for the instant of each move into or out of the originals folder, and its mode is put back at once. A replacing move on one filesystem whose original cannot be removed afterwards no longer fails the item: the source already sits at the target, so the move completes with its undo record and reports the original kept in its folder (#1615 follow-up F11). Messages name the folder and the item's own name rather than a flat hidden file. Where the device barrier fsyncs both the folder and the filesystem, it now fsyncs the folder before syncfs as well as after it, and ntfs3 gets that pair too: ntfs3's syncfs reported success for renames a lost device never received, while FAT's writes the copy back without flushing the device's cache, which only the later folder fsync does. * fix(operations): exchange through the originals folder so stages hold only copies Replace and archive Replace on filesystems known to exchange faithfully first move the finished stage into a fresh .strata-originals-<uuid>/ folder under the target's name, then exchange it with the target. The original therefore ends in that folder under its own name, and before the exchange the folder holds a complete copy, so a crash leaves both items and never an original under a stage name. Where the mount refuses the exchange, the copy goes back to its stage name before the original is set aside; the refusal is still learned per mount, and exchange is still never tried off the allow-list (exfat-fuse turns it into an overwrite). A read-only copy or original folder, which cannot change parent, takes the set-aside path the same way without teaching the mount anything. The stage is checked by the mount's identity rule before it moves, so a vfat stage renumbered after its close is still exchanged. Replace and archive stages use .strata-copy- like every other stage, so that prefix always means an incomplete copy; .strata-replacement- and .strata-compression- remain only as legacy names. * test(e2e): audit main-thread file calls and log UI stalls Runtime asserts only see calls that go through Strata's own seams. Two opt-in tools now catch the rest, including GLib and GTK internals and closes triggered by drops: - STRATA_UI_STALL_MS starts a watchdog thread that posts an idle source to the main context every 100 ms. When the main loop misses it, the watchdog reads the UI thread's system call and wchan from /proc, resolves its path or descriptor, and logs where the thread is stuck. Without the variable no thread starts. - scripts/trace-main-io.py runs E2E scenarios with the UI thread under strace, classifies each file call by path (user, settings, toolkit, unclassified) and reports the violations, optionally with Strata's stack frames. tests/e2e/main-io-allowlist.toml holds the documented exceptions and refuses user paths. The pinned E2E runtime gains strace, so its image inputs change. * fix(operations): find undo originals in their own mount's Trash without GVfs * fix(operations): skip Trash items proven to be another when undoing a Delete, Replace or merge * feat(browser): check visible folders that other writers can change * fix(browser): keep a listing when a background re-list fails or falls short * feat(browser): follow folders that a check finds gone or replaced * feat(browser): confirm a coarse folder stamp once its window passes * feat(operations): restore set-aside originals and remove stale probes Add OperationProvider::recover, which puts back what an interrupted operation left in a `.strata-originals-*` or `.strata-merge-*` folder. It runs through the provider wrapper (the folder is fenced and its parent registered as active), places each item back by the identity it just read, never replacing: a taken name gets the next Keep Both number and is reported as taken, and a name that already holds the item's own inode (a hard link an interrupted link step left) loses only the hidden name. A merge folder's mirrors are walked into their folders, a missing one is made again, and each mirror and then the folder itself are removed deepest first through remove_folder, only when empty. Other programs' leftovers are never restored, renamed or removed: names the mount's silly-rename family makes are skipped, a folder holding nothing else is kept and reported as still open, and a container held only by them stays with its holder named. On an ntfs3 volume mounted read-only, as after an unplug, the error says the drive may need a check. Add OperationProvider::sweep_probes for listed probe names: once per name per session, in the background lane of the mount, an empty probe file or folder over an hour old is removed; every refusal or failed stat is silent. * fix(operations): leave other programs' leftovers out of copies and moves A copy or move of a folder copied a `.nfs…`, `.fuse_hidden…` or `.__smbfile_silly…` file found in it like any other file: the destination kept a copy of a deleted file under a hidden name that never goes, and a move then tried to remove that leftover at its source. The source walk now leaves out the names the source mount's own silly-rename family makes, as recursive deletes already do. A move keeps the source folder only while the leftover stays, after the mount's wait, and reports the folder as still open. * fix(operations): finish a staged Replace whose original cannot be removed A copy that replaced an item without Trash, or a move from another mount, failed the item when the original it set aside could not be deleted once the copy was on disk, although the replacement was in place: a move then kept its source and left no undo record. Like a replacing move within one mount, the item now completes: the original stays in its originals folder and is reported as not removed, and a move goes on to delete its source and records its undo. Archive Replace, which has no report to carry it, still fails with that message. * feat(ui): pause checks for hidden windows and tabs and in power-saver mode Browser windows and the file chooser follow their window's focus, mapping and toplevel state: the active tab checks on the focused interval while the window is focused, on the unfocused one while it is only visible, and not at all while it is hidden, minimized or suspended; inactive tabs never check. In power-saver mode focused checks slow down fourfold and unfocused windows stop checking. The Auto-refresh timer is removed; the checks of network folders replace it. * feat(ui): check network folders when the window regains focus When a window or tab becomes the focused one again, the folders it shows that other writers can change are checked at once instead of at the next interval. After 30 seconds or more away, counted on a clock that keeps running while the computer sleeps, they are also re-read, so sizes and dates of files edited elsewhere update without F5. A re-list that is owed stays owed until it can run: it waits for an open inline edit or submitted rename, for an operation in the folder, and for the duty cycle (no sooner than ten times the last listing's duration after it ended), one folder per mount at a time. A focus check made before that point does not bring the next check forward. * feat(settings): add a switch for watching network folders "Watch network folders", on by default, replaces "Auto-refresh folder" under Settings > General > Performance. Off, folders on mounts that other computers or programs change are no longer checked or re-read, so other computers' changes show after a refresh; folders with a change monitor still show this computer's changes, and local folders without a monitor are still checked. Every browser and the chooser bind it at construction. A saved Auto-refresh interval is ignored and dropped on the next save. * test(window): expect the rename prompt to refuse a hard link's name Since the rename prompt asks placement's alias rule (df3b0001), a name the folder lists is taken even when it is another link to the same file, so the prompt refuses it with the usual "already exists" reason before anything changes, as other typed names are refused. Case variants a mount numbers separately still pass to the rename, which the placement alias rows cover. * fix(settings): save and reload custom actions through the settings writer The custom action store read the actions folder, resolved interpreters on PATH and wrote action files on the UI thread: every context menu, 10xer action chord and Settings page rebuilt the registry and read the whole folder synchronously, and saves, imports, exports and deletes ran under a named UI-thread exception. The actions folder is now read and written only by jobs on the settings writer. One registry lives for the process; asking for it shows the actions as last read and starts a background re-read unless one is still waiting, and each window warms it when it opens. Programs and interpreters are looked up, an imported folder read and an exported folder written on a separate thread, admitted through the mount's lane, so a server that stops answering never holds up settings saves. Saves read the folder back in the same job, answers are adopted in the order they were queued, and the Settings page reacts when they land. A toggle flips the stored definition in its own job, a save never recreates a deleted action, and Duplicate picks its copy's id in the job that creates it. Choosing an action from a menu or the chord reads its definition again first and refuses one that changed or was removed. Exception::ActionStore is gone and the local store asserts that it runs off the UI thread. * fix(settings): watch settings, theme and Omarchy files from the monitors worker The monitors for settings.toml and folder-views.toml, the custom themes folder and the Omarchy theme folders were created, cancelled and released on the UI thread, inside GLib's inotify lock, which a creation stuck on a dead mount holds. They now go through the serial monitors worker that already owns every folder monitor: the seam's watch hook takes a file or a folder, creation is admitted through the mount's lane, and release follows the same order as folder monitors (handler disconnected on the UI thread, then the bare monitor cancelled and dropped on the worker). Once each monitor is live, what it watches is read again, so a change made while it was starting is not missed; those re-reads apply only what changed. The Omarchy folders are watched anew only when their set changes, and the custom themes folder keeps its watch across saves. * test(media): isolate the preview resume test reopening_resumes_where_the_preview_closed called gtk::init in the shared test process, so it failed whenever another test there held the default main context, as the local preview tests do. It now runs in its own process through test_support::gtk_test, like the other media tests. * test(window): wait for the queued settings save before reopening preferences The overlay focus fixture turned 10xer mode off and then built a window whose preference manager reads settings.toml at once. The save runs on the settings writer, so the window sometimes started from the seeded file with 10xer mode still on, and the accelerator test failed with "FolderJump reached the owner". The fixture now lets the writer finish first. * feat(browser): detect what interrupted operations left in a folder Classify each committed column's listed names with the hidden-name table, cached with the column's entry indexes, so detection costs no disk access on the UI thread. A column surfaces leftovers only in an interactive browser, on a native or GVfs folder that is neither Trash nor Recent, and only while no operation of this process changes or writes into that folder. A paste registers its destination by location, so GVfs folders count too, and a merge counts for every folder below its targets, where it stages copies. The registry now tells observers when an operation ends, so a leftover an operation kept appears as soon as it stops. The browser reports each change as LeftoversChanged, announcing the first time this session a folder holding set-aside originals shows them, and hands listed probe names to the provider's background sweep. Other programs' silly-rename names never classify. * feat(browser): offer to restore what an interrupted operation left A pane-header warning button, built like the other header actions, shows while a column surfaces leftovers in Columns, List and Icons. It opens a review on the modal shell: one row per leftover with what it may hold, its date and its actions. A worker stats each row and lists what originals and merge folders hold, up to 1,000 names, skipping other programs' silly-rename files and naming a container that holds only them as still open. Restore puts a folder of set-aside originals back through the provider's recover and selects what returned; an original whose name is unknown is renamed to a numbered "Recovered item" and opens the inline name editor. Show reveals the item. Incomplete copies offer Delete…, which goes through the usual confirmed Delete, re-reading the item then. Each change refuses while an operation runs in the folder. When hidden files are shown, a leftover row's context menu offers the same Restore. The first time this session a folder holding set-aside originals is opened, a dock card offers Review. * feat(browser): say when a network folder stops answering When a folder's mount has made no progress for 10 s, show "Not responding. This list may be out of date." above its listing in every view mode, and clear it once the mount answers. The last listing stays. The browser follows each column's responsiveness through the file source without I/O: on check answers, listing ends and presence changes, when the mount lanes see any request go 2 s without progress (a paste probe, a monitor creation or another window's load included), and on a one-second poll that runs only while a visible column is loading, being checked or on a mount that is not answering. The lanes keep their one timer only while a request may still stall. Error pages get no notice. FileSource::answering becomes responsiveness, so callers can tell a stalled mount from one that stopped responding. * fix(browser): keep rows on F5 when a GVfs backend stops answering Interactive GVfs folder loads now take their backend's scheme and authority lane, as background re-lists already did, and report each answer as progress, opening the enumerator included. A refresh on a backend that stopped answering is refused at once with the existing timed-out failure, and the browser keeps the rows, as it does for native mounts. A GIO call dropped while it waits, such as a load the user navigated away from, leaves its lane without marking the backend stalled: its answer would never be seen, and nothing else would clear the mark. The file source now reports the lane of every location it lists through GIO, Trash included, so the not-responding notice covers those folders. A refresh made while a mount is not answering that runs out of time keeps a complete previous listing instead of replacing it with a shorter one. * feat(browser): re-list folders whose mount never moves their stamp Some mounts never move a folder's stamp when its contents change: 9p with cache=loose, object-store FUSE folders, servers that keep folder times. When a complete listing differs from the previous one of the same folder while the stamp stayed equal and was not read inside its coarse window, the mount is marked for the session. Checked folders there are re-listed on the unfocused interval instead of being stat-checked, through the per-mount re-list queue, so the duty cycle and lane rule still apply, and re-lists slow down while the listing stays the same. A stamp that moved while the names stayed (Samba directory leases) is not evidence, and the names listed under it are not either until they change: a lease that lapses later shows new names under that same stamp. Mounts whose daemon caches names and stamps apart (sshfs) are never marked. * docs(operations): document released files and still-open leftovers Describe what step 4 built: the registry of Strata's own reads and running operations, the release every operation, Empty Trash and unmount make before changing files, the wait for a sandbox's namespace after every bubblewrap exit, the leftover each mount family keeps for a file unlinked while open, the bounded wait before a folder holding only leftovers fails, how the program still holding a file is named, the SMB folder-rename retry and its unverified premise, and the limits that remain (SMB unlink EIO from another client, pre-6.17 SMB, leftovers nobody holds). Lab figures from block 1 replace the design's estimates. * docs: describe the UI-thread rule and how it is checked Replace the guarantee that still listed synchronous archive-name, undo and redo checks with the rule step 5 built: no file call on the interface thread, with its named exceptions (the reads that build the first window, GLib's main-thread-only volume monitor, GIO application lookups, the exit flush). Add an "Unresponsive mounts" section: what moved to workers, the request lanes and what counts as progress, the one-worker bound, what the lab saw dead servers do (no timely error, unkillable calls, DONT_SYNC by path still blocking, per-process NFS caches, the unix volume monitor's start-up hang), and the shared inotify lock that pauses every monitor while one creation is stuck. Point the architecture doc at the shared pieces and the audit, and update restored tabs, the default folder and Extract To into a write-only folder. * docs(filesystem-compatibility): describe identity per mount Add an "Identity" section for what step 6 built: the one rule per mount and the order it weighs device, type, file handle, birth time, inode and attributes; a table of what proves an item on each mount family; file handles on NFS and ext without births; O_PATH holds where nothing else proves an item, never on NFS; the FUSE link-probe upgrade; SMB's server numbers while serverino shows, made-up creation times and the change-time check after a switch-off; the records kept after an operation; and what each site does with an unproven answer. The limits from the lab stay: reuse on ntfs-3g, births within one 10 ms tick (including following a renamed vfat folder), no SMB copy change-time check after a switch-off, no swap detection under the NFS Trash check, and unmeasured subtree_check handles. Scattered SMB and handle paragraphs now point to it, and the architecture doc names the rule, Pinned and ItemIdentity. * docs(files): document how Strata notices changes made elsewhere Add a "Changes made elsewhere" section for what step 7 built: which open folders are checked (outside writers, or no live monitor) and by which mount; the forced stamp every load starts with; what a check does with each answer; re-lists that keep the rows; the skip under operations and the one background job per mount; the cadence (3 s focused, 15 s unfocused, none while hidden, power saver, slowdown, duty cycle, focus check and the 30 s re-read); coarse-stamp confirmation and sshfs's dcache_timeout; mounts whose stamp never moves; block 3's cost per check; and the limits, Samba directory leases and nohandlecache first. The unresponsive-mounts section gains the kept rows on F5 and the "Not responding" notice, and the architecture, keyboard, preferences and README pages point to the checks. * docs(operations): describe leftovers after a crash or unplug Describe what step 8 built: originals set aside under their own names in a .strata-originals-<id> folder by a plain rename, the exchange through that folder with its fallback, stages that only ever hold copies, the owner-write retry for read-only folders and the refusal where the mode cannot change, the completed move that reports an original it could not remove, and the folder fsync before and after syncfs on FAT, ntfs3, ntfs-3g and exfat-fuse. Add a "Leftovers after a crash or unplug" section (what each crash window leaves, how names are recognised and when they are held back, the pane button, dock card and review, Restore without replacing, Delete for incomplete copies, the stale-probe sweep and its limits) with block 5's kill, unplug and per-Replace request figures, and rewrite the hidden-names table with the legacy forms. The archives and architecture docs follow. * fix(operations): complete a compression whose replaced original cannot be removed Compressing over an existing archive without Trash fa…
Description
Strata's no-clobber file operations relied on
renameat2flags (RENAME_NOREPLACE,RENAME_EXCHANGE), and native copies went through GIO. Many mounts reject those flags withEINVAL, among them NFS, sshfs, ntfs-3g and other libfuse2 daemons, 9p, ceph and older ZFS.user.*xattrs on read-only items;a:b,CON, too long) fails copies on most mounts or changes silently on FAT, and symlinks fail copies onto FAT and SMB.This PR makes these operations work on such mounts. It never overwrites a destination that appeared meanwhile, and never deletes a source the copy doesn't hold. It delivers steps 1–3 of umbrella #1590, each as its own group of commits.
Step 1: placement, Replace/Merge, rename, Trash
One placement ladder for every site: move, staged copy publish, restore, archive extract/compress publish, symlink copy, undo and rename. It tries these in order:
renameat2(NOREPLACE).linkat. The link counts only once the new name reports the source's identity; the old name is then unlinked after an identity check.NOREPLACEnor usable hard links (sshfs, vboxsf, rclone, s3fs), an exclusive empty placeholder that is checked and then renamed over.EEXISTstays authoritative, and the ladder tells apart the three meanings ofEINVAL: flag unsupported, invalid name, and folder into itself.The reserved-name step has a narrow window.
sshfs and other libfuse daemons without
use_inogive each hard link its own inode number. Strata learns this from a probe on its own names and never uses those links to prove a placement.Capabilities are learned per mount and cached by mount ID. The cache is dropped when the mount table changes.
Replace and Merge work without Trash or
EXCHANGE.EXCHANGEis used only on in-kernel local filesystems, never FUSE. exfat-fuse reports success for it but simply overwrites, which on main destroyed the original when Trash was unavailable.Rename (F2) and undo rename go through the ladder. Case-only renames (
foo→Foo) work on vfat, exFAT, SMB, casefold ext4 and exfat-fuse. GVfs locations keep GIO.Trash results are verified. Some FUSE mounts report success without moving anything (GLib #4060).
Identity checks compare file type and birth time as well as device and inode, because ext4, NFS, CIFS and ntfs3 reuse inode numbers immediately.
Archives:
Step 2: the copy engine
One descriptor-based engine replaces GIO wherever both ends are native paths:
It runs on worker threads, opens everything beneath pinned folders, and never replaces an entry. GVfs locations keep GIO.
Only complete copies appear.
O_TMPFILEand linked to its name when done..strata-copy-*stage, which is safe to delete, and published through the step 1 ladder.Data:
FICLONE, then chunkedcopy_file_range, then read/write. Networkcopy_file_rangeis gated on the kernel releases with the NFS, FUSE and SMB fixes, and NFS requests are capped at 2 MiB.Metadata:
user.*xattrs survive on read-only items.Names:
Makefileandmakefileon FAT, exFAT, SMB or casefold) are saved asmakefile (1)and reported. Undoing the move gives the name back.Hard links stay linked within one copied item where the destination keeps them.
Special files: named pipes are recreated, while sockets and devices are left out and reported.
Merges never overwrite.
Moves that copy delete a source entry only if it still matches what was copied:
Durability: nothing that only the copy holds is deleted before the destination is flushed. That covers move sources, Replace originals, merge set-asides, archive originals and restored Trash copies.
syncfs; vfat and exFAT also need a folderfsync, and SMB and other FUSE mounts sync each file.Trash restore copies through the engine where nothing can place the item.
.trashinfoand is reported.Undo of a merge or Replace keeps later edits.
.trashinfo, and the dialog says so.Completion report: one event carries renamed, left-out and left-behind items.
Responsiveness:
Docs and lab:
docs/filesystem-compatibility.mdgains a "Copying" section and the residual limits; the lab's flush and claim measurements are in a comment on this PR.scripts/fslabnow counts device cache flushes per mount.Speed on the lab (2,000 × 1 KiB, debug build): vfat with
flush, 26 s against GIO's 208 s; sshfs, 2–12 s against about 100 s; the rest on par. On exfat-fuse and ntfs-3g, a 300-file move went from about 300 device flushes to 2.Decisions taken with the owner during step 2:
Decided by the lead along the way:
cp --sparse=auto;Step 3: mount profile and names
fuseblk, andstatfs's name length. It is cached with the mount's capabilities and kept for a whole operation. GVfs locations, and their folders under/run/user/$UID/gvfs, get rules by address.< > : " \ | ? *and control characters become_, trailing dots and spaces are dropped, malformed UTF-8 becomes_.CONbecomesCON_wherever Windows rules apply.aux.candcon.txtkeep their names on FAT, exFAT and ntfs3 (the Windows 11 rule), and get_on ntfs-3g, ntfs3 withwindows_namesand SMB without POSIX.fuseblk, unknown types) remember what worked. If none works, the error reads "The name isn't valid at this location" or "The name is too long", naming the item.10_00 (2)/), retries refused names, leaves out links and hard links to them, reports, and finishes.smb://without GVfs) fails with the backend message, where GLib ended the process (no UI route to it was found).noserverino), type, birth time, size and time identify the copy. Kernel exFAT moves a folder's birth time at each rename into it, so there folders count by type.fuseblk: files are linked, folders renamed once the name is found free, so nothing is copied./tmp, so copy tests getO_TMPFILE; tests that force the named stage cover the fallback. Its kernel is 6.6, so the seam links unnamed files as Linux 6.10 does on every host, and rows that replace a fresh copy wait for a later birth tick.docs/filesystem-compatibility.mdgains a "Names" section; the lab's name measurements are in a comment on this PR.windows_names: every name landed as planned, servers listed what the client sent, and exfat-fuse got no malformed, forbidden or overlong name. Its gaps are fixed above and were rechecked there.local_operations::was rerun on all 14 mounts. Every failure left is a fixture or preset the mount can't hold, or a known limit.Decisions taken with the owner during step 3:
/run/user/…/gvfsincluded;smb://rename crash is fixed here;/tmpfor CI's test container.Decided by the lead along the way:
_, not U+FFFD;CON_, not__CON;name (2); a broken link at the target counts as a conflict;fuseblkmount gets the ntfs-3g long-name rule;Steps 4–8 continue in the follow-up PR #1729, tracked in #1590.
Known limits:
NOREPLACEis enforced only on the client.closetimeo, 1 s by default). Strata retries for that plus 0.5 s, at most 10 s; a writer that keeps the file open still fails the copy.(1)for case pairs.EIO,ETIMEDOUT) to the rename over a placeholder: on sshfs and vboxsf, where an inode number can't tell the placeholder from the moved item, the empty placeholder can remain and the item is reported as unconfirmed rather than guessed; on NFS and other mounts with stable inode numbers, a placeholder still in place proves the rename failed, so it is removed and the error reported.[email protected]: nothing can be renamed over a placeholder. Moves and copies fall back to copying, as before; file renames, archive publication and setting a file aside are refused.MAX_PATHis not predicted.Makefileandmakefileapart.aux.corcon.txt, which FAT, exFAT and ntfs3 keep.iocharsetand withoututf8, exFAT or cifs with a non-UTF-8 code page, and msdos. udisks never mounts these.c:notesis refused as a drive prefix..strata-copy-*stage left by a crash or an unplug stays until it is deleted (step 8).smb://andmtp://, a Windows SFTP server's refusals, and extraction into a 237-unit folder name on ntfs-3g.Edge cases by filesystem
Every filesystem edge case this PR handles, against
mainat the merge base (e7e43f2a). Rows under Any filesystem apply everywhere; the groups below list only what differs.Any filesystem
RENAME_NOREPLACEis rejected (#1530)EINVALfrom a renameNOREPLACEis missing), then the source deletednoserverino), type, birth time, size and time identify it (exFAT folders: type alone)NOREPLACE) and merges wrote at real namesO_TMPFILElinked when done on local POSIX filesystems, otherwise a hidden.strata-copy-*stage.strata-replacement-*stage, or a half-written file under its final name.strata-copy-*stage, documented as safe to deletea:bonto a stick holdinga_b)a_b; Replace, Merge and Keep Both act on that nameNOREPLACE), even for a move within one filesystemRENAME_EXCHANGE, the original deleted at once; elsewhere failed after the full copyOVERWRITEinto the live folderrename(): an item created in between is replacedx.asx; ntfs3 kepta:b)NOREPLACEis missing.trashinforemoveduser.*on 0444); named pipes refused; Trash copy deleted unflushed.trashinfo, reported. A cancel mid-copy ends as a cancel with nothing partial leftNOREPLACEor a hard link per file, refused elsewhere; compression published on the UI threaduser.*xattrs on read-only itemsMakefile,makefile)makefile (1)and reported; undoing a move gives the name backa/notes.txt,b/notes.txt), or case pairs on SMB (nocaseor not) and casefolded ext4notes (1).txtormakefile (1)before copying and reported; copied into the folder of one, the other is asked about; three or more all land\,:)_, trailing dots and spaces dropped,CON_, malformed UTF-8 as_) and reported; undoing a move gives them back(n)~/stickinto/run/media/…)EIO,ETIMEDOUTafter the step happened)copy_file_range, splice, read/writecopy_file_range(gated per network filesystem and kernel), then read/writeNFS (v3 and v4.x)
CREATE,MKDIR,LINKrepliesCOPY: about 3 s for any file over 2 MiBcopy_file_rangein chunks of at most 2 MiB, from Linux 5.9syncfs(commits to the server)SMB/cifs
Reserved-name, Windows-character and symlink rows: shares without POSIX extensions.
EXCHANGE); Merge refusedcopy_file_rangeon any kernelcopy_file_rangeonly on kernels with the client's 2023 fixes (6.7, 6.6.7, 6.1.73)fdatasyncof each written file (an SMB FLUSH)closetimeo); the copy failedclosetimeoplus 0.5 s, at most 10 snoserverino, or server inode numbers turned offCONasCSHOFG~F)CONandaux.csaved asCON_andaux_.c, reported:and other Windows characters, trailing dots and spaces (mapposix)_or dropped, and reportednocaseshares_; reported?for each bad byte, unreported_, such links left out; reportedsshfs and other libfuse daemons without `use_ino`
posix-renamefdatasyncof each written file, thenfsyncof the folderexfat-fuse
EXCHANGEsilently overwrote: the original destroyedNOREPLACE, no links)syncfs, which flushed nothingsyncfsplus one folderfsyncper batch; otherwisefdatasyncper file plus the folder:and other Windows characters; malformed UTF-8/or a surrogate broke the listing or crashed the daemonENOSYS)ntfs-3g
syncfs, which flushed nothingsyncfsplus one folderfsyncper batch; otherwise per filewindows_names)con.txtsaved ascon_.txt) and reportedfuseblkmount udev can't name)ntfs3
EXCHANGE)$LX*attributes$LX*never copied; restore copies passsyncfs, which flushes the devicewindows_names, copy failed_;CONasCON_,aux.ckept; withwindows_names, every device name fixedvfat
EXCHANGE, the original deleted at onceEXCHANGE; the original deleted only after the flushCONtoo), reported, given back by undo; names needing no change keptsyncfs, which flushed nothingsyncfsthen a folderfsync, which flushes the driveexFAT (kernel)
EXCHANGE)syncfs, which flushed nothingsyncfsthen a folderfsyncext4
fsyncper top-level fileO_TMPFILE, linked when complete: a crash leaves nothing; nofsyncfor plain copiesEXCHANGE, the original deleted at onceEXCHANGE; the original deleted only after the flushsyncfsCasefolded ext4
btrfs and XFS
syncfssubvol=mounts (no Trash)tmpfs
EXCHANGE, the original deleted at onceEXCHANGE; the original deleted after the flushZFS
overlayfs
redirect_dir)syncfsvboxsf, rclone, s3fs
fdatasyncper file plus the folder; vboxsf: per file plussyncfs9p, ceph
fdatasyncper file plussyncfsGVfs locations (`smb://`, `sftp://`, `mtp://`)
smb://andmtp://smb://andmtp://Visual evidence
Pending upload: none of these captures, taken on a private headless display, is attached yet.
Step 2 (end of step 2; step 1 changed no layout):
Makefileandmakefileonto a case-insensitive folder fails with "An item with that name already exists".After: a notice says the destination can't tell these names apart and
makefilewas saved asmakefile (1).After: the pipe is recreated, and "Completed with errors" lists the two sockets as left out.
After: "3 items were left in their original folders". The reasons are a log written during the move, a socket, and a file in a read-only folder.
Step 3 (After only). The "stick" is a RAM folder that a capture-only patch, not in this PR, reads as vfat, so it shows Strata's own planning:
Agenda.mdbesideagenda.md: "Names changed for different reasons", adding "The destination can’t tell these names apart".How to test
Step 1
scripts/fslab/fslab.sh upprovides both inside a container. On that mount, move a large file and a folder into another folder.Expected: the moves finish instantly without copying.
Expected: the item is swapped, with no "unexpected system error" and no second copy pass.
notes.txttoNotes.txtwith F2, then undo.Expected: both succeed.
Step 2
srcto another folder on the same disk, then to another disk.Expected:
rokeeps mode 555, its 2001 time anduser.note.aandbshare one inode wherever the destination keeps links.pipeis a FIFO.sparse.imgtakes almost no space on ext4, btrfs or tmpfs.sockas left out.Makefileandmakefileto a vfat or exFAT stick.Expected:
makefile (1)appears on the stick, with a notice. If you move the folder there instead and then undo, both names come back.while :; do date >> ~/t/live/log.txt; sleep 0.2; done, then move~/t/liveand a few other files to another disk.Expected: everything else moves.
log.txtstays, with a warning that it changed during the move.Expected: they copy in parallel, "Writing to device…" shows at the end, and every file arrives.
Expected: no partial or truncated item under a real name.
scripts/fslab/fslab.sh test local_operations::repeats the unit tests on every lab mount.Step 3 (a throwaway USB stick, or the lab's mounts)
namesto a vfat or exFAT stick.Expected: the stick holds
10_00,notes,CON_,aux.c,report_.txtandcaf_.txt. "Completed with errors" lists each fixed name with its new one, andlinkanddanglingas symbolic links left out.~/t/names/10:00into the stick'snamesfolder.Expected: the prompt opens with "“10:00” will be saved as “10_00” in this location." Keep Both adds
10_00 (1). Cut and paste the same file: Keep Both is offered for the move, and Ctrl+Z moves it back.~/t/namesfolder onto the stick again.Expected: the merge prompt ends with "Items whose names change to suit this location overwrite items with the new name." Merging puts the old
10_00in the Trash, and Undo restores it.x:y, then tonotes., then create a folder namedCON(F2 and New Folder, then r and a in 10xer mode).Expected: each is refused with "Names in this location can’t contain “:”", "Names in this location can’t end with a space or a period", or "“CON” is a reserved name in this location". Nothing changes, and the 10xer prompts stay open. The same names are accepted on ext4.
python3 -c 'open("中"*100 + ".txt", "w")'in the stick's folder), then copy it to your home folder.Expected: it arrives as 83 characters plus
.txt, listed under "These names were too long for the destination".tar -cf ~/t/names.tar -C ~/t names, then Extract to… the stick.Expected: a numbered
namesfolder whose members have the names step 10 gave them; the links are left out, the report lists both, and the extraction completes.namesfolders from the stick and the two links from~/t/names. Move~/t/namesto the stick, then undo.Expected: every original name (
10:00,notes.,CON,report?.txt,caf\xe9.txt) is back in~/t/names, and nothing is left on the stick.ln -s 10:00 ~/t/names/link) and move~/t/namesto the stick again.Expected:
linkand itsnamesfolder stay in~/t, reported as left behind, and the report says “Undo can’t move these items back…”, namingnames.notes.txtin two foldersaandb(for example in search results), copy both to a third folder, then intoa.Expected: the third folder gets
notes.txtandnotes (1).txt, with a notice under "These names were already taken". Ina, onlyb's file prompts; Keep Both addsnotes (1).txt(the duplicate) andnotes (2).txt(b's).aux.cstays,CONbecomesCON_, links are copied. ntfs-3g:aux.cbecomesaux_.c; a folder of 240dcharacters moves within the drive and takes an F2 rename at once, with no stray entry.aux.cbecomesaux_.c, links are left out, a 220-byte folder name is cut to 213, andMakefileandmakefilefrom two folders becomeMakefileandmakefile (1). Move a folder there, open it and undo at once: all of it comes back.sftp-serveryou have paused withkill -STOP.Expected: a copy's docked row soon shows "Preparing items…" with Cancel and no count (a move shows a dialog), and Cancel abandons the paste without a prompt.
Related issue
Closes #1530
Refs #1590 (steps 4–8 continue in #1729)