Re: [PATCH] quota: check for register_sysctl() failure

From: Jan Kara
Date: Mon Mar 20 2023 - 07:15:09 EST


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 <frank.li@xxxxxxxx>

...

> @@ -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 <jack@xxxxxxxx>
SUSE Labs, CR