public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@infradead.org>
To: Chandan Babu R <chandanrlinux@gmail.com>
Cc: linux-xfs@vger.kernel.org, darrick.wong@oracle.com
Subject: Re: [PATCH] xfs: Set xfs_buf's b_ops member when zeroing bitmap/summary files
Date: Thu, 17 Sep 2020 11:53:20 +0100	[thread overview]
Message-ID: <20200917105320.GA7954@infradead.org> (raw)
In-Reply-To: <20200917094356.2858-1-chandanrlinux@gmail.com>

On Thu, Sep 17, 2020 at 03:13:56PM +0530, Chandan Babu R wrote:
> In xfs_growfs_rt(), we enlarge bitmap and summary files by allocating
> new blocks for both files. For each of the new blocks allocated, we
> allocate an xfs_buf, zero the payload, log the contents and commit the
> transaction. Hence these buffers will eventually find themselves
> appended to list at xfs_ail->ail_buf_list.
> 
> Later, xfs_growfs_rt() loops across all of the new blocks belonging to
> the bitmap inode to set the bitmap values to 1. In doing so, it
> allocates a new transaction and invokes the following sequence of
> functions,
>   - xfs_rtfree_range()
>     - xfs_rtmodify_range()
>       - xfs_rtbuf_get()
>         We pass '&xfs_rtbuf_ops' as the ops pointer to xfs_trans_read_buf().
>         - xfs_trans_read_buf()
> 	  We find the xfs_buf of interest in per-ag hash table, invoke
> 	  xfs_buf_reverify() which ends up assigning '&xfs_rtbuf_ops' to
> 	  xfs_buf->b_ops.
> 
> On the other hand, if xfs_growfs_rt_alloc() had allocated a few blocks
> for the bitmap inode and returned with an error, all the xfs_bufs
> corresponding to the new bitmap blocks that have been allocated would
> continue to be on xfs_ail->ail_buf_list list without ever having a
> non-NULL value assigned to their b_ops members. An AIL flush operation
> would then trigger the following warning message to be printed on the
> console,
> 
>   XFS (loop0): _xfs_buf_ioapply: no buf ops on daddr 0x58 len 8
>   00000000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
>   00000010: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
>   00000020: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
>   00000030: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
>   00000040: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
>   00000050: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
>   00000060: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
>   00000070: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
>   CPU: 3 PID: 449 Comm: xfsaild/loop0 Not tainted 5.8.0-rc4-chandan-00038-g4d8c2b9de9ab-dirty #37
>   Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.12.0-1 04/01/2014
>   Call Trace:
>    dump_stack+0x57/0x70
>    _xfs_buf_ioapply+0x37c/0x3b0
>    ? xfs_rw_bdev+0x1e0/0x1e0
>    ? xfs_buf_delwri_submit_buffers+0xd4/0x210
>    __xfs_buf_submit+0x6d/0x1f0
>    xfs_buf_delwri_submit_buffers+0xd4/0x210
>    xfsaild+0x2c8/0x9e0
>    ? __switch_to_asm+0x42/0x70
>    ? xfs_trans_ail_cursor_first+0x80/0x80
>    kthread+0xfe/0x140
>    ? kthread_park+0x90/0x90
>    ret_from_fork+0x22/0x30
> 
> This message indicates that the xfs_buf had its b_ops member set to
> NULL.
> 
> This commit fixes the issue by assigning "&xfs_rtbuf_ops" to b_ops
> member of each of the xfs_bufs logged by xfs_growfs_rt_alloc().
> 
> Signed-off-by: Chandan Babu R <chandanrlinux@gmail.com>

Looks good,

Reviewed-by: Christoph Hellwig <hch@lst.de>

      reply	other threads:[~2020-09-17 10:53 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-17  9:43 [PATCH] xfs: Set xfs_buf's b_ops member when zeroing bitmap/summary files Chandan Babu R
2020-09-17 10:53 ` Christoph Hellwig [this message]

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=20200917105320.GA7954@infradead.org \
    --to=hch@infradead.org \
    --cc=chandanrlinux@gmail.com \
    --cc=darrick.wong@oracle.com \
    --cc=linux-xfs@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