Received: by 10.223.185.116 with SMTP id b49csp4528918wrg; Tue, 6 Mar 2018 18:18:06 -0800 (PST) X-Google-Smtp-Source: AG47ELslR92oQvBNUeHf7etnw12oeayMM1PNABI07C2o3TRVUlBVehcw7VjhUIbmjvR9KgeRsIYb X-Received: by 2002:a17:902:4381:: with SMTP id j1-v6mr18466064pld.297.1520389086581; Tue, 06 Mar 2018 18:18:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1520389086; cv=none; d=google.com; s=arc-20160816; b=zEWwvXyCKb28iQ08T7N08rj4minseLfKTV+t8t6wDqop3WGkNHIsgndNGmhgIeq3Xb t1VEBvMLuElqSn9sWABTOQuhKYCsla2mjsnSuoL2XsYKVJH1FGPlsRWNu+T4V9MTkMwb KWHwK9r/xoYIJI8HdKAeNeQbKkFot+Ytw7HqNEsRwO7slWJkLXSzBZ4a932sIsM2z8th BgnVFGC5X3Cnt2TLZtEspvNQwnl/EOVueoEA5qom7wMtOxWL1480bwJMAuow8ExyB0Gw r3G74th6OtdHq2dTeav3pMmxbT1QoevJnjG5AYYo7Y11YKxr2fgJawVBKPJKUqmT9N74 AAKg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :organization:references:in-reply-to:date:cc:to:from:subject :message-id:arc-authentication-results; bh=1tdATK8GBN4e+5G+WUT++O5zMf+1UVQR6642V5hgqSc=; b=P0nZjudBqR4juPJzDmHvbfBmL3C48Wiiygv0aQZ3u/yJeQYDQi3yaXdhl8kufHHlw5 kljy8N+XQGwCR4WSE+G2CvDnMgRYHD/uAwJQcsCEoRoi7oVWjuc4TEE9JtmWBYRJAauP BI3RVp0fVxjVMgqQKpWarGUGVoOBfF7xOqQZNuztKNoNjBuVlkJSmsV/XkVKHuieRcPp eJoCdH2dgiaYy2kJZnt/GY82DEETD7Rzs6WiVkeP1rikYXObDb1/ao86zJi6o9/ZGHlJ ZgTBqveW3Vuq4sfX5E+q0i2CWdf4HVlqPe8ZIVM1lNOh2sfbrpgZiQzXEPLEfyriVanH /HbQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=codethink.co.uk Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j11si12762262pff.406.2018.03.06.18.17.51; Tue, 06 Mar 2018 18:18:06 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=codethink.co.uk Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754091AbeCGCQ4 (ORCPT + 99 others); Tue, 6 Mar 2018 21:16:56 -0500 Received: from imap1.codethink.co.uk ([176.9.8.82]:38329 "EHLO imap1.codethink.co.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753940AbeCGCQy (ORCPT ); Tue, 6 Mar 2018 21:16:54 -0500 Received: from shadbolt.e.decadent.org.uk ([88.96.1.126] helo=xylophone) by imap1.codethink.co.uk with esmtpsa (Exim 4.84_2 #1 (Debian)) id 1etOdU-00049u-9f; Wed, 07 Mar 2018 02:16:56 +0000 Message-ID: <1520389011.23626.24.camel@codethink.co.uk> Subject: Re: [PATCH 4.4 06/34] sget(): handle failures of register_shrinker() From: Ben Hutchings To: Al Viro Cc: stable@vger.kernel.org, Sasha Levin , Greg Kroah-Hartman , LKML Date: Wed, 07 Mar 2018 02:16:51 +0000 In-Reply-To: <20180302084436.414587775@linuxfoundation.org> References: <20180302084435.842679610@linuxfoundation.org> <20180302084436.414587775@linuxfoundation.org> Organization: Codethink Ltd. Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.22.6-1+deb9u1 Mime-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 2018-03-02 at 09:51 +0100, Greg Kroah-Hartman wrote: > 4.4-stable review patch.  If anyone has any objections, please let me know. > > ------------------ > > From: Al Viro > > > [ Upstream commit 9ee332d99e4d5a97548943b81c54668450ce641b ] > > Signed-off-by: Al Viro > Signed-off-by: Sasha Levin > Signed-off-by: Greg Kroah-Hartman > --- >  fs/super.c |    6 +++++- >  1 file changed, 5 insertions(+), 1 deletion(-) > > --- a/fs/super.c > +++ b/fs/super.c > @@ -497,7 +497,11 @@ retry: >   hlist_add_head(&s->s_instances, &type->fs_supers); >   spin_unlock(&sb_lock); >   get_filesystem(type); > - register_shrinker(&s->s_shrink); > + err = register_shrinker(&s->s_shrink); > + if (err) { > + deactivate_locked_super(s); But deactivate_locked_super() will call unregister_shrinker(), which doesn't look safe if register_shrinker() failed. Ben. > + s = ERR_PTR(err); > + } >   return s; >  } >   > > > -- Ben Hutchings Software Developer, Codethink Ltd.