From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-vk1-f169.google.com (mail-vk1-f169.google.com [209.85.221.169]) (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 D4C13483818 for ; Thu, 6 Aug 2026 16:59:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.169 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786035573; cv=none; b=shrE4XJTIJqTvZsVLdPVHk/ZYShIxdqk3CsxbofDBjVMVnuswq3RCYwjIxxnV7WHblpAnJCaZ8Gi4yaMcTygMv21HEUZiY3LgNwj6j8zt0xXLsrq4pjsDUgwNLqDtnmGXJnI9mtH6RUS/eXY9L8qap6JpVTe4Vph8z8ieu9kFww= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786035573; c=relaxed/simple; bh=XCQvARYs03Jg6cCkHO2H308pJ7dd7LthVfdbsY3TGbk=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=bbeOt7yTZBT0RgU0Yq0kr0Wc8X3hiSC2ZtcVDfLxBKBXebibVJWrY15PpKUdyBMLLr8CC4i8V0aOC5n84na4U4t2N0d0hdqbpHmch6fsG3TmUTI8kKevEaWs4pkioKobIRXysP06+CNkBLDdUJIrdmyzC2m2/lvuQT1mtXVmrBI= 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=p3w7NRw3; arc=none smtp.client-ip=209.85.221.169 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="p3w7NRw3" Received: by mail-vk1-f169.google.com with SMTP id 71dfb90a1353d-5c2dbaf828eso857923e0c.0 for ; Thu, 06 Aug 2026 09:59:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1786035570; x=1786640370; 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=W/UkvZ9btqQ9UcKZM3gfiOG/tPkCxSDzu5UxeQemPOo=; b=p3w7NRw3KIrR80GcScsOy40s/lALyhTKudwesZMfKknNR8x1gXe5vHuVU9hYF1ivv2 602Siw/IvGzD55HABAY9E5VZdSrcuK9FRtmtf5zQn5vJIPR1ly4rUvKrjhQ4Ahp5wIqj j2gLgFQgAMDgCS7dwgC70Mua1Ykq8G3ffD/IyyMXXcDfkD91iYLNUdltKI2kDlX2Oy8S NB83SAxhmYB+KCu79bFrerlpRiN/gNyVoHYpub+SIX+s7wgVgnmF68y4lbGEs320s0yk AaAjsSOEbkWaOuDjYG9AsM6JUBT6L1kNvppiOafOzx8encGz0caVWk2TOT9W187BhzwJ xZxA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1786035570; x=1786640370; 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=W/UkvZ9btqQ9UcKZM3gfiOG/tPkCxSDzu5UxeQemPOo=; b=j5uz7vKVXcy71d3uXND4q8l6sswhQP4YP7jV/QHP7+03RDLXk+YP44FM5vnY9pOvmV A/FDvR7Vxk3b0zm6obkHbhzByyrd4kWt2dV720+2vH5u0PaSrjk8fEwaxJLLpvXILN8G TGf4E7XLNCRPvxv1SF0XJ/jmHkhz96tABGJ1ZfZYr/3yjttJoR23t00evRhczwcOa8pJ lVmFTTebX50i1yjm5v2fd6u28H5Q7e3uC0kUZEhUoQiJRbyRlrqIVKrvnKl/VlAmA9pa HOhusddT8r439vwpuH3NBI5ZE2l+w1YDLdZ7CF06LV1AKvFCbXRlru8CObzYsswXt5ax gPVw== X-Forwarded-Encrypted: i=1; AHgh+RqdkGpd7LUCpFLq7HnFD9HsAgR2bhB1fUeFS79uaXFy2UFaq5uzFSFo8sOICG5vgVZ7APLhOEjhIemkMKk=@vger.kernel.org X-Gm-Message-State: AOJu0Yxkg5Mhv4DixuUGQuetjRNkP3dIn8od60ZkdhC5NqNzW6n9+Gg0 I2aA8J9bdvKDY/Qad9Xl99t0hWBKdupa5baK7ndThkioxgAP+0WNtebx X-Gm-Gg: AR+sD12jehc6I/COcYSOrUig8frtY8L5YkJ2t9G2guZlrFn5qPIruMDJ//sFAYhhN+J oAi5cWNLw2GhlyzMWuE3xpQIAr/GAZlLWhiu25SyJjsn8Cq25vTMezT/M4jfCYs1c7ay97NovD4 Is8QqrbSeBVUzOShUPfy28FYmPLp9B0nkmjxpbxO1hcY/0skMdXa2LtHBmL8tXzNhaINlSK7NxY 63II1LsIMd/heDyE2CocVnSAK5Izii3ONqhVSkxmYiNwjmgoRMm+JvxrX0YKuXffh3klAbfctIG 6SdTMOpX2kwB/XhAOXWzDRWCmmi7HEFU5wRjNLiy0W/UJ2zREhC4RvZRrfwbPOJVr0Eo62CWZJi nTDYEzgdOJieOvMYdlTUUdCpS+Kt1vj0MLuvjQgNi2v0kAlXUcMmcc/6dhIrFLKslaXZkpw7/tF pUr4jCEw4uBfsRXg3lZ1k3pgJiC9VRVapTsimARoe79iObPG50YPSy6S/JRNxoEsDaHhS0yuyEZ dHFwfa03Pwep3OJqg== X-Received: by 2002:a05:6122:e248:b0:5bf:9bd1:791 with SMTP id 71dfb90a1353d-5c3d912095cmr2047468e0c.1.1786035569648; Thu, 06 Aug 2026 09:59:29 -0700 (PDT) Received: from syssplab.cs.fiu.edu (nat1.cs.fiu.edu. [131.94.134.89]) by smtp.gmail.com with ESMTPSA id 71dfb90a1353d-5c3d05c594fsm3706321e0c.8.2026.08.06.09.59.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 06 Aug 2026 09:59:29 -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 , 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-kernel@vger.kernel.org, Chao Shi , Weidong Zhu Subject: [PATCH v2 08/21] adfs: check for a directory write error with buffer_write_io_error() Date: Thu, 6 Aug 2026 12:58:31 -0400 Message-ID: <05cf8ad911ad7a6eb68f42e38f1eea39c38e246b.1785951556.git.coshi036@gmail.com> 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. Acked-by: Weidong Zhu 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