quota: remove PRINT_QUOTA_WARNING support
PATCH 1/1 quota: remove PRINT_QUOTA_WARNING support
It's deprecated since commit 8e8934695dfd ("quota: send messages via netlink"), so let's remove it. User should use notification via netlink socket instead.
Signed-off-by Yangtao Li <[email protected]>
--- fs/quota/Kconfig | 10 ------ fs/quota/dquot.c | 80 +----------------------------------------------- 2 files changed, 1 insertion(+), 89 deletions(-)
fs/quota/Kconfig +0 -10
@@ -26,16 +26,6 @@ config QUOTA_NETLINK_INTERFACE hardlimit, etc.) will be reported through netlink interface. If unsure, say Y. -config PRINT_QUOTA_WARNING - bool "Print quota warnings to console (OBSOLETE)" - depends on QUOTA - default y - help - If you say Y here, quota warnings (about exceeding softlimit, reaching - hardlimit, etc.) will be printed to the process' controlling terminal. - Note that this behavior is currently deprecated and may go away in - future. Please use notification via netlink socket instead. - config QUOTA_DEBUG bool "Additional quota sanity checks" depends on QUOTA
fs/quota/dquot.c +1 -79
104 lines not on this page · raw message
Signature · 1 line
2.35.1
Quoted 5 lines · Yangtao Li
It's deprecated since commit
8e8934695dfd("quota: send messages via netlink"), so let's remove it. User should use notification via netlink socket instead.Signed-off-by Yangtao Li <[email protected]>
Yeah, but frankly I'm not sure whether there are not people still relying on this. In particular distributions still seem to enable this config option in their kernels. So rather than removing this config right away, we could maybe make it depend on CONFIG_BROKEN and see who complains...
Honza
Quoted 136 lines
fs/quota/Kconfig +0
-10@@ -26,16 +26,6 @@ config QUOTA_NETLINK_INTERFACE hardlimit, etc.) will be reported through netlink interface. If unsure, say Y. -config PRINT_QUOTA_WARNING - bool "Print quota warnings to console (OBSOLETE)" - depends on QUOTA - default y - help - If you say Y here, quota warnings (about exceeding softlimit, reaching - hardlimit, etc.) will be printed to the process' controlling terminal. - Note that this behavior is currently deprecated and may go away in - future. Please use notification via netlink socket instead. - config QUOTA_DEBUG bool "Additional quota sanity checks" depends on QUOTAfs/quota/dquot.c +1
-79@@ -154,7 +154,7 @@ void __quota_error(struct super_block *sb, const char *func, }EXPORT_SYMBOL (__quota_error); -#if defined(CONFIG_QUOTA_DEBUG ) || defined(CONFIG_PRINT_QUOTA_WARNING ) +#if defined(CONFIG_QUOTA_DEBUG )static char *quotatypes[] =INITQFNAMES ;#endif static struct quota_format_type *quota_formats;/* List of registered formats */ @@ -1171,72 +1171,6 @@ static int warning_issued(struct dquot *dquot, const int warntype)return test_and_set_bit (flag, &dquot->dq_flags); } -#ifdef CONFIG_PRINT_QUOTA_WARNING -static int flag_print_warnings =1 ; - -static int need_print_warning (struct dquot_warn *warn) -{ -if (!flag_print_warnings) -return 0 ; - -switch (warn->w_dq_id.type) { -case USRQUOTA : -return uid_eq (current_fsuid (), warn->w_dq_id.uid); -case GRPQUOTA : -return in_group_p (warn->w_dq_id.gid); -case PRJQUOTA : -return 1 ; - } -return 0 ; -} - -/* Print warning to user which exceeded quota */ -static void print_warning (struct dquot_warn *warn) -{ -char *msg =NULL ; -struct tty_struct *tty; -int warntype = warn->w_type; - -if (warntype ==QUOTA_NL_IHARDBELOW || - warntype ==QUOTA_NL_ISOFTBELOW || - warntype ==QUOTA_NL_BHARDBELOW || - warntype ==QUOTA_NL_BSOFTBELOW || !need_print_warning (warn)) -return ; - - tty =get_current_tty (); -if (!tty) -return ; -tty_write_message (tty, warn->w_sb->s_id); -if (warntype ==QUOTA_NL_ISOFTWARN || warntype ==QUOTA_NL_BSOFTWARN ) -tty_write_message (tty,": warning, " ); -else -tty_write_message (tty,": write failed, " ); -tty_write_message (tty, quotatypes[warn->w_dq_id.type]); -switch (warntype) { -case QUOTA_NL_IHARDWARN : - msg =" file limit reached.\r\n" ; -break ; -case QUOTA_NL_ISOFTLONGWARN : - msg =" file quota exceeded too long.\r\n" ; -break ; -case QUOTA_NL_ISOFTWARN : - msg =" file quota exceeded.\r\n" ; -break ; -case QUOTA_NL_BHARDWARN : - msg =" block limit reached.\r\n" ; -break ; -case QUOTA_NL_BSOFTLONGWARN : - msg =" block quota exceeded too long.\r\n" ; -break ; -case QUOTA_NL_BSOFTWARN : - msg =" block quota exceeded.\r\n" ; -break ; - } -tty_write_message (tty, msg); -tty_kref_put (tty); -} -#endif -static void prepare_warning (struct dquot_warn *warn,struct dquot *dquot,int warntype) {@@ -1259,9 +1193,6 @@ static void flush_warnings(struct dquot_warn *warn)for (i =0 ; i <MAXQUOTAS ; i++) {if (warn[i].w_type ==QUOTA_NL_NOWARN )continue ; -#ifdef CONFIG_PRINT_QUOTA_WARNING -print_warning (&warn[i]); -#endif quota_send_warning (warn[i].w_dq_id, warn[i].w_sb->s_dev, warn[i].w_type); }@@ -2936,15 +2867,6 @@ static struct ctl_table fs_dqstats_table[] = { .mode = 0444, .proc_handler = do_proc_dqstats, }, -#ifdef CONFIG_PRINT_QUOTA_WARNING - { - .procname = "warnings", - .data = &flag_print_warnings, - .maxlen = sizeof(int), - .mode = 0644, - .proc_handler = proc_dointvec, - }, -#endif { }, };Signature · 1 line
2.35.1
Signature · 2 lines
Jan Kara <[email protected]> SUSE Labs, CR