From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-yw1-f179.google.com (mail-yw1-f179.google.com [209.85.128.179]) (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 C1AF638E8CC for ; Sat, 1 Aug 2026 22:01:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.179 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785621683; cv=none; b=gfO2/f4p68JCgqAjNfLseAi1IPlN62mHiVSW/9hshXvKHDeZOEKFbkZIn18SvTrrDAq1eBrgBubpvtUH77tcVidrPaY1SuS1aamdTkUxZYdmq75Nq/DNbs0+0lIrbwMyiwBPyuyrbhqZeCG/eBfoe0KWKOYX6zzo9H2Yd4w9Gnc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785621683; c=relaxed/simple; bh=rmASDDjzyu7ORP+REJJAPqpbg4Lkmrb9SobBQ2fdR4s=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=GNy69yMLpoyax5DTFGRNrsw5XJpAxjpLoVJ0o5iJsy7zEM9xYwfAjh+iQ80C2x2ZkBgRqMx/LQGzj4DYoMYL8TJ2JAZPJzCZf0WNXSnDz2NVAm4+gKKIPGy27bogOpt/9MuIyO/jGB5XlxlXiEimC6di9D66NaIWChov3HXF8kA= 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=ZMnnxug9; arc=none smtp.client-ip=209.85.128.179 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="ZMnnxug9" Received: by mail-yw1-f179.google.com with SMTP id 00721157ae682-81ed2a06b9eso19525047b3.3 for ; Sat, 01 Aug 2026 15:01:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1785621680; x=1786226480; 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:content-type; bh=CmPK9JWvOViXyoDvMWnuptWNftqO/5jbHBuyoy5p9Iw=; b=ZMnnxug9XdWQ0aXvQSPCN2jWf+hw2NGNaI9rsERvZSxtiKGb4zMc+oFGf51JQt0eTo ngmYksGG9+iDAue1aGPDPVXT/bdWSYFaOsCl0F9aT06Q4M1tTiK+WrswQRDxYqSYxmKG uDq4Q93W0SVAB8dXdzOhKahfz5q5/HDeabMMVjWPrJeKwU8Pvq8ctmeDz5nQU5f3MpxS 8rx0dnvWPfjc1b0j874DqBxATRVdprSV0tX3oNXEVkTinZLeC/hvKP+L3fdPq/EWLJhz Z6mmStYrX/1cmxkP+A3B2YudrR6I/nR0wKy07aHxBzn7OkqxqYi8Rb3ryVdAbEEXzaE+ 10gw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1785621680; x=1786226480; 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:content-type; bh=CmPK9JWvOViXyoDvMWnuptWNftqO/5jbHBuyoy5p9Iw=; b=hiPXK5XDfHG1CjtoaJbo06msiTXCwbj8C8Ad8J5I6Q0yilJpRvqlXJHzreZE7XHYBf a8649k2tHK7T1Yhz9Swuyb0sh3UJn9TnI5gjOhr5w5NlnzcTN042wbewGHofeROfyOKr 3MvbGewtwhLPjh4yECI+JBGl+HJxId2VlrV52cQNFN2SFw/OlPVcnVhDWxeiD+8/e5jr yrb9VTMANHaKd5eadBxiKIRb/mle3WtRm+YzYLZXoBKEqwzQRoOHzfRAOK+XU58u87hM cTvV9mhyOpRPgULRnv1XhUBFOvG3ntNIocBIVSVUKtZ2jt9vUAFyscI88nxezN3b/Jqo dDeg== X-Forwarded-Encrypted: i=1; AHgh+RpPaki4CtVziydvHX62N5w4+r7EKbO0JnQDSOvC/Ipz3n7WhRgLET6bcSeyh2TulA76gG6ecu1NYS+20e4=@vger.kernel.org X-Gm-Message-State: AOJu0Yx0VSC22vlfVKpU0FHRSZdJ/OvAOL7bvJVv144gX/3dZ7ZlWOgb UZz1zQRM0qPvFqjOP+oeGhalzgYIBbhgPzIbOCM09p/tPkSlMxXdO39w X-Gm-Gg: AR+sD11NF2XQI5e0023yXT05lwZpkmr22AkVRgwuKXAa09kJjCBcQgwjfZUYgSPATUr 2SyulzAmaerWeoTDA7P1/Ld2RXTLF1b3xA+w94xvujqupMJfVPpYWdNBFR7Dxv90wRJ72GssLz4 VHm0AcSsni82bcCFYN6BtbSv9reKipqp+kzr8AFO+0GVsU/cOUNL2k3TP8w8MvSKNeobc98FgGk 6bdMAgWpSEQGM+KTpz+6GGObm0ZShGDSpAFPwEdRIwwRAB1iL3jMoXQnxgowk6vsY7etcsWbTaN RoG8CRmtRG22BEYzJgr1aWpl5283K+Ozd1E0VUh1x/gbXNcMYVg9LgAYhOsEcF2cAVz16NTh8qp 9rgsFHpijyw7IEZlqRdhYTbRArLetrXRGkV8Zco+GDctT2CwDovshEKSX5ZIfchdjS92FiRzKwh tP1n8bYkWmkKcKCyBGt4eO4bzR6gfGjR2NIVZif3FJI62WTw0sAyHiCuDSYarbZJorwBgXFBwkl Hyeng4= X-Received: by 2002:a05:690c:dcb:b0:81e:d009:1956 with SMTP id 00721157ae682-81fd4a21566mr79336867b3.12.1785621679620; Sat, 01 Aug 2026 15:01:19 -0700 (PDT) Received: from syssplab.cs.fiu.edu (nat1.cs.fiu.edu. [131.94.134.89]) by smtp.gmail.com with ESMTPSA id 00721157ae682-81fcd0d6fbbsm29903767b3.25.2026.08.01.15.01.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 01 Aug 2026 15:01:19 -0700 (PDT) From: Chao Shi To: Jan Kara , Christian Brauner , Alexander Viro , Matthew Wilcox , linux-fsdevel@vger.kernel.org Cc: Theodore Ts'o , Andreas Dilger , Baokun Li , Ojaswin Mujoo , Ritesh Harjani , Zhang Yi , Bob Copeland , Namjae Jeon , Sungjong Seo , Yuezhang Mo , OGAWA Hirofumi , Mark Fasheh , Joel Becker , Joseph Qi , Andreas Gruenbacher , linux-ext4@vger.kernel.org, ocfs2-devel@lists.linux.dev, gfs2@lists.linux.dev, linux-karma-devel@lists.sourceforge.net, linux-kernel@vger.kernel.org, Chao Shi Subject: [PATCH 07/19] adfs: check for a directory write error with buffer_write_io_error() Date: Sat, 1 Aug 2026 18:00:51 -0400 Message-ID: X-Mailer: git-send-email 2.43.0 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit adfs_dir_sync() spots a failed write by testing BH_Req together with !BH_Uptodate. That relies on the write completion handler clearing BH_Uptodate on error, which this series removes: a buffer whose write failed still holds the data the filesystem asked to be written, so declaring it not up to date is wrong and makes callers re-read it. BH_Write_EIO says exactly what this code wants to know, and it implies BH_Req, so the pair collapses into one test. No behaviour change today - a failed write sets BH_Write_EIO and clears BH_Uptodate together. It stops being a no-op at the end of the series, where the new test is the one that still works. Signed-off-by: Chao Shi --- fs/adfs/dir.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/adfs/dir.c b/fs/adfs/dir.c index 11afa9e157aa..b8cc6a697a05 100644 --- a/fs/adfs/dir.c +++ b/fs/adfs/dir.c @@ -191,7 +191,7 @@ static int adfs_dir_sync(struct adfs_dir *dir) for (i = dir->nr_buffers - 1; i >= 0; i--) { struct buffer_head *bh = dir->bhs[i]; sync_dirty_buffer(bh); - if (buffer_req(bh) && !buffer_uptodate(bh)) + if (buffer_write_io_error(bh)) err = -EIO; } -- 2.43.0