From: Andreas Gruenbacher <agruenba@redhat.com>
To: Tetsuo Handa <penguin-kernel@i-love.sakura.ne.jp>
Cc: cgroups@vger.kernel.org, Jan Kara <jack@suse.cz>,
Rafael Aquini <aquini@redhat.com>,
gfs2@lists.linux.dev, linux-mm@kvack.org,
linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [RFC 1/2] gfs2: replace sd_aspace with sd_inode
Date: Tue, 8 Apr 2025 13:19:58 +0200 [thread overview]
Message-ID: <CAHc6FU5HrGWYpOwd6OMhG7EdyjB3zp-RV5dP=W-=29VnYa96-w@mail.gmail.com> (raw)
In-Reply-To: <77b1b228-3799-43e3-ab30-5aec1d633816@I-love.SAKURA.ne.jp>
On Tue, Apr 8, 2025 at 8:04 AM Tetsuo Handa
<penguin-kernel@i-love.sakura.ne.jp> wrote:
> On 2025/04/08 3:21, Andreas Gruenbacher wrote:
> > @@ -1156,6 +1146,18 @@ static int gfs2_fill_super(struct super_block *sb, struct fs_context *fc)
> > sb->s_flags |= SB_NOSEC;
> > sb->s_magic = GFS2_MAGIC;
> > sb->s_op = &gfs2_super_ops;
> > +
> > + /* Set up an address space for metadata writes */
> > + sdp->sd_inode = new_inode(sb);
> > + if (!sdp->sd_inode)
> > + goto fail_free;
> > + sdp->sd_inode->i_ino = GFS2_BAD_INO;
> > + sdp->sd_inode->i_size = OFFSET_MAX;
> > +
> > + mapping = gfs2_aspace(sdp);
> > + mapping->a_ops = &gfs2_rgrp_aops;
> > + mapping_set_gfp_mask(mapping, GFP_NOFS);
> > +
> > sb->s_d_op = &gfs2_dops;
> > sb->s_export_op = &gfs2_export_ops;
> > sb->s_qcop = &gfs2_quotactl_ops;
>
> This will be an inode leak when hitting e.g.
>
> error = init_names(sdp, silent);
> if (error)
> goto fail_free;
>
> path, for what free_sbd() in
>
> fail_free:
> free_sbd(sdp);
> sb->s_fs_info = NULL;
> return error;
>
> path does is nothing but free_percpu() and kfree().
Indeed, an iput() is indeed needed in that case.
Thanks,
Andreas
next prev parent reply other threads:[~2025-04-08 11:20 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-04-07 18:21 [RFC 0/2] Fix false warning in inode_to_wb Andreas Gruenbacher
2025-04-07 18:21 ` [RFC 1/2] gfs2: replace sd_aspace with sd_inode Andreas Gruenbacher
[not found] ` <77b1b228-3799-43e3-ab30-5aec1d633816@I-love.SAKURA.ne.jp>
2025-04-08 11:19 ` Andreas Gruenbacher [this message]
2025-04-10 8:50 ` Christoph Hellwig
2025-04-10 19:20 ` Andreas Gruenbacher
2025-04-07 18:21 ` [RFC 2/2] writeback: Fix false warning in inode_to_wb() Andreas Gruenbacher
2025-04-10 8:52 ` Christoph Hellwig
2025-04-10 17:48 ` Andreas Gruenbacher
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='CAHc6FU5HrGWYpOwd6OMhG7EdyjB3zp-RV5dP=W-=29VnYa96-w@mail.gmail.com' \
--to=agruenba@redhat.com \
--cc=aquini@redhat.com \
--cc=cgroups@vger.kernel.org \
--cc=gfs2@lists.linux.dev \
--cc=jack@suse.cz \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=penguin-kernel@i-love.sakura.ne.jp \
/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