linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@lst.de>
To: Andreas Gruenbacher <agruenba@redhat.com>
Cc: Christoph Hellwig <hch@lst.de>,
	"K.V, Aneesh" <aneesh.kumar@linux.vnet.ibm.com>,
	cluster-devel <cluster-devel@redhat.com>,
	linux-fsdevel <linux-fsdevel@vger.kernel.org>
Subject: Re: gfs2 iomap: BUG_ON(buffer_unmapped) in submit_bh_wbc
Date: Thu, 24 May 2018 20:13:33 +0200	[thread overview]
Message-ID: <20180524181333.GA24254@lst.de> (raw)
In-Reply-To: <CAHc6FU5a5E9K_AizwWkoPjb4cCWzqKspjc9YDVOzpCxcsDnKeA@mail.gmail.com>

On Thu, May 24, 2018 at 08:05:03PM +0200, Andreas Gruenbacher wrote:
> Approach (1) is quite trivial:
> 
> --- a/fs/buffer.c
> +++ b/fs/buffer.c
> @@ -1908,7 +1908,7 @@ iomap_to_bh(struct inode *inode, sector_t,
> struct buffer_head *bh,
>                 set_buffer_unwritten(bh);
>                 /* FALLTHRU */
>         case IOMAP_MAPPED:
> -               if (offset >= i_size_read(inode))
> +               if ((iomap->flags & IOMAP_F_NEW) || offset >=
> i_size_read(inode))
>                         set_buffer_new(bh);
>                 bh->b_blocknr = (iomap->addr + offset - iomap->offset) >>
>                                 inode->i_blkbits;
> 

This is the right thing to do.  We just didn't need to do it for XFS
as we'll never allocate normal blocks in write_begin.

You'll probably need similar tweaks in my new iomap write code, which
you're hopefully lookin into as well.

  reply	other threads:[~2018-05-24 18:07 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-24 18:05 gfs2 iomap: BUG_ON(buffer_unmapped) in submit_bh_wbc Andreas Gruenbacher
2018-05-24 18:13 ` Christoph Hellwig [this message]
2018-05-24 18:25   ` Andreas Gruenbacher
2018-05-25 12:24     ` Christoph Hellwig

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=20180524181333.GA24254@lst.de \
    --to=hch@lst.de \
    --cc=agruenba@redhat.com \
    --cc=aneesh.kumar@linux.vnet.ibm.com \
    --cc=cluster-devel@redhat.com \
    --cc=linux-fsdevel@vger.kernel.org \
    /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).