Received: by 10.223.185.116 with SMTP id b49csp6330893wrg; Wed, 28 Feb 2018 07:41:42 -0800 (PST) X-Google-Smtp-Source: AG47ELs+algDuNpLs5N610ylkIAK81qkH7CBgDarzLKJyP601esqj9QjOSnWZh07FURSKOU36sBO X-Received: by 10.98.56.131 with SMTP id f125mr7632361pfa.190.1519832502640; Wed, 28 Feb 2018 07:41:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519832502; cv=none; d=google.com; s=arc-20160816; b=FNTgM9Ev6BDBR7tk9fV3mZLYSLmdZLYo45nuAUuCbiTdwJK6mDnvgtr4UJnc53PxLo fk3rogfw78iRCjAm3Too4JSWCq8ZOnUhF6vuLhqEZG0ZwL/B82cymlCN/AdgP/4wkcs6 4SvIJxU8ep5639Mmz3Y4toTJzs/qe2FemIRbN3d4xfAEI0vDIJs8b8EvFqZLfNNRB1Ht zj0/Zj4axwUbXrgTf1DpjCH9RxyZROq//zsXALukfHdEyUsDkq5Sy/bQEc6+ulJn38Eh S7iu6lAah1jPGp9LPUqSbW6bhKWrt3OQLGylchGePeGxy8LWIUBq+a6YXq4JW98wmW7M oPcQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:subject:message-id:date:cc:to :from:mime-version:content-transfer-encoding:content-disposition :arc-authentication-results; bh=yRUjyC3i5FrkWqibtufJo0ZIuV0wW1VBssFC4Ju2pp8=; b=P95bXTcp4/ltoxcofbfT/Kd/rd5gOcz0K2JxR0WVZpEH9TC6i6cGRRNK0C+RaQuR/U EsCw7be910cuTiixk72ebls1swjcqmBGPieS+Vfmky87WtmYNjutqbNMSpzTUJRJn9h6 WV14TxU8iomQm5T5xrJO/nfVXHhgDPgCFK4lUvQ++ullA9Jim86IBYPzTEBdtauN0TPg CiqJRJ1hdw2xl5/YMGkInkgJZIYE6E8uNLb+BSM20WJqcZcxpFxZxcSW78BIIGOf0Uks JhXOfI7tf7EM9UYrWwSjYpH+lN282cSOiGy0QNkoXjUjySKZ3up2LmEfKBdbWqS2nRE8 J95g== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r62si1154203pgr.77.2018.02.28.07.41.27; Wed, 28 Feb 2018 07:41:42 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933229AbeB1PjE (ORCPT + 99 others); Wed, 28 Feb 2018 10:39:04 -0500 Received: from shadbolt.e.decadent.org.uk ([88.96.1.126]:33229 "EHLO shadbolt.e.decadent.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752671AbeB1PWc (ORCPT ); Wed, 28 Feb 2018 10:22:32 -0500 Received: from [2a02:8011:400e:2:6f00:88c8:c921:d332] (helo=deadeye) by shadbolt.decadent.org.uk with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1er3Ye-0006Xm-ND; Wed, 28 Feb 2018 15:22:17 +0000 Received: from ben by deadeye with local (Exim 4.90_1) (envelope-from ) id 1er3Yd-0008P3-SU; Wed, 28 Feb 2018 15:22:15 +0000 Content-Type: text/plain; charset="UTF-8" Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 From: Ben Hutchings To: linux-kernel@vger.kernel.org, stable@vger.kernel.org CC: akpm@linux-foundation.org, "Jan Kara" , "Jan Kara" , "Michal Hocko" , "Tetsuo Handa" Date: Wed, 28 Feb 2018 15:20:18 +0000 Message-ID: X-Mailer: LinuxStableQueue (scripts by bwh) Subject: [PATCH 3.16 035/254] quota: Check for register_shrinker() failure. In-Reply-To: X-SA-Exim-Connect-IP: 2a02:8011:400e:2:6f00:88c8:c921:d332 X-SA-Exim-Mail-From: ben@decadent.org.uk X-SA-Exim-Scanned: No (on shadbolt.decadent.org.uk); SAEximRunCond expanded to false Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 3.16.55-rc1 review patch. If anyone has any objections, please let me know. ------------------ From: Tetsuo Handa commit 88bc0ede8d35edc969350852894dc864a2dc1859 upstream. register_shrinker() might return -ENOMEM error since Linux 3.12. Call panic() as with other failure checks in this function if register_shrinker() failed. Fixes: 1d3d4437eae1 ("vmscan: per-node deferred work") Signed-off-by: Tetsuo Handa Cc: Jan Kara Cc: Michal Hocko Reviewed-by: Michal Hocko Signed-off-by: Jan Kara Signed-off-by: Ben Hutchings --- fs/quota/dquot.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) --- a/fs/quota/dquot.c +++ b/fs/quota/dquot.c @@ -2747,7 +2747,8 @@ static int __init dquot_init(void) printk("Dquot-cache hash table entries: %ld (order %ld, %ld bytes)\n", nr_hash, order, (PAGE_SIZE << order)); - register_shrinker(&dqcache_shrinker); + if (register_shrinker(&dqcache_shrinker)) + panic("Cannot register dquot shrinker"); return 0; }