[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <308528.1754868563@warthog.procyon.org.uk>
Date: Mon, 11 Aug 2025 00:29:23 +0100
From: David Howells <dhowells@...hat.com>
To: Enzo Matsumiya <ematsumiya@...e.de>
Cc: dhowells@...hat.com, Steve French <sfrench@...ba.org>,
    Paulo Alcantara <pc@...guebit.org>,
    Shyam Prasad N <sprasad@...rosoft.com>, Tom Talpey <tom@...pey.com>,
    Wang Zhaolong <wangzhaolong@...weicloud.com>,
    Stefan Metzmacher <metze@...ba.org>,
    Mina Almasry <almasrymina@...gle.com>, linux-cifs@...r.kernel.org,
    linux-kernel@...r.kernel.org
Subject: Re: [RFC PATCH 00/31] netfs: [WIP] Allow the use of MSG_SPLICE_PAGES and use netmem allocator
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)
Powered by blists - more mailing lists