Re: [RFC PATCH 00/31] netfs: [WIP] Allow the use of MSG_SPLICE_PAGES and use netmem allocator

From: David Howells
Date: Sun Aug 10 2025 - 19:29:45 EST


Hi Enzo,

I now have encryption, compression and encryption+compression all working :-)

I've pushed my patches here:

https://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-fs.git/log/?h=cifs-experimental

It should work up to "cifs: Don't use corking".

Btw, is is_compressible() actually worth doing? It seems to copy a lot of
data (up to 4M) to an extra buffer and then do various analyses on it,
including doing a sort.

I need to extract a fix for collect_sample(), which I can do tomorrow, but it
should look something like:

/*
* Collect some 2K samples with 2K gaps between.
*/
static int collect_sample(const struct iov_iter *source, ssize_t max, u8 *sample)
{
struct iov_iter iter = *source;
size_t s = 0;

while (iov_iter_count(&iter) >= SZ_2K) {
size_t part = umin(umin(iov_iter_count(&iter), SZ_2K), max);
size_t n;

n = copy_from_iter(sample + s, part, &iter);
if (n != part)
return -EFAULT;

s += n;
max -= n;

if (iov_iter_count(&iter) < PAGE_SIZE - SZ_2K)
break;

iov_iter_advance(&iter, SZ_2K);
}

return s;
}

What's currently upstream won't work and may crash because it assumes that
ITER_XARRAY is in use - which should now never be true.

Also, there's a bug in wireshark's LZ77 decoder. See attached patch.

David

diff --git a/epan/tvbuff_lz77.c b/epan/tvbuff_lz77.c
index a609912636..13ab5c50ed 100644
--- a/epan/tvbuff_lz77.c
+++ b/epan/tvbuff_lz77.c
@@ -68,7 +68,7 @@ static bool do_uncompress(tvbuff_t *tvb, int offset, int in_size,
in_off += 2;
if (match_len == 0) {
/* This case isn't documented */
- match_len = tvb_get_letohs(tvb, offset+in_off);
+ match_len = tvb_get_letohl(tvb, offset+in_off);
in_off += 4;
}
if (match_len < 15+7)