[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAD-N9QX01gVnRdntN=pcTgAW7wCXtZj5o_9YctvOSHaf694cxQ@mail.gmail.com>
Date: Wed, 27 Oct 2021 20:29:19 +0800
From: Dongliang Mu <mudongliangabcd@...il.com>
To: Jan Kara <jack@...e.cz>
Cc: Yu Kuai <yukuai3@...wei.com>, Miklos Szeredi <mszeredi@...hat.com>,
Al Viro <viro@...iv.linux.org.uk>,
David Howells <dhowells@...hat.com>,
reiserfs-devel@...r.kernel.org,
linux-kernel <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] fs: reiserfs: free new_opts in reiserfs_remount
On Wed, Oct 27, 2021 at 7:15 PM Jan Kara <jack@...e.cz> wrote:
>
> On Wed 27-10-21 18:19:00, Dongliang Mu wrote:
> > On Wed, Oct 27, 2021 at 5:46 PM Jan Kara <jack@...e.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@...il.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.
Sure. I will send a patch v2.
> Thanks!
>
> Honza
> --
> Jan Kara <jack@...e.com>
> SUSE Labs, CR
Powered by blists - more mailing lists