From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9B36BC6FD1D for ; Mon, 20 Mar 2023 11:15:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229768AbjCTLPH (ORCPT ); Mon, 20 Mar 2023 07:15:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58478 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230082AbjCTLOc (ORCPT ); Mon, 20 Mar 2023 07:14:32 -0400 Received: from smtp-out1.suse.de (smtp-out1.suse.de [IPv6:2001:67c:2178:6::1c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4ADFF4C1F for ; Mon, 20 Mar 2023 04:12:31 -0700 (PDT) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id E9DCF21B71; Mon, 20 Mar 2023 11:12:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1679310749; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=fMu9OffZX526pQrNBQvCNvgPtFd7h9D0cKj/XO+Ga+I=; b=HAer1enapI6ghlon68EOdykvbWSbTTUrQ//6JU+h+OnSAa4tgUVSHn1yrgEY5j6McikzeM GUNkX96Udvb7+GCN3bsJdsgVM4kEVbBDfFNR6S9Tg492f5PPxsI6n7gDhGKIvQyL5sOX8M zaTxZYpmYQ2oLazETy5G3Z8qMDZaPH0= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1679310749; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=fMu9OffZX526pQrNBQvCNvgPtFd7h9D0cKj/XO+Ga+I=; b=LCLu0eGVS4WfTU1H1aBLmp9ir6TYfsayxhO6oZPz3tbJci6cDauIG5ic19UJv6JfCjCagy 9X3pqfIw4i8qBJAg== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id D856413416; Mon, 20 Mar 2023 11:12:29 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id tOfENJ0/GGQtLQAAMHmgww (envelope-from ); Mon, 20 Mar 2023 11:12:29 +0000 Received: by quack3.suse.cz (Postfix, from userid 1000) id 46107A0719; Mon, 20 Mar 2023 12:12:29 +0100 (CET) Date: Mon, 20 Mar 2023 12:12:29 +0100 From: Jan Kara To: Yangtao Li Cc: Jan Kara , linux-kernel@vger.kernel.org Subject: Re: [PATCH] quota: check for register_sysctl() failure Message-ID: <20230320111229.a2zi3m5rszuhffwx@quack3> References: <20230318160640.48461-1-frank.li@vivo.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230318160640.48461-1-frank.li@vivo.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun 19-03-23 00:06:39, Yangtao Li wrote: > register_sysctl() might fail, call panic() as with other failure > checks in this function if register_sysctl() failed. > > Signed-off-by: Yangtao Li ... > @@ -2955,7 +2955,8 @@ static int __init dquot_init(void) > > printk(KERN_NOTICE "VFS: Disk quotas %s\n", __DQUOT_VERSION__); > > - register_sysctl("fs/quota", fs_dqstats_table); > + if (!register_sysctl("fs/quota", fs_dqstats_table)) > + panic("Cannot register dquot sysctl"); Well, but this is going to make system unbootable with CONFIG_QUOTA && !CONFIG_SYSCTL. Quota functionality actually does not depend on sysctl being available so just continuing without sysctl is perfectly fine. Honza -- Jan Kara SUSE Labs, CR