gfs2.lists.linux.dev archive mirror
 help / color / mirror / Atom feed
From: Andreas Gruenbacher <agruenba@redhat.com>
To: Guenter Roeck <linux@roeck-us.net>
Cc: Bob Peterson <rpeterso@redhat.com>, gfs2@lists.linux.dev
Subject: Re: [PATCH] gfs2: Initialize metapaths outside of __gfs2_iomap_get
Date: Tue, 31 Oct 2023 00:12:53 +0100	[thread overview]
Message-ID: <CAHc6FU6PKutc1Ya+9Xqa0qXeJVVXMEcsX4HWwVnoZS-n9bmCgQ@mail.gmail.com> (raw)
In-Reply-To: <fba6fc06-f274-4c05-9ace-b5bd6c36f08d@roeck-us.net>

Hello Guenter,

On Mon, Oct 30, 2023 at 7:34 PM Guenter Roeck <linux@roeck-us.net> wrote:
> On Fri, Oct 20, 2023 at 01:22:44AM +0200, Andreas Gruenbacher wrote:
> > Initialize metapaths outside of __gfs2_iomap_get().  This saves us from
> > having to release the metapath in gfs2_iomap_begin_write() before
> > calling __gfs2_iomap_get() a second time.
> >
> > Also gets rid of several instances where mp_aheight remains at 1 for
> > stuffed inodes (which have a height of 0).  In those cases, mp_aheight
> > isn't being used, though.
> >
>
> In linux-next:
>
> [   12.639126] =============================
> [   12.639330] WARNING: suspicious RCU usage
> [   12.639550] 6.6.0-rc7-next-20231027 #1 Tainted: G                 N
> [   12.639647] -----------------------------
> [   12.639814] fs/gfs2/inode.c:1878 suspicious rcu_dereference_check() usage!

Thanks for reporting these issues.

This warning should be fixed by commit
c2607453f7d3 ("gfs2: Silence "suspicious RCU usage in gfs2_permission"
warning").

> [...]
> [   14.882512] kernel BUG at fs/gfs2/bmap.c:695!

That's a BUG_ON(mp->mp_aheight < 1) in __gfs2_iomap_alloc(). I think
the fix is as follows (sorry for the cut-and-paste):

@@ -1071,6 +1071,7 @@ static int gfs2_iomap_begin_write(struct inode
*inode, loff_t pos,
                        ret = gfs2_unstuff_dinode(ip);
                        if (ret)
                                goto out_trans_end;
+                       mp->mp_aheight = 1;
                        ret = __gfs2_iomap_get(inode, iomap->offset,
                                               iomap->length, flags, iomap, mp);
                        if (ret)

Thanks,
Andreas


  reply	other threads:[~2023-10-30 23:13 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-30 18:33 [PATCH] gfs2: Initialize metapaths outside of __gfs2_iomap_get Guenter Roeck
2023-10-30 23:12 ` Andreas Gruenbacher [this message]
2023-10-31  0:58   ` Guenter Roeck
2023-11-01 16:39     ` Andreas Gruenbacher
2023-11-01 18:09       ` Guenter Roeck

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=CAHc6FU6PKutc1Ya+9Xqa0qXeJVVXMEcsX4HWwVnoZS-n9bmCgQ@mail.gmail.com \
    --to=agruenba@redhat.com \
    --cc=gfs2@lists.linux.dev \
    --cc=linux@roeck-us.net \
    --cc=rpeterso@redhat.com \
    /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 read-only IMAP folder(s) and NNTP newsgroup(s).