From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.223.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 26AED33343F for ; Thu, 19 Feb 2026 08:21:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=195.135.223.131 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771489297; cv=none; b=XKgOPAWTQ5rDGIaSAxKZ1aNp4obWlcJ3mRD/M9yX3nkZHZ+X98979+lN5Yx54OcA/XVqMkc4WuMZkzaaPnVRk8M3e50Us98EXdkPXTT/tO3SMUJYmU2+SO9St95eN3iV+IPq5hwBZM1LUr9wYLYf137dh/Sa4Av1GFhONyDUxYA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771489297; c=relaxed/simple; bh=mgqGcFo6J2Xh9nou093RMS6OO0TS2OcLAh2tKqhFFP8=; h=From:To:Subject:Date:Message-ID:MIME-Version; b=mbwtypgcqlwCbftd8YJypPMfk6ZDnOA3oewI71I5rIEW+6KlS+IuGqRDEd579EtEbkhBQXZu/ZIsOZViALtfB75mWgPCl8BacyX45tRecYaX311DIQkiNqDZeLQCHyJbeJSxfJ1luCsAVTadfoR0gSd27354JuXEAHsVOILbB8g= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com; spf=pass smtp.mailfrom=suse.com; dkim=pass (1024-bit key) header.d=suse.com header.i=@suse.com header.b=jfy48cbT; dkim=pass (1024-bit key) header.d=suse.com header.i=@suse.com header.b=PeCuXevF; arc=none smtp.client-ip=195.135.223.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=suse.com header.i=@suse.com header.b="jfy48cbT"; dkim=pass (1024-bit key) header.d=suse.com header.i=@suse.com header.b="PeCuXevF" Received: from imap1.dmz-prg2.suse.org (unknown [10.150.64.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 61D4F5BCC3 for ; Thu, 19 Feb 2026 08:21:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1771489294; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=sTi3BlaIA5/Gfya0DWBcnnGqlsKSt/UnGnaZpDDhfro=; b=jfy48cbTvTPfm4EaqwtPsxhz5mrhjnbV+LDgEJh4y3rV47/YHhK/fvgZL67f74mYkwEiSc a+0kgqJ/0u0Mbu+v+JoehuRdSk/s7TXcHKthw4gTPr8oiaemckjjoCZiMSU71QmRu6hJaU rquQKZM7MjcqHDa8uBnOPe4cQLVdvj0= Authentication-Results: smtp-out2.suse.de; none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1771489293; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=sTi3BlaIA5/Gfya0DWBcnnGqlsKSt/UnGnaZpDDhfro=; b=PeCuXevFMpyYcMM2panWRFGoYfzqNXm0Qkk9jPZ77MKmMYYrwR/vp24y2HRSyP0PUDaGHf rssZR9Xrgqn13OJuFtzaoEc//LmkIChpZWM7/tq4FhP6NerDX/lbN3zSBUzv9DWUdw0i6P 2hT+I+R/ZS7rLYZrcwUcJWjcIG/RxKI= Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id 936023EA65 for ; Thu, 19 Feb 2026 08:21:32 +0000 (UTC) Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167]) by imap1.dmz-prg2.suse.org with ESMTPSA id tKRdFQzIlmkYZAAAD6G6ig (envelope-from ) for ; Thu, 19 Feb 2026 08:21:32 +0000 From: Qu Wenruo To: linux-btrfs@vger.kernel.org Subject: [PATCH v2 0/4] btrfs: fix all bugs introduced in the compressed_folios[] removal Date: Thu, 19 Feb 2026 18:51:10 +1030 Message-ID: X-Mailer: git-send-email 2.52.0 Precedence: bulk X-Mailing-List: linux-btrfs@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.80 X-Spam-Level: X-Spamd-Result: default: False [-2.80 / 50.00]; BAYES_HAM(-3.00)[100.00%]; MID_CONTAINS_FROM(1.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; R_MISSING_CHARSET(0.50)[]; NEURAL_HAM_SHORT(-0.20)[-0.999]; MIME_GOOD(-0.10)[text/plain]; FUZZY_RATELIMITED(0.00)[rspamd.com]; RCVD_VIA_SMTP_AUTH(0.00)[]; RCPT_COUNT_ONE(0.00)[1]; ARC_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; DKIM_SIGNED(0.00)[suse.com:s=susede1]; URIBL_BLOCKED(0.00)[imap1.dmz-prg2.suse.org:helo,suse.com:mid]; FROM_EQ_ENVFROM(0.00)[]; FROM_HAS_DN(0.00)[]; DBL_BLOCKED_OPENRESOLVER(0.00)[suse.com:mid,imap1.dmz-prg2.suse.org:helo]; RCVD_COUNT_TWO(0.00)[2]; TO_MATCH_ENVRCPT_ALL(0.00)[]; TO_DN_NONE(0.00)[]; PREVIOUSLY_DELIVERED(0.00)[linux-btrfs@vger.kernel.org]; RCVD_TLS_ALL(0.00)[] X-Spam-Flag: NO [CHANGELOG] v2: - Fix an unaligned bio size on x86_64 triggering btrfs/333 We can still have an unaligned size for the encoded write, in that case we still need to roundup the bio to fs block boundary. I'm a total idiot, that my usual 64K page sized arm64 VM is configured back to use 4K page size for bs > ps runs, but forgot to revert the config back. This makes all recent arm64 runs use 4K page size, making it almost no different than x86_64 runs. This means the recent compressed_folios[] cleanup is not really properly tested for bs < ps cases at all. Thus all the regressions are not properly detected during the development. In fact commit e1bc83f8b157 ("btrfs: get rid of compressed_folios[] usage for encoded writes") introduced two bugs in just one go, one can even lead to data corruption for bs < ps cases. All bugs are caught by dded ASSERT()s, but some ASSERT()s are just incorrect in the first place, like patch 2~4. Meanwhile the first one can lead to data corruption if CONFIG_BTRFS_ASSERT is not selected, thus it will need higher priority. Again, very sorry for my super stupid arm64 kernel config error. Will no longer run 4K page sized kernel on that VM any more, and deploy a new VM for 4K page sized tests, with proper kernel string suffix to indicate the page size in the future. Qu Wenruo (4): btrfs: fix a bug that makes encoded write bio larger than expected btrfs: do not touch page cache for encoded writes btrfs: fix an incorrect ASSERT() condition inside zstd_decompress_bio() btrfs: fix an incorrect ASSERT() condition inside lzo_decompress_bio() fs/btrfs/compression.c | 11 ++++++++--- fs/btrfs/inode.c | 7 ++++--- fs/btrfs/lzo.c | 4 ++-- fs/btrfs/zstd.c | 2 +- 4 files changed, 15 insertions(+), 9 deletions(-) -- 2.52.0