From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-oo1-f45.google.com (mail-oo1-f45.google.com [209.85.161.45]) (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 D7B483D905F for ; Wed, 5 Aug 2026 20:33:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=pass smtp.client-ip=209.85.161.45 ARC-Seal:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785962005; cv=pass; b=Nq0LqbNE1vja+4BM0SyQx1p8RFt630tVbS7KSTYNdRgIo3Jb5hrLA3M+6rQDO/lRSibgr9KPc8Zg3yuoN2MkUIuCVuDwg4CNrFaqKsK0ycCxoOps3QE4pLBB3hWLnJDxCIMktUydY0TSoD/6tBrRc4xb1NTGNdD+/yXSW/I4KcQ= ARC-Message-Signature:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785962005; c=relaxed/simple; bh=GI8C7x7/1X74WCp4xq6Tj+lGkjg4R7DvkuG6i1NAga4=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=GKItZoUftd/sUV9Gr2V1feHja02IcwjtgOjWISLuVeSxOqvnYAUE2Me/TO3/m8AOyBzL1LI7MeHBy+rcMzNRD/HIIlGw/l6vXKC7Bi65eGOi2jZP17M272Ozb9VB7Prx3rzFQCpaqHYEWRWzq+JN3A2pe6EsYZ3pxUAsUUK3uns= ARC-Authentication-Results:i=2; 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=WgBghV/R; arc=pass smtp.client-ip=209.85.161.45 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="WgBghV/R" Received: by mail-oo1-f45.google.com with SMTP id 006d021491bc7-6aaf3f54dbeso877936eaf.2 for ; Wed, 05 Aug 2026 13:33:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1785962003; cv=none; d=google.com; s=arc-20260327; b=HZz7rJBfh9uW6xGF4CKN7qqk2D1VFbK0PH5nCN+GLUoE0wh0vuEwP94IDnrLx0MZLX JK+OoGTQhD0Ob5G2ZayIEMuZRzHjzItBSJ7bw2cvMNSQrdTlaiOpcnkN2Mtug1qAdiEj OKEhaWNHScTRLZbCE3OmC1gvDIrrO808XPan+3/ug4YrR6HWXAsPcZWqxkTQDKqrhOdi rrLtMNnmFlWJPqBHXaVtb0rDSpavJxgQmpRCXIi8tyl98OB0DMb9/BiFeEmVAbaLe3cn UaLIcyz/7Y3YP50SeHj0QrrlmvobwHcYv2shiKoV5j0xj/qw/7uQo6uXAzuIIboMDcgU O0RQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20260327; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=WXwiR/pZJKH9ofJG0kWfM6Ol7KNG5CJwWwWByT6iJt0=; fh=H/HEe3330GGS8iPpT/BGLFajnSgUUupOzQtIhQYS/Ao=; b=QTwqYrggrnlaKfXZT+D6y728P2aay3f8PDWv+fn+484zqCfa/M1Bv7qs4ES3MYIr6v tcuR/nXzFy+j5dZtlPm2iFX93pUcBDE096ndn/7N013cpv/3LsWyNdpoop+IsjtyS0M/ jakjoRqcKGu9sGunTpjDeUfM34/6vyJCOfZYHJrvk66n61hQqZK2b9FzeojuPdezRJL1 RGmoDXIddRPb8QlbreVFjvEpNJxF3WI3CRcvI1Y4d4iZCFr0FHOYmJpCwxZdNbN2TgF8 GepnSHvtzJqSjyV2pit7BO0bcgI+vYoAxNzV/hpRveqV1nWBKYUuVbi9FAz8vBCrASBF FTzA==; darn=vger.kernel.org ARC-Authentication-Results: i=1; mx.google.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1785962003; x=1786566803; darn=vger.kernel.org; h=content-transfer-encoding:content-type:cc:to:subject:message-id :date:from:in-reply-to:references:mime-version:from:to:cc:subject :date:message-id:reply-to:content-type; bh=WXwiR/pZJKH9ofJG0kWfM6Ol7KNG5CJwWwWByT6iJt0=; b=WgBghV/RHwHnPPJY7Nc3moD8fUHUUgKrTcZXXmvZQtqU6X0Ot/qriEV6QY2ba87DsF 6/I4VndMLtBdeYagRwdIYO0o7fV4enm29Rc6j711cpeRITObZOZruSiuCsusa7D2NXok Vam5f1qMdjdzEyNV1gDAhBeVfPPk7Oca7i+Pvq2GoR2r5JfoqmVHqCUjQ6gWotJYQJB1 GOOA9p8920mhpPWEy5wNLrtSld9fMlYP5nz6YZrbSxkKbE+1X/aqQEUAw4BEtb5GfE2s 73Ck62VB566Sp2Xj9gh5C4pP4/uFOWqspYmOGn3nULmo971b+6SAs/DlMXgDtxhPrSS4 94LQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1785962003; x=1786566803; h=content-transfer-encoding:content-type:cc:to:subject:message-id :date:from:in-reply-to:references:mime-version:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=WXwiR/pZJKH9ofJG0kWfM6Ol7KNG5CJwWwWByT6iJt0=; b=Po3dNnM/0H515NQlrKUWBbQC+fRflgBQ8wB0JNQKnhEmgJ0oXyr2arOFUCU3l6ErHM c1fCKcDxnPb8f8bwKAZSOUoN7OVhmm2qLVqqUllEymryVfZgSbJfTCYl+B45dZMnFjUY s+4Ry2+HlNL9dEgL7Y50sBKtxLQk4dL81V+5wCOv2Jc8smgUm9H00eskUbP5wPzvxEID uqqxrbO4JH2lCXk45eldYv7cdf8Wiq/SaZhp9YrkZZBvGX6hPeYp/J+XdmrFmal/oVkk R9hSDpqEQ3aiV5n0sp6HNeaNISBymNy9CL9jbJh67z9J+gI2YY6wTv145Kvqi8NnLQbd xaCw== X-Forwarded-Encrypted: i=1; AHgh+RrMRn6PV8zYR34vUMxp83vmTR0rn5JlLEq4IjBiuz6lvZa5pFgDwFM+64aLrilBZYc3tMOiXewgEpoEdBo=@vger.kernel.org X-Gm-Message-State: AOJu0YyV6cXq0sKpe9fvzuwftXOBByvW+xl/tyHvJDMhv03/KWmMOGTt 3x3iSImM1IoBQ8wuW5XLP7QGreta8OIKLzouKZNrMN3mF/p9JJNjU7gnnZg+WVN6QMQ8YlEKCBW 9D2F7UV4c3ijHm2K/dejPBoQuJRQvrmc= X-Gm-Gg: AR+sD13oiXzScWO4fdepsUrpf1waUoENqmdc4igFXYc8th8giAR9jZDvB+1Xsm7i4gr mCZLttdZMpiLhaUOo76nkt3G3DGeMA/bfjpy47HjLDaCRDtEgTnaLOxXXw/fyZ8IM9jueFp/E0w tatvCm9nKjzmCxLuXM40F8jG4tFAXS7tzERnc48/CrNUBw010eEWVlKazsNxN+S3+nNz2af/J2e eQc0A4u5raS0xOgbvL/CJb3ZFJWPJP55c/eq4Sngx5kYNBF5CTGNfueH4isyjjNX5ht557zA5pj moBm6bki2t5jbPCKZSKGmwe7Z1+9KXZ1EFrVgtRFKEXz X-Received: by 2002:a05:6820:4b8e:b0:6a1:4a27:cd22 with SMTP id 006d021491bc7-6ae968d0ddbmr5568777eaf.0.1785962002030; Wed, 05 Aug 2026 13:33:22 -0700 (PDT) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <7qfbpj66hdtxc23lox63hqss42yo5xz2dazigf7nwdorplmec5@vv6jsnqa6viu> In-Reply-To: <7qfbpj66hdtxc23lox63hqss42yo5xz2dazigf7nwdorplmec5@vv6jsnqa6viu> From: Chris S Date: Wed, 5 Aug 2026 16:33:07 -0400 X-Gm-Features: AUfX_mwz8K3T1Z_fWdMufWIMTQu1kthOhf45o3aWABfKf2Yu8afHwh21AjQl4bU Message-ID: Subject: Re: [PATCH 16/19] jbd2: report journal write errors with BH_Write_EIO To: Jan Kara Cc: Christian Brauner , Alexander Viro , Matthew Wilcox , linux-fsdevel@vger.kernel.org, "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 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Done in v2, and 'success' it is - thanks for the follow-up, that is what fs/buffer.c calls it. if (!success) mark_buffer_write_io_error(bh); Patch 21 adds a clear_buffer_write_io_error() to the success side, so the final shape has both arms again, but nothing touches BH_Uptodate either way= . Best, Chao On Tue, Aug 4, 2026 at 5:10=E2=80=AFAM Jan Kara wrote: > > On Tue 04-08-26 10:54:37, Jan Kara wrote: > > On Sat 01-08-26 18:01:00, Chao Shi wrote: > > > The journal's own write completion handler, > > > journal_end_buffer_io_sync(), reports a failed write by clearing > > > BH_Uptodate, and the three places that wait for journal writes look f= or > > > that. This series is removing that convention: a buffer whose write = failed > > > still holds the data that was supposed to reach the disk, and saying = it is > > > not up to date makes callers rewrite, re-read or WARN over data that = was > > > never wrong. > > > > > > Set BH_Write_EIO instead, with mark_buffer_write_io_error(), and test= it in > > > journal_wait_on_commit_record() and in the two commit-phase waits. > > > > > > The two changes have to go together, because commit phase 4 waits on = a > > > mixed list: descriptor blocks are submitted with > > > journal_end_buffer_io_sync(), while revoke blocks go through > > > write_dirty_buffer() and land in bh_end_write(). bh_end_write() alre= ady > > > sets BH_Write_EIO, so converting the consumer alone would keep workin= g for > > > revoke blocks and silently stop detecting failed descriptor writes. = With > > > the handler converted, both halves of the list report the same way. > > > > > > mark_buffer_write_io_error() is safe on all of these buffers. The sh= adow > > > buffers from jbd2_journal_write_metadata_buffer() have no folio and n= o > > > associated mapping, so it does nothing beyond setting the flag. Desc= riptor > > > and commit blocks are ordinary buffers on the journal device, and mar= king > > > the journal's mapping with the error is what write_dirty_buffer() alr= eady > > > does for revoke blocks on the same device. > > > > > > Signed-off-by: Chao Shi > > > --- > > > fs/jbd2/commit.c | 8 ++++---- > > > 1 file changed, 4 insertions(+), 4 deletions(-) > > > > > > diff --git a/fs/jbd2/commit.c b/fs/jbd2/commit.c > > > index 60273cddf434..8912786ebebb 100644 > > > --- a/fs/jbd2/commit.c > > > +++ b/fs/jbd2/commit.c > > > @@ -39,7 +39,7 @@ static void journal_end_buffer_io_sync(struct bio *= bio) > > > if (uptodate) > > > set_buffer_uptodate(bh); > > > else > > > - clear_buffer_uptodate(bh); > > > + mark_buffer_write_io_error(bh); > > > > There's no need to set uptodate flag here at all (all callers set it be= fore > > submitting IO). So you can just simplify this to: > > > > if (!uptodate) > > mark_buffer_write_io_error(bh); > > > > Also I'd rename the local variable from 'uptodate' to 'ioerr' or someth= ing > > like that. > > Sorry, not 'ioerr' but rather 'success'. I can see fs/buffer.c names it l= ike > that. > > Honza > -- > Jan Kara > SUSE Labs, CR