From nobody Sat Feb 7 11:31:17 2026 Received: from mail-dl1-f49.google.com (mail-dl1-f49.google.com [74.125.82.49]) (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 9D1F82C3260 for ; Mon, 26 Jan 2026 02:31:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=74.125.82.49 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769394673; cv=none; b=jC9yPUa24CDuZkySer+UpBT4vGlywKNQaUpZA5p3NVxRLV+J0j/F8E2wXdF7Q57YmhtqeelISrtCkuybGGE6j2vxvyDuZhytBU1yVTSK95UQAW3ruzyGHZ4aDck32/ZZcwOu8FvwGstlFxWFCwbvIIG+3l5vXUZv06BES3wedzs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769394673; c=relaxed/simple; bh=kIfp2aymoeUL8Vy4cuQ54skcXO7OD2rR6MpqfXG/nX8=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=YZQQXetocp8rRmOr7DrVPCqXjNuQAEH1g1JxZ8nxrcxxicj5EF2RYq2I4gdsh7YMuCIh9WRy6p9nSe7NnYEO9c8wsasupRi5Q35ft8BjB/mnv+SRmEzoMUzgywI+JeknVtRUnBVHMW6hvFo7TDlD+LOllMAo+gb72PfDTjB9ujE= 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=T+4gBNoa; arc=none smtp.client-ip=74.125.82.49 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="T+4gBNoa" Received: by mail-dl1-f49.google.com with SMTP id a92af1059eb24-12332910300so6694325c88.0 for ; Sun, 25 Jan 2026 18:31:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1769394670; x=1769999470; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=eOLQh9MA9MhTdiXC4zX1NuDh2cfiEEMs3r95tMeAbNQ=; b=T+4gBNoaQrB48jeM4EELu+E0yjUU4C6hwNw5rgeg0cMSMmFMiIL4NswpdDYWrzSDCp cXRezwgX8VDh+aJFd1nymctgsQlw7dswZ1mivpH3yWl9ugqgPwdyuOSTZi6MU+jSb9uK kAVB6Y5mEFG5Mk5It0yr/Z0ayxYbThg7hkPJ0GPllAC+LeEAU/c5njiyAJfOKOldzzc+ dAzdidYUCqhodFIO4KwHC4yllNQZoEUpHwf4IcUX8rKpHeewDWP2LVACyU3B+NvSDtav Wn3hIzM5Iy69XR6MuuCOaND8DeIYgW6hi3SotEew113N/zUzoech6KRdE7raCdNHHeaw p4kw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1769394670; x=1769999470; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=eOLQh9MA9MhTdiXC4zX1NuDh2cfiEEMs3r95tMeAbNQ=; b=eKdF1qjFPD728t1qByxD9H9bmTCD37WNDXEkIipOf0cd4V7g343DaOc/7eF309udia wKmj5SCug+0pCUzmQ1/1UA2B5yfZItnUk3ujxFTdmmdzKUa7Ky7SvWclEyz8je8wHVrl nCx6CUcyWPtI/pnplA++uzMrCJ+JJqGoswhRtjfoqVJd3Qy20ELPmNObCGfhoxPpzvA+ /PCvNAjVygnJ8aeO7Ub0rgMFTkrfeCAgcdGYbNYI9CCEgwpwwWO7iz/hRxbZQCggGTVy mrwo4pVn2xfpiyZRPLMTs0fRvlP7qVJxJA4ovSKlEBmiClNErQPzvN2HeLkqFHtLmeyh ZZZw== X-Forwarded-Encrypted: i=1; AJvYcCViFbuhjXAHe1W0n4v+/cs4oLpsM6VIJVhQZpg3QuohwY9FsP2lrUnz0YTht6mrw/npuoQj4URbfwlm0aE=@vger.kernel.org X-Gm-Message-State: AOJu0Yw3gYr9Ag3jqOHVCKZBmGmmjjyHaykDaN+Alb/iWWJRN2BKGh+F sxwoFdLggxAKP7uPWTJVK+OKLLzeLJLCPU/S7XQnHcO20ozHJL0bvJ7i X-Gm-Gg: AZuq6aKpfem2/p+gZw2HJFPSBqBIMKHPt6QdBxIpG4+mKBsL6+BujukKYQKuvoJ3qLy XVtHWoPhajVppT9jaTl8vKnD/KF1HhQ/iCP4os4kwWGZlMciJNl5kbu/q2utM64LhWk8QawVCYC NgNrJC4fkWQ/5zEQUJ79tQ4Q/DYwvDlmwyOVLO/KEz8qI/75VPZ+yN1h5ZXrxrHFgDl9XN2RMdr /pV34rrhWvIl/vyrh6EfJYlPfhPC125TU9OKgQ5Tonh/QAaLafqd7bJRTi9A0EjyVK3yHNuJDfO X3Gbv4+jImoV8ewBJikHzD/WfkWIozlumTV9TPpaNJvbnHOlBeJMuDNd1BC0/Mnaq4g5ky8hXKk /UgSGp+b6BpCSSZ7NNeg6REWC3N9m+PMuo3YzAvb3qwOBSEjg4JHdCh8a15Imv/3tNyiIvl6rjF CEbMqjkFDt0f2dkHbDAl4X6JWoMl+1/mwhrmjjuDo5WNuZZmie8gsA X-Received: by 2002:a05:7022:923:b0:119:e569:fb91 with SMTP id a92af1059eb24-1248eb39492mr1853278c88.0.1769394669588; Sun, 25 Jan 2026 18:31:09 -0800 (PST) Received: from luna.turtle.lan (static-23-234-93-211.cust.tzulo.com. [23.234.93.211]) by smtp.gmail.com with ESMTPSA id a92af1059eb24-1247d91c52bsm17212277c88.6.2026.01.25.18.31.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 25 Jan 2026 18:31:09 -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 v3 3/4] ceph: remove error return from ceph_process_folio_batch() Date: Sun, 25 Jan 2026 18:30:54 -0800 Message-ID: <20260126023055.405401-4-CFSworks@gmail.com> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20260126023055.405401-1-CFSworks@gmail.com> References: <20260126023055.405401-1-CFSworks@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Following an earlier commit, ceph_process_folio_batch() no longer returns errors because the writeback loop cannot handle them. Since this function already indicates failure to lock any pages by leaving `ceph_wbc.locked_pages =3D=3D 0`, and the writeback loop has no way to handle abandonment of a locked batch, change the return type of ceph_process_folio_batch() to `void` and remove the pathological goto in the writeback loop. The lack of a return code emphasizes that ceph_process_folio_batch() is designed to be abort-free: that is, once it commits a folio for writeback, it will not later abandon it or propagate an error for that folio. Any future changes requiring "abort" logic should follow this invariant by cleaning up its array and resetting ceph_wbc.locked_pages appropriately. Signed-off-by: Sam Edwards --- fs/ceph/addr.c | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/fs/ceph/addr.c b/fs/ceph/addr.c index 39064893f35b..cdf11288d6b7 100644 --- a/fs/ceph/addr.c +++ b/fs/ceph/addr.c @@ -1284,16 +1284,16 @@ static inline int move_dirty_folio_in_page_array(st= ruct address_space *mapping, } =20 static -int ceph_process_folio_batch(struct address_space *mapping, - struct writeback_control *wbc, - struct ceph_writeback_ctl *ceph_wbc) +void ceph_process_folio_batch(struct address_space *mapping, + struct writeback_control *wbc, + struct ceph_writeback_ctl *ceph_wbc) { struct inode *inode =3D mapping->host; struct ceph_fs_client *fsc =3D ceph_inode_to_fs_client(inode); struct ceph_client *cl =3D fsc->client; struct folio *folio =3D NULL; unsigned i; - int rc =3D 0; + int rc; =20 for (i =3D 0; can_next_page_be_processed(ceph_wbc, i); i++) { folio =3D ceph_wbc->fbatch.folios[i]; @@ -1323,12 +1323,10 @@ int ceph_process_folio_batch(struct address_space *= mapping, rc =3D ceph_check_page_before_write(mapping, wbc, ceph_wbc, folio); if (rc =3D=3D -ENODATA) { - rc =3D 0; folio_unlock(folio); ceph_wbc->fbatch.folios[i] =3D NULL; continue; } else if (rc =3D=3D -E2BIG) { - rc =3D 0; folio_unlock(folio); ceph_wbc->fbatch.folios[i] =3D NULL; break; @@ -1370,7 +1368,6 @@ int ceph_process_folio_batch(struct address_space *ma= pping, rc =3D move_dirty_folio_in_page_array(mapping, wbc, ceph_wbc, folio); if (rc) { - rc =3D 0; folio_redirty_for_writepage(wbc, folio); folio_unlock(folio); break; @@ -1381,8 +1378,6 @@ int ceph_process_folio_batch(struct address_space *ma= pping, } =20 ceph_wbc->processed_in_fbatch =3D i; - - return rc; } =20 static inline @@ -1686,10 +1681,8 @@ static int ceph_writepages_start(struct address_spac= e *mapping, break; =20 process_folio_batch: - rc =3D ceph_process_folio_batch(mapping, wbc, &ceph_wbc); + ceph_process_folio_batch(mapping, wbc, &ceph_wbc); ceph_shift_unused_folios_left(&ceph_wbc.fbatch); - if (rc) - goto release_folios; =20 /* did we get anything? */ if (!ceph_wbc.locked_pages) --=20 2.52.0