All of lore.kernel.org
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@lst.de>
To: cluster-devel.redhat.com
Subject: [Cluster-devel] 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.



WARNING: multiple messages have this Message-ID (diff)
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:13 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-24 18:05 [Cluster-devel] gfs2 iomap: BUG_ON(buffer_unmapped) in submit_bh_wbc Andreas Gruenbacher
2018-05-24 18:05 ` Andreas Gruenbacher
2018-05-24 18:13 ` Christoph Hellwig [this message]
2018-05-24 18:13   ` Christoph Hellwig
2018-05-24 18:25   ` [Cluster-devel] " Andreas Gruenbacher
2018-05-24 18:25     ` Andreas Gruenbacher
2018-05-25 12:24     ` [Cluster-devel] " Christoph Hellwig
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 \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.