From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-io0-f171.google.com ([209.85.223.171]:38048 "EHLO mail-io0-f171.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1030327AbeEXSZ4 (ORCPT ); Thu, 24 May 2018 14:25:56 -0400 Received: by mail-io0-f171.google.com with SMTP id z4-v6so3441429iof.5 for ; Thu, 24 May 2018 11:25:56 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: <20180524181333.GA24254@lst.de> References: <20180524181333.GA24254@lst.de> From: Andreas Gruenbacher Date: Thu, 24 May 2018 20:25:55 +0200 Message-ID: Subject: Re: gfs2 iomap: BUG_ON(buffer_unmapped) in submit_bh_wbc To: Christoph Hellwig Cc: "K.V, Aneesh" , cluster-devel , linux-fsdevel Content-Type: text/plain; charset="UTF-8" Sender: linux-fsdevel-owner@vger.kernel.org List-ID: On 24 May 2018 at 20:13, Christoph Hellwig wrote: > 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. Okay, that's easy. > You'll probably need similar tweaks in my new iomap write code, which > you're hopefully looking into as well. Didn't get very far with your bh removal patches so far. Thanks, Andreas