From: Jan Kara <jack@suse.cz>
To: Dongliang Mu <mudongliangabcd@gmail.com>
Cc: Jan Kara <jack@suse.cz>, Yu Kuai <yukuai3@huawei.com>,
Miklos Szeredi <mszeredi@redhat.com>,
Al Viro <viro@zeniv.linux.org.uk>,
David Howells <dhowells@redhat.com>,
reiserfs-devel@vger.kernel.org,
linux-kernel <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] fs: reiserfs: free new_opts in reiserfs_remount
Date: Wed, 27 Oct 2021 13:15:27 +0200 [thread overview]
Message-ID: <20211027111527.GD28650@quack2.suse.cz> (raw)
In-Reply-To: <CAD-N9QW48LDX7++chFjeZwr0Q1HX+D0+e=6BcXKxPx=i+DgmUA@mail.gmail.com>
On Wed 27-10-21 18:19:00, Dongliang Mu wrote:
> On Wed, Oct 27, 2021 at 5:46 PM Jan Kara <jack@suse.cz> wrote:
> >
> > On Wed 27-10-21 11:39:25, Dongliang Mu wrote:
> > > Since the commit c3d98ea08291 ("VFS: Don't use save/replace_mount_options
> > > if not using generic_show_options") eliminates replace_mount_options
> > > in reiserfs, but did not handle the allocated new_opts,
> > > it will cause memory leak in the reiserfs_remount.
> > >
> > > Fix this by freeing new_opts in the reiserfs_remount temporarily.
> > >
> > > Fixes: c3d98ea08291 ("VFS: Don't use save/replace_mount_options if not using generic_show_options")
> > > Signed-off-by: Dongliang Mu <mudongliangabcd@gmail.com>
> >
> > Thanks for the patch but I can see that new_opts is not actually used at
> > all in reiserfs_remount() so we should perhaps just remove them (including
> > kstrdup() et al).
>
> That's also a plan. Since I am not sure if maintainers will use
> new_opts anymore, So I propose a temporary patch to fix this memory
> leak.
>
> If you think new_opts is not used anymore, let's remove all the code
> related to new_opts.
If it is ever needed again, we can always add it. Please just remove it.
Thanks!
Honza
--
Jan Kara <jack@suse.com>
SUSE Labs, CR
next prev parent reply other threads:[~2021-10-27 11:15 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-10-27 3:39 [PATCH] fs: reiserfs: free new_opts in reiserfs_remount Dongliang Mu
2021-10-27 9:46 ` Jan Kara
2021-10-27 10:19 ` Dongliang Mu
2021-10-27 11:15 ` Jan Kara [this message]
2021-10-27 12:29 ` Dongliang Mu
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=20211027111527.GD28650@quack2.suse.cz \
--to=jack@suse.cz \
--cc=dhowells@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mszeredi@redhat.com \
--cc=mudongliangabcd@gmail.com \
--cc=reiserfs-devel@vger.kernel.org \
--cc=viro@zeniv.linux.org.uk \
--cc=yukuai3@huawei.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