From mboxrd@z Thu Jan 1 00:00:00 1970 From: Christoph Hellwig Date: Thu, 24 May 2018 20:13:33 +0200 Subject: [Cluster-devel] gfs2 iomap: BUG_ON(buffer_unmapped) in submit_bh_wbc In-Reply-To: References: Message-ID: <20180524181333.GA24254@lst.de> List-Id: To: cluster-devel.redhat.com MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit 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.