Return-Path: Received: from mail-bl2nam02on0090.outbound.protection.outlook.com ([104.47.38.90]:50784 "EHLO NAM02-BL2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753263AbeBCSDu (ORCPT ); Sat, 3 Feb 2018 13:03:50 -0500 From: Sasha Levin To: "linux-kernel@vger.kernel.org" , "stable@vger.kernel.org" CC: Al Viro , Sasha Levin Subject: [PATCH AUTOSEL for 4.9 10/52] sget(): handle failures of register_shrinker() Date: Sat, 3 Feb 2018 18:03:38 +0000 Message-ID: <20180203180303.8490-10-alexander.levin@microsoft.com> References: <20180203180303.8490-1-alexander.levin@microsoft.com> In-Reply-To: <20180203180303.8490-1-alexander.levin@microsoft.com> Content-Language: en-US Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org List-ID: From: Al Viro [ Upstream commit 9ee332d99e4d5a97548943b81c54668450ce641b ] Signed-off-by: Al Viro Signed-off-by: Sasha Levin --- fs/super.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/fs/super.c b/fs/super.c index 1058bf3e8724..7e9beab77259 100644 --- a/fs/super.c +++ b/fs/super.c @@ -519,7 +519,11 @@ retry: hlist_add_head(&s->s_instances, &type->fs_supers); spin_unlock(&sb_lock); get_filesystem(type); - register_shrinker(&s->s_shrink); + err =3D register_shrinker(&s->s_shrink); + if (err) { + deactivate_locked_super(s); + s =3D ERR_PTR(err); + } return s; } =20 --=20 2.11.0