linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Matthew Wilcox <willy@infradead.org>
To: cheung wall <zzqq0103.hey@gmail.com>
Cc: Alexander Viro <viro@zeniv.linux.org.uk>,
	Christian Brauner <brauner@kernel.org>, Jan Kara <jack@suse.cz>,
	linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: WARNING in mark_buffer_dirty
Date: Sat, 16 Mar 2024 04:54:10 +0000	[thread overview]
Message-ID: <ZfUl8pGp_JMWMaVI@casper.infradead.org> (raw)
In-Reply-To: <CAKHoSAuCUF8kNFdv5Chb2Fnup2vwDb0W+UPOxHzgCg_O=KJA0A@mail.gmail.com>


This might be an iomap bug, so adding Christoph & Darrick.

On Sat, Mar 16, 2024 at 12:29:36PM +0800, cheung wall wrote:
> HEAD commit: 0dd3ee31125508cd67f7e7172247f05b7fd1753a  (tag: v6.7)
> WARNING: CPU: 0 PID: 2920 at fs/buffer.c:1176
> mark_buffer_dirty+0x232/0x290

This is WARN_ON_ONCE(!buffer_uptodate(bh)), so we're trying to mark a
buffer dirty when that buffer is not uptodate.

> RIP: 0010:mark_buffer_dirty+0x232/0x290
> fs/buffer.c:1176
> Call Trace:
>  <TASK>
>  __block_commit_write+0xe9/0x200
> fs/buffer.c:2191

... but line 2190 and 91 are:

                        set_buffer_uptodate(bh);
                        mark_buffer_dirty(bh);

and the folio is locked.  So how do we clear the uptodate flag on the
buffer without the folio locked?

>  block_write_end+0xb1/0x1f0
> fs/buffer.c:2267
>  iomap_write_end+0x461/0x8c0
> fs/iomap/buffered-io.c:857
>  iomap_write_iter
> fs/iomap/buffered-io.c:938
> [inline]
>  iomap_file_buffered_write+0x4eb/0x800
> fs/iomap/buffered-io.c:987
>  blkdev_buffered_write
> block/fops.c:646
> [inline]
>  blkdev_write_iter+0x4ae/0xa40
> block/fops.c:696
>  call_write_iter

  reply	other threads:[~2024-03-16  4:54 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-16  4:29 WARNING in mark_buffer_dirty cheung wall
2024-03-16  4:54 ` Matthew Wilcox [this message]
2024-03-18 10:12   ` Jan Kara
     [not found] <001a114740a0b5fa37055e14cf3b@google.com>
2017-12-12 20:56 ` Eric Biggers

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ZfUl8pGp_JMWMaVI@casper.infradead.org \
    --to=willy@infradead.org \
    --cc=brauner@kernel.org \
    --cc=jack@suse.cz \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=viro@zeniv.linux.org.uk \
    --cc=zzqq0103.hey@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).