From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pf1-f182.google.com (mail-pf1-f182.google.com [209.85.210.182]) (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 AFBAE2C21F7 for ; Wed, 31 Dec 2025 02:55:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.182 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1767149728; cv=none; b=JWmIbCCxAK3TQd4PtmEsR4jn2iXguPwheSGSrukH29oNSnOjhFCwxpMAr7bdorGnbjLA8O+IocKppe5n/M1zNiP+Y4M9ZACGRz1g3jT9nEiU3dyqWORm2J0jyCf6TZl2nNr+yYXntFyiSe3/DSfgrAMimpU4a9jKzvW7xLNg5Xg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1767149728; c=relaxed/simple; bh=Zorh6RDiWXFx7n1uq6Eunja7kW8xgLmN/y3XdftI94A=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=cyRk/XyCQV2QDki7JYToFQNNLJ14cnv08lDy7PgZqP/+C6CgdjJ2InIvGl0OqyneeYV4usHbwwZknIMsR9/teF1eANekr8A2UIdfcDHb+wc4t6YeNoE27+JTvOIo3bsN5L8gZYVSTCS4hzrErjHB+noEQi+38pTOJv2q1PL3+SE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=R8CpJqMD; arc=none smtp.client-ip=209.85.210.182 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="R8CpJqMD" Received: by mail-pf1-f182.google.com with SMTP id d2e1a72fcca58-7acd9a03ba9so10951110b3a.1 for ; Tue, 30 Dec 2025 18:55:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1767149726; x=1767754526; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=S4GTZxO1uyRXJwq1paEZPsZtu4eJgyeWyJzjBUHckVg=; b=R8CpJqMD8chA2rY/XBr66Z84s01Qm2nFBGPVqoFm1o/eZEi/fls7AFp4ZITVIY9vvG cTn5+Jit4OgW27Y7WL96rsyzAHoVtk6UFxkorP/d89Qe989smYq10pcYxuqDRen03JUo 0MwhSJ6/esfXVYFvitaBWWEzdTZBL5yc4AxrkuL+fKV/qDLc4ZG4WSmyPI2mJOWndbq9 kCwuhb4DeBvb7XfHwb6O2tvJDHDsSKHUnTi6Q+opS2TW6BgE06PSWWZRV9iTju4kMosp 1X1/JGDsIfOuLlnqZ8ROw3wChOotNAdi6GjoVDx8wt8T1EfujtxK1e99gx28c0Qdpy/1 WBbA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1767149726; x=1767754526; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=S4GTZxO1uyRXJwq1paEZPsZtu4eJgyeWyJzjBUHckVg=; b=alB6cTu8UV4PgdtdZuBvNV8P37m90z622sFmfYUw5HSGNWb9c7sr6rNrryokT1mdiu Zy18FbAkU71Q3oRJ+I43jscYG0ALP4pnoI3Fz3WDae4j+/OdmJ2hklE5tKhj1FC9NHB+ Q3kgn/+3OveIqMxiWDKsCzqKwjnMSiCuHqfwXOEfJmH8R7suqPq1w/GSV8bQYCi2URMx WeLPG+afaXFQdxGsKuTJS8P0NDZ9daHw5ZERxI234gJoZlQtsuHluLpnTcWBVWjLhIk7 SQEUxZ6QTSFCvul76oRffixRj/GCWnOHwunSZCKbuoElaWlcalgIZjKGk7FjBjHL1w7j vQdA== X-Forwarded-Encrypted: i=1; AJvYcCUnvw2Mp74UsUpaFK7aYuufquW3nRXq8R87gLmwxCb6R9Ol68gzwCRmri1DHIL8JtYu29ggPXwrliDyblA=@vger.kernel.org X-Gm-Message-State: AOJu0YzHo0p0ytPniXuAAvJx3ZVmbZyuMq4g0Ug4Nk7iVi5/xtt2fsZX 4ipPwEMZn4UJw5ulu/5Qc31sQR+0uTcUKqeaxm14WYA1fGhJLPH+sCFy X-Gm-Gg: AY/fxX6MWxs033jsKzQ5s3bZXK92wWrokAWfbK/negThp3HEt0j8y88sgUJP6hqEC/E +gacH7/97iTOvLhlz2ShEOgw3cVqTEQ3FcLHuBrd0I/GztjLaznPrfrrvpnAL2CoAIzEQWr1bQk BjQkSs0g/SC+gm9ggKBUjBogwJP6o/mmJPjmw/urNiRXfM0T81LgDTW7ukX0cg/WODqte41eKFC Bp76g/pEme21wuxhSqQD5PRAWlJbjn3xSnTx4ULoUbrii5KlzSrhUso3obWvZ3x8d4F/MY0sIE9 8AOAeDftta7Vw6xoTVZn30JVDenhH9jUb0ryDZhtrCWyZoQ4POD7oKNEj9OgUPPvHx2uwkJHHMs CnT5vevTv6w6WbTuxJC4G+sXbc30Wby10fQH/x4WWV8kjOuG4sQyXgyIr0JCRj2ojeroGMwXEh9 MZHA== X-Google-Smtp-Source: AGHT+IHIkmqmRrGCLBKZvBbVdd6zUHkLIRD/E+oRXUHK8Ex5ZIyBH+1YOzgk1LR9mate3HbDtaJYlw== X-Received: by 2002:a05:6a00:6e87:b0:7ff:97b3:59bb with SMTP id d2e1a72fcca58-7ff97c29c6dmr25379340b3a.16.1767149725837; Tue, 30 Dec 2025 18:55:25 -0800 (PST) Received: from celestia ([69.9.135.12]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-7ff7e892926sm33623646b3a.66.2025.12.30.18.55.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 Dec 2025 18:55:24 -0800 (PST) From: Sam Edwards X-Google-Original-From: Sam Edwards To: Xiubo Li , Ilya Dryomov Cc: Viacheslav Dubeyko , Christian Brauner , Milind Changire , Jeff Layton , ceph-devel@vger.kernel.org, linux-kernel@vger.kernel.org, Sam Edwards Subject: [PATCH 0/5] ceph: CephFS writeback correctness and performance fixes Date: Tue, 30 Dec 2025 18:43:11 -0800 Message-ID: <20251231024316.4643-1-CFSworks@gmail.com> X-Mailer: git-send-email 2.51.2 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Hello list, This series addresses several interrelated CephFS writeback issues, particularly for fscrypted files. My work began with a performance problem: encrypted files caused a write storm during writeback because the writeback code was inadvertently selecting the crypto block instead of the stripe unit as the maximum write unit size. While testing that fix, I encountered a correctness bug: failures to allocate bounce pages during writeback were incorrectly propagated as batch errors, which trigger kernel oopses/panics due to poor handling in the writeback loop. While investigating that, I discovered that the same oopses could be triggered by a failure in ceph_submit_write() as well. The patches in this series: 1. Prevent bounce page allocation failures from aborting the writeback batch and causing a kernel oops/panic due to the page array not being freed. 2. Remove the now-redundant error return from ceph_process_folio_batch(). 3. Free page arrays during failure in ceph_submit_write(), preventing another path to the same kernel oops/panic. This was not an issue I encountered in testing, and it is tricky to trigger organically. I used the fault injection framework to confirm it and verify the fix. 4. Assert writeback loop invariants explicitly to help prevent regressions and aid debugging should the problem reappear. 5. Fix the write storm on fscrypted files by using the correct stripe unit. Note that this series follows a "fix-then-refactor" cadence: patches 1, 3, and 5 fix bugs and are intended for stable, while patches 2 and 4 represent code cleanup and are intended only for next. Wishing you all a prosperous 2026 ahead, Sam Sam Edwards (5): ceph: Do not propagate page array emplacement errors as batch errors ceph: Remove error return from ceph_process_folio_batch() ceph: Free page array when ceph_submit_write fails ceph: Assert writeback loop invariants ceph: Fix write storm on fscrypted files fs/ceph/addr.c | 35 +++++++++++++++++++---------------- 1 file changed, 19 insertions(+), 16 deletions(-) -- 2.51.2