From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail.linuxfoundation.org ([140.211.169.12]:51676 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752504AbeDRTnf (ORCPT ); Wed, 18 Apr 2018 15:43:35 -0400 Date: Wed, 18 Apr 2018 12:43:32 -0700 From: Andrew Morton To: Chengguang Xu Cc: linux-fsdevel@vger.kernel.org, dhowells@redhat.com, kstewart@linuxfoundation.org, gregkh@linuxfoundation.org, tglx@linutronix.de, pombredanne@nexb.com, linux-kernel@vger.kernel.org Subject: Re: [PATCH 2/2] hfsplus: fix potential refcnt problem of nls module Message-Id: <20180418124332.aac5d1d8f331ce78732836d6@linux-foundation.org> In-Reply-To: <1523948733-8537-2-git-send-email-cgxu519@gmx.com> References: <1523948733-8537-1-git-send-email-cgxu519@gmx.com> <1523948733-8537-2-git-send-email-cgxu519@gmx.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-fsdevel-owner@vger.kernel.org List-ID: On Tue, 17 Apr 2018 15:05:33 +0800 Chengguang Xu wrote: > When specifying nls option multiple times in a mount, > current option parsing will cause inaccurate refcount of nls > module. Hence, call unload_nls for previous one in this case. > > --- a/fs/hfsplus/options.c > +++ b/fs/hfsplus/options.c > @@ -171,8 +171,10 @@ int hfsplus_parse_options(char *input, struct hfsplus_sb_info *sbi) > return 0; > } > p = match_strdup(&args[0]); > - if (p) > + if (p) { > + unload_nls(sbi->nls); > sbi->nls = load_nls(p); > + } > if (!sbi->nls) { > pr_err("unable to load nls mapping \"%s\"\n", > p); Same problem as in [patch 1/2]