From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752015AbdLJKFV (ORCPT ); Sun, 10 Dec 2017 05:05:21 -0500 Received: from mx2.suse.de ([195.135.220.15]:46687 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751359AbdLJKFS (ORCPT ); Sun, 10 Dec 2017 05:05:18 -0500 Date: Sun, 10 Dec 2017 11:05:15 +0100 From: Michal Hocko To: Tetsuo Handa Cc: viro@ZenIV.linux.org.uk, david@fromorbit.com, jack@suse.cz, linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, akpm@linux-foundation.org Subject: Re: [PATCH v2] fs: handle shrinker registration failure in sget_userns Message-ID: <20171210100515.GZ20234@dhcp22.suse.cz> References: <20171123143537.ztpxpk3sjbpo72rf@dhcp22.suse.cz> <20171123145540.GB21978@ZenIV.linux.org.uk> <20171129115515.kaixngb7zn7pjxhc@dhcp22.suse.cz> <20171209205922.GM21978@ZenIV.linux.org.uk> <20171209215422.GN21978@ZenIV.linux.org.uk> <201712101133.JCH21396.QSMOtFOOLJFHFV@I-love.SAKURA.ne.jp> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201712101133.JCH21396.QSMOtFOOLJFHFV@I-love.SAKURA.ne.jp> User-Agent: Mutt/1.9.1 (2017-09-22) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun 10-12-17 11:33:18, Tetsuo Handa wrote: > Al Viro wrote: > > On Sat, Dec 09, 2017 at 08:59:22PM +0000, Al Viro wrote: > > > On Wed, Nov 29, 2017 at 12:55:15PM +0100, 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... > > > > > > > > Al, do you plan to push this fix? Tetsuo's unregister_shrinker > > > > fortification is already in the mmotm tree. > > > > > > Is it in any git branch I could pull from? Or I could just throw it > > > into vfs.git#for-linus before the fix above - up to you, folks... > > > > Actually, looking at mmotm... I don't see it there. Which patch > > is it in? > > > > My unregister_shrinker() fortification patch > ( http://lkml.kernel.org/r/1511523385-6433-1-git-send-email-penguin-kernel@I-love.SAKURA.ne.jp ) > is not yet in the mmotm tree due to disagreement between Michal and I, but > you can throw your sget_userns() patch into vfs.git#for-linus anyway. > We will eventually apply unregister_shrinker() fortification patch. I've acked the patch http://lkml.kernel.org/r/20171124122148.qevmiogh3pzr4zix@dhcp22.suse.cz I disagreed with your must_check patch which has nothing to do with the patch disussed here. I've also suggested some changelog clarifications. Please repost and I am pretty sure Andew will pick it up. -- Michal Hocko SUSE Labs