From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-vk1-f174.google.com (mail-vk1-f174.google.com [209.85.221.174]) (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 DC902391832 for ; Thu, 6 Aug 2026 16:59:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.174 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786035592; cv=none; b=sU9/RdZ79bYCEP3vlyU0xHkTT8bqkKVD3vQYNhHcZjpzRUQDuoAVnuTRU9Lp0e6D34bE2CmpRv668AWmO/CAfOM9pZXcx91JOdHMA/MEOqn/3pSFIQj+OmTHPc4y2csOgeXjv5XtuIZ8fL0dbldJzV39znfviKUTy8qV1or0ZLM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786035592; c=relaxed/simple; bh=D13OR5xsYh8JEaA5aDJc/1Dh9iYDdCdoFjWLWDwwfds=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=eTAUn01j+i2Ud3DgOIxixakF7ccssj2FMT7MMQwymT7ApZy2qoH0C8N9a1G2oU0SZW9r+i0yF1rL6r6ck0rqKHd3KXnEMWtcf1zFQjaYLyqa/kY5zY6Q7OAy6atRfPBcKgkqjE7vygAYceJWXSr6e16G98o9p54Xaq01z6gtQz8= 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=JokYjx9r; arc=none smtp.client-ip=209.85.221.174 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="JokYjx9r" Received: by mail-vk1-f174.google.com with SMTP id 71dfb90a1353d-5bf8e1edc3aso1269478e0c.0 for ; Thu, 06 Aug 2026 09:59:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1786035589; x=1786640389; 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=Rb7ASnE8Sx91CLFoiOKNMQmqUcK+VC1xbbyNQo6vc/k=; b=JokYjx9rwzZFWo1aPiBFemi/KMNKkCeFR98eUzj2VARFxYoSgnSHz6lfHPqYFh3UPG xkU9PzoHD9JFlml5dt3QPAqdES2lOMfZaDCpOBUruI6n/G91+30AhmsFLXyVhYKKO0rt 5fw3YwAQ87MiwX1ih0+i2crNk0Q2hYOZ/Jg5rTusgajx0KcgW/65Atrk+u84U+XndVD7 mssxHvhLOOhAiqIPyqesfw/qGrGoV5Xki1sHTtVMC5pdHtn8C8KKm067gwz7MDcMcrE9 ktNZoS9earIIfwKs51e3S1AI0RERs8WroyArPj8V0Ef2puUOeb4rveoqyoJ2fYd/LhP3 C7gg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1786035589; x=1786640389; 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=Rb7ASnE8Sx91CLFoiOKNMQmqUcK+VC1xbbyNQo6vc/k=; b=C3FRY6YA63Ggg+VlOyiMeC0oplhSWsQIMBVZ9kX7DdmiOIJyA9QJV5dKtx8SPDQ1bC 4yXhj9pSeOBiHr16HY9Ig+bJi87bQQCUJDQ9SC7NuJvOiLlvIFyIoGzo9PvgL4gN/Fdj JkLlDba0gytr9YqP4F95so5V5gdPQTo59yMWbw8/Wwye9qUnqT2FTAsVuifiwiRdPdwS pK16BHxrkhFG6+QLx1iYXL7qGrbjDTqEBNR5H+/KNCg7EreUshZaObqYruRQO8J9ASzs wnmJ5agXjtyh8r9HZcrHQ2u8fvcQa2OnNAxDNLcnvkHrQXXF3DWGZCXrjdyRwdH+ShSy zsug== X-Forwarded-Encrypted: i=1; AHgh+RonGfKH3y5rnD1PyQTjEEhH3sCUuKNMlsoVYWo+PIDukk2s3WlEW92I+1Jae/E+eNTrfse+tNBdVhQJHxE=@vger.kernel.org X-Gm-Message-State: AOJu0Yx3dss385/q90Gh/qyUA60JRR1HGxjQGX9Vv6ByWScCJwNIe5NI z/vc9KD+Im9fSDCj3npZzR20q7zD5dMrTObzeEVG4Bya4dc6SD14EG1V X-Gm-Gg: AR+sD12pw/H7+MdN944OXC9ZQSzSx70SMwo02STKCIQYad2lpGuNUQJVjYPbQeuRsH0 y1P5aGgyZ/n3wMfVN84UTVHBqwkEs9yE5/9ml/U/uUk1inUjBuw4YpIONq1ULCSnpqFjzB5BNcz DRW5Hjoc8Q01zKwjxw4YiTspPSmudp8HCx+8794aSPizXXd9NeOtD5W/RiILih16jHy+uBRNkn3 J3aUgIC8Cq5svLToC69x+KY6/a45kbUK9JJvI6mD0PhlWEXrM1sw68Mf8SJjnFjEmGqDcBtQn9O rgYPSxaP8rKC8fIuszorY/dWH7VB+PoZKzn7AEOA5FBHiLYmpph6nox97Bf8A2M7Qi3l97eDoTS CB32WUPqgXhfB1Is6iSPNj3emw5LCUjevOqhS2lx6ApRpSSi9ENIUqpYKprneBxB+Wu7sZYma6y itkv5LM8uX22uGyTN4fd95XxT8hH1VO2Z4C0RSafozq1z1ca61jao5CPrycQGCXsBiXdWEb++sV j2ktOM= X-Received: by 2002:a05:6123:2e6:b0:5c2:b8a4:95c9 with SMTP id 71dfb90a1353d-5c3d924e663mr477877e0c.11.1786035589499; Thu, 06 Aug 2026 09:59:49 -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.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 06 Aug 2026 09:59:48 -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 11/21] exfat: check for a directory write error with buffer_write_io_error() Date: Thu, 6 Aug 2026 12:58:34 -0400 Message-ID: <0784ef63a525434e7c0aff730eca7b43e043095d.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 exfat_update_bhs() waits for the writes it issued and then tests !buffer_uptodate() to find the ones that failed. 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. Test BH_Write_EIO, which is what the completion handler sets and what this code actually wants to know. 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/exfat/misc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/exfat/misc.c b/fs/exfat/misc.c index 6f11a96a4ffa..dfd0bbf31c94 100644 --- a/fs/exfat/misc.c +++ b/fs/exfat/misc.c @@ -187,7 +187,7 @@ int exfat_update_bhs(struct buffer_head **bhs, int nr_bhs, int sync) for (i = 0; i < nr_bhs && sync; i++) { wait_on_buffer(bhs[i]); - if (!err && !buffer_uptodate(bhs[i])) + if (!err && buffer_write_io_error(bhs[i])) err = -EIO; } return err; -- 2.43.0