From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752912AbdKWPeW (ORCPT ); Thu, 23 Nov 2017 10:34:22 -0500 Received: from mx2.suse.de ([195.135.220.15]:49912 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752493AbdKWPeU (ORCPT ); Thu, 23 Nov 2017 10:34:20 -0500 Date: Thu, 23 Nov 2017 16:34:19 +0100 From: Michal Hocko To: Al Viro Cc: Dave Chinner , Jan Kara , Tetsuo Handa , LKML , linux-fsdevel@vger.kernel.org, Andrew Morton Subject: Re: [PATCH v2] fs: handle shrinker registration failure in sget_userns Message-ID: <20171123153419.bdfot5y6dwbjqcry@dhcp22.suse.cz> References: <20171123115247.30685-1-mhocko@kernel.org> <20171123143537.ztpxpk3sjbpo72rf@dhcp22.suse.cz> <20171123145540.GB21978@ZenIV.linux.org.uk> <20171123150211.v66actuyh755kr7g@dhcp22.suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20171123150211.v66actuyh755kr7g@dhcp22.suse.cz> User-Agent: NeoMutt/20170609 (1.8.3) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu 23-11-17 16:02:11, Michal Hocko wrote: > On Thu 23-11-17 14:55:40, Al Viro wrote: > > On Thu, Nov 23, 2017 at 03:35:37PM +0100, Michal Hocko wrote: > > > Hopefully less screwed version. But as I've said I am not really > > > familiar with the code and do not feel competent to change it so please > > > be very careful here. I've moved the shrinker registration to > > > alloc_super which turned out to be simpler. > > > > I don't get it. Why the hell do we need all that PITA in the first place? > > Just make sget_userns() end with > > if (unlikely(regsiter_shrinker(&s->s_shrink) != 0)) { > > deactivate_locked_super(s); > > s = ERR_PTR(-ENOMEM); > > } > > return s; > > and be done with that. All there is to it... > > Who is going to unregister that shrinker on other failure paths? Scratch that. I've mixed destroy_unused_super with deactivate_locked_super. Go with whatever works... -- Michal Hocko SUSE Labs