381 Commits

Author SHA1 Message Date
Miroslav Crnic
636f10e0b4 kmod: take snapshot edges into account for rename idempotency 2026-02-03 13:33:33 +00:00
Miroslav Crnic
68b1d67ac8 kmod: fix connection timeouts 2026-01-13 10:37:33 +00:00
Miroslav Crnic
e21416b0a7 relaxed move idempotency requirements
We used to only check if the move operation happened if we retried.
With multiple regions which can retry independently, detecting if we
retried from client becomes unreliable.
In this change we relax the idempotency check to succeed if the requested
operation succeeded and the creation time of the new edge is "close enough"
to current time. Currently close enough is 1 minute.

Previously if 2 clients tried to move the same file to the same target
concurrently, one would succeed and the other would get edge not found.
With this change, both may succeed if they are close enough in time.
2026-01-12 13:47:04 +00:00
Miroslav Crnic
94428b6bd4 kmod: support kernels up to 6.14 2026-01-09 16:21:15 +00:00
Miroslav Crnic
39784ef9a8 kmod: block socket refcount fix 2026-01-09 13:13:25 +00:00
Miroslav Crnic
768072e054 kmod: remove block service cache
With reduced span cache time the block service cache
is no longer needed. We also don't need to fetch
changed block services from registry as we'll get
it as part of span fetches.
2025-12-09 15:34:09 +00:00
Miroslav Crnic
d05a360e8b kmod: fix socket leak 2025-12-09 14:34:37 +00:00
Miroslav Crnic
24adfa4259 kmod: fix socket ref count 2025-12-09 12:48:11 +00:00
Miroslav Crnic
6157fec043 kmod: block.c fix queue races 2025-12-08 11:06:04 +00:00
Isabella Bosia
c0039428e3 unify send recv loops (#76)
* kmod: unify recv loops

* kmod: unify send loops

* kmod: make control flow explicit
2025-11-27 11:16:33 +00:00
Miroslav Crnic
59e1f291af kmod: fix some resource leaks 2025-11-26 20:05:16 +00:00
Miroslav Crnic
5b9e1b0439 kmod: remove GFP_ATOMIC from socket
There were other issues writing from sk_write_space callback, but this
was not cleaned up when writing from sk_write_space was removed.
2025-11-18 09:17:12 +00:00
Miroslav Crnic
01cee15980 kmod: fix unsafe span rb tree erase 2025-11-10 13:41:36 +00:00
Miroslav Crnic
5b1a1351e2 kmod: cache inline spans indefinitely 2025-11-07 13:37:47 +00:00
Miroslav Crnic
0436fe878c kmod: configurable span cache retention 2025-11-07 10:26:10 +00:00
Miroslav Crnic
398af8d3cd kmod: memcmp ternfs_block_service 2025-10-27 10:50:10 +00:00
Miroslav Crnic
b744242b5a kmod: dont compare block service padding when upserting 2025-10-27 10:19:37 +00:00
Miroslav Crnic
d4cb2d50cb kmod: need to check if ok to splice page 2025-10-21 22:53:59 +01:00
Miroslav Crnic
7758eb8938 kmod: synchronously fetch policy on dir inode lookup 2025-10-19 12:14:46 +01:00
Miroslav Crnic
8cec8bcf6b kmod: delete files immediately if policy allows 2025-10-15 22:58:58 +01:00
Miroslav Crnic
ffe3416f16 kmod: minor write path fixes
* kmod: minor write path fixes

We didn't actually see these happen in production.

Fix 1:
From kernel code it looks like copy_page_from_iter can not return 0 in
normal cases but our code should still cover the case if this changes in
the future.

Fix 2:
-ENOMEM was other error where we could write things partially in which
case we would not return written and we would end up at wrong offset.
It's simpler to just return written if we managed to write anything
and surface the error on subsequent call in which we will fail early.

* kmod: add BUG_ON for unexpected span pages
2025-10-10 16:03:43 +01:00
Miroslav Crnic
bad26576a8 kmod: dont revalidate past fs boundary 2025-10-05 19:19:05 +01:00
Francesco Mazzoli
3aff31a026 Unbreak old kernels 2025-10-03 16:36:19 +00:00
Francesco Mazzoli
75b3808a0e Remove sysctl sentinels
You shouldn't put it from 6.11 onwards and in fact they mess things
up with CONFIG_RANDSTRUCT.

See <https://github.com/openzfs/zfs/issues/16620>
2025-10-03 11:08:45 +01:00
Francesco Mazzoli
6e46e9bf1c Start logging stuff before inserting module 2025-10-03 11:08:45 +01:00
Francesco Mazzoli
03a2a08ec9 Linux 6.12 2025-10-03 11:08:45 +01:00
Francesco Mazzoli
7a7a43ff14 Streamline block reads, do CRC more on the fly.
This is in preparation with a deeper refactor of reading from Go
in general. The big difference that we have now which we did not
have before is that we now have CRCs for every single page.
2025-10-01 14:14:44 +01:00
Miroslav Crnic
094225bac6 kmod: only invalidate dir dentry if needed 2025-10-01 09:06:58 +00:00
Miroslav Crnic
f5d296843a kmod: dont sync_cancel from interupt 2025-09-25 14:32:01 +00:00
Miroslav Crnic
5df6597c5c kmod: fix populating from page cache 2025-09-25 14:04:20 +00:00
Miroslav Crnic
75d408df0e kmod: support setting minor version in dkms package 2025-09-25 11:08:31 +00:00
Miroslav Crnic
c54e7b1c1e kmod: fix incorrect unmap in rs 2025-09-24 15:39:35 +01:00
Miroslav Crnic
14668d8239 kmod: ci use correct target, updated README 2025-09-24 10:53:46 +00:00
Miroslav Crnic
b5705c877c kmod: return target used by dkms, add comment 2025-09-24 10:03:08 +00:00
Francesco Mazzoli
d5a45d66b7 Run bincode tests in docker if requested, clean up ci.py
Fixes #41.
2025-09-23 23:50:38 +01:00
Miroslav Crnic
f1c7b19ce1 kmod: cleanup Makefile 2025-09-23 09:38:12 +01:00
Francesco Mazzoli
136d55bff0 Cleanup CRC32C code
Specifically:

* Extend tables so that they won't wrap around wrongly for big sizes
    (we would never hit this since our blocks are at most a few MBs
    big).
* Use CRC instructions to compute remainders.
2025-09-21 22:22:22 +01:00
Francesco Mazzoli
3cc97366c2 Disable seek to extend test on kmod
We currently implement seeking incorrectly there, while FUSE is now
as it should be. We should fix kmod and then re-add the test.
2025-09-18 18:09:43 +01:00
Joshua Leahy
7a4e466ac6 Make TernFS open source 2025-09-17 18:20:23 +01:00
Miroslav Crnic
6edd7bdd6a registry 2025-09-17 13:43:42 +01:00
Miroslav Crnic
8c75dd0d89 registry: changes to core/messages 2025-09-17 09:07:14 +00:00
Miroslav Crnic
54caa4338b kmod: add refcount to spans 2025-09-10 19:06:23 +01:00
Miroslav Crnic
2b60d4aa3b kmod: check PageUptodate when getting from cache 2025-09-09 13:28:44 +00:00
Miroslav Crnic
92d25d04da shuckle: rename to registry prepare for replace 2025-09-08 08:59:08 +00:00
Francesco Mazzoli
56d5d01ae5 Add kmod CI 2025-09-08 08:44:37 +01:00
Miroslav Crnic
361794577c kmod: fixes for 6.8 2025-09-05 12:08:23 +00:00
Miroslav Crnic
be5ebc6a79 kmod: quick support for kernels up to 6.8 2025-09-04 12:12:56 +00:00
Miroslav Crnic
6304029894 kmod: abstract spans struct 2025-09-04 12:11:49 +00:00
Miroslav Crnic
f1d0b649f1 kmod: break metadata span dependency 2025-09-04 12:08:37 +00:00
Miroslav Crnic
c007b763dc kmod: dkms support 2025-09-04 11:58:40 +00:00