From: Jan Kara Subject: Re: [PATCH] fs: reiserfs: free new_opts in reiserfs_remount Date: Wed, 27 Oct 2021 13:15:27 +0200 Message-ID: <20211027111527.GD28650@quack2.suse.cz> References: <20211027033947.3992059-1-mudongliangabcd@gmail.com> <20211027094644.GA28650@quack2.suse.cz> Mime-Version: 1.0 Return-path: DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1635333327; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=ZkxJPQN9liKoaICizGCBGi8W3K8sU2vxUXZo9t/rlgg=; b=oBdLTDqTh8rLJ32djlyxuwri6hdSouIAD1FOFvKp/KH1J0xXOpIvQslk2qgpyiBq9I+MX0 5vguduZMMvjudda7RTHit5bUHY/0/tbJQZH3x7bc/hNKOcQrMZyszpXsT4FKoUZhtcGUB8 MBNSdRfLj90KHU5Ip7s6In/CdyBWCxI= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1635333327; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=ZkxJPQN9liKoaICizGCBGi8W3K8sU2vxUXZo9t/rlgg=; b=lYXZL+DalL8MYbrH1mJXZN1j6xevEn6Qk9KcXbxXj8eTQhwTkrYl4BiMWLuyxuZyfHIpd2 irJhEz5VkAXHYBDg== Content-Disposition: inline In-Reply-To: List-ID: Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: Dongliang Mu Cc: Jan Kara , Yu Kuai , Miklos Szeredi , Al Viro , David Howells , reiserfs-devel@vger.kernel.org, linux-kernel On Wed 27-10-21 18:19:00, Dongliang Mu wrote: > On Wed, Oct 27, 2021 at 5:46 PM Jan Kara 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 > > > > 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 SUSE Labs, CR