quota: remove CONFIG_PRINT_QUOTA_WARNING code
Subsystems (4)
Jiri Slaby (SUSE)
maintainerPATCH 1/1 quota: remove CONFIG_PRINT_QUOTA_WARNING code
CONFIG_PRINT_QUOTA_WARNING was marked as BROKEN in 2023 by 36d532d713db ("quota: mark PRINT_QUOTA_WARNING as BROKEN").
The code is apparently unused and uninteresting, so remove it all, incl. the abuse of TTY.
---
Cc: Huacai Chen <[email protected]>
Cc: WANG Xuerui <[email protected]>
Cc: Thomas Bogendoerfer <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
--- arch/loongarch/configs/loongson32_defconfig | 1 - arch/loongarch/configs/loongson64_defconfig | 1 - arch/mips/configs/bigsur_defconfig | 1 - arch/mips/configs/ip22_defconfig | 1 - arch/mips/configs/loongson2k_defconfig | 1 - drivers/tty/tty_io.c | 27 ------- fs/quota/Kconfig | 10 --- fs/quota/dquot.c | 81 +-------------------- 8 files changed, 2 insertions(+), 121 deletions(-)
arch/loongarch/configs/loongson32_defconfig +0 -1
@@ -974,7 +974,6 @@ CONFIG_FS_VERITY=y CONFIG_FANOTIFY=y CONFIG_FANOTIFY_ACCESS_PERMISSIONS=y CONFIG_QUOTA=y -# CONFIG_PRINT_QUOTA_WARNING is not set CONFIG_QFMT_V1=m CONFIG_QFMT_V2=m CONFIG_AUTOFS_FS=y
arch/loongarch/configs/loongson64_defconfig +0 -1
@@ -1005,7 +1005,6 @@ CONFIG_FS_VERITY=y CONFIG_FANOTIFY=y CONFIG_FANOTIFY_ACCESS_PERMISSIONS=y CONFIG_QUOTA=y -# CONFIG_PRINT_QUOTA_WARNING is not set CONFIG_QFMT_V1=m CONFIG_QFMT_V2=m CONFIG_AUTOFS_FS=y
arch/mips/configs/bigsur_defconfig +0 -1
@@ -140,7 +140,6 @@ CONFIG_EXT4_FS_SECURITY=y CONFIG_EXT4_FS=y CONFIG_QUOTA=y CONFIG_QUOTA_NETLINK_INTERFACE=y -# CONFIG_PRINT_QUOTA_WARNING is not set CONFIG_QFMT_V2=m CONFIG_AUTOFS_FS=m CONFIG_FUSE_FS=m
arch/mips/configs/ip22_defconfig +0 -1
@@ -238,7 +238,6 @@ CONFIG_XFS_FS=m CONFIG_XFS_QUOTA=y CONFIG_QUOTA=y CONFIG_QUOTA_NETLINK_INTERFACE=y -# CONFIG_PRINT_QUOTA_WARNING is not set CONFIG_QFMT_V2=m CONFIG_AUTOFS_FS=m CONFIG_FUSE_FS=m
arch/mips/configs/loongson2k_defconfig +0 -1
@@ -303,7 +303,6 @@ CONFIG_XFS_FS=y CONFIG_XFS_QUOTA=y CONFIG_XFS_POSIX_ACL=y CONFIG_QUOTA=y -# CONFIG_PRINT_QUOTA_WARNING is not set CONFIG_AUTOFS_FS=y CONFIG_FUSE_FS=m CONFIG_ISO9660_FS=m
drivers/tty/tty_io.c +0 -27
@@ -1032,33 +1032,6 @@ static ssize_t iterate_tty_write(struct tty_ldisc *ld, struct tty_struct *tty,return ret; } -#ifdef CONFIG_PRINT_QUOTA_WARNING -/** -* tty_write_message - write a message to a certain tty, not just the console. -* @tty: the destination tty_struct -* @msg: the message to write -* -* This is used for messages that need to be redirected to a specific tty. We -* don't put it into the syslog queue right now maybe in the future if really -* needed. -* -* We must still hold the BTM and test the CLOSING flag for the moment. -* -* This function is DEPRECATED, do not use in new code. -*/ -void tty_write_message (struct tty_struct *tty,char *msg) -{ -if (tty) { -mutex_lock (&tty->atomic_write_lock); -tty_lock (tty); -if (tty->ops->write && tty->count >0 ) - tty->ops->write (tty, msg,strlen (msg)); -tty_unlock (tty); -tty_write_unlock (tty); - } -} -#endif -static ssize_t file_tty_write (struct file *file,struct kiocb *iocb,struct iov_iter *from) {struct tty_struct *tty =file_tty (file);
fs/quota/Kconfig +0 -10
@@ -25,16 +25,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 && BROKEN - 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 +2 -79
105 lines not on this page · raw message
Signature · 1 line
2.55.0
Quoted 10 lines · Jiri Slaby (SUSE)
CONFIG_PRINT_QUOTA_WARNINGwas marked as BROKEN in 2023 by36d532d713db("quota: markPRINT_QUOTA_WARNINGas BROKEN").The code is apparently unused and uninteresting, so remove it all, incl. the abuse of TTY.
Signed-off-by Jiri Slaby (SUSE) <[email protected]>Cc Greg Kroah-Hartman <[email protected]>Cc Jan Kara <[email protected]>Cc Yangtao Li <[email protected]>
OK, I'm for trying this because so far nobody was complaining about the feature getting marked as BROKEN. Let's see how it goes...
Honza
Quoted 254 lines
---
Cc: Huacai Chen <[email protected]>
Cc: WANG Xuerui <[email protected]>
Cc: Thomas Bogendoerfer <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]--- arch/loongarch/configs/loongson32_defconfig | 1 - arch/loongarch/configs/loongson64_defconfig | 1 - arch/mips/configs/bigsur_defconfig | 1 - arch/mips/configs/ip22_defconfig | 1 - arch/mips/configs/loongson2k_defconfig | 1 - drivers/tty/tty_io.c | 27 ------- fs/quota/Kconfig | 10 --- fs/quota/dquot.c | 81 +-------------------- 8 files changed, 2 insertions(+), 121 deletions(-)arch/loongarch/configs/loongson32_defconfig +0
-1@@ -974,7 +974,6 @@ CONFIG_FS_VERITY=y CONFIG_FANOTIFY=y CONFIG_FANOTIFY_ACCESS_PERMISSIONS=y CONFIG_QUOTA=y -# CONFIG_PRINT_QUOTA_WARNING is not set CONFIG_QFMT_V1=m CONFIG_QFMT_V2=m CONFIG_AUTOFS_FS=yarch/loongarch/configs/loongson64_defconfig +0
-1@@ -1005,7 +1005,6 @@ CONFIG_FS_VERITY=y CONFIG_FANOTIFY=y CONFIG_FANOTIFY_ACCESS_PERMISSIONS=y CONFIG_QUOTA=y -# CONFIG_PRINT_QUOTA_WARNING is not set CONFIG_QFMT_V1=m CONFIG_QFMT_V2=m CONFIG_AUTOFS_FS=yarch/mips/configs/bigsur_defconfig +0
-1@@ -140,7 +140,6 @@ CONFIG_EXT4_FS_SECURITY=y CONFIG_EXT4_FS=y CONFIG_QUOTA=y CONFIG_QUOTA_NETLINK_INTERFACE=y -# CONFIG_PRINT_QUOTA_WARNING is not set CONFIG_QFMT_V2=m CONFIG_AUTOFS_FS=m CONFIG_FUSE_FS=march/mips/configs/ip22_defconfig +0
-1@@ -238,7 +238,6 @@ CONFIG_XFS_FS=m CONFIG_XFS_QUOTA=y CONFIG_QUOTA=y CONFIG_QUOTA_NETLINK_INTERFACE=y -# CONFIG_PRINT_QUOTA_WARNING is not set CONFIG_QFMT_V2=m CONFIG_AUTOFS_FS=m CONFIG_FUSE_FS=march/mips/configs/loongson2k_defconfig +0
-1@@ -303,7 +303,6 @@ CONFIG_XFS_FS=y CONFIG_XFS_QUOTA=y CONFIG_XFS_POSIX_ACL=y CONFIG_QUOTA=y -# CONFIG_PRINT_QUOTA_WARNING is not set CONFIG_AUTOFS_FS=y CONFIG_FUSE_FS=m CONFIG_ISO9660_FS=mdrivers/tty/tty_io.c +0
-27@@ -1032,33 +1032,6 @@ static ssize_t iterate_tty_write(struct tty_ldisc *ld, struct tty_struct *tty,return ret; } -#ifdef CONFIG_PRINT_QUOTA_WARNING -/** -* tty_write_message - write a message to a certain tty, not just the console. -* @tty: the destination tty_struct -* @msg: the message to write -* -* This is used for messages that need to be redirected to a specific tty. We -* don't put it into the syslog queue right now maybe in the future if really -* needed. -* -* We must still hold the BTM and test the CLOSING flag for the moment. -* -* This function is DEPRECATED, do not use in new code. -*/ -void tty_write_message (struct tty_struct *tty,char *msg) -{ -if (tty) { -mutex_lock (&tty->atomic_write_lock); -tty_lock (tty); -if (tty->ops->write && tty->count >0 ) - tty->ops->write (tty, msg,strlen (msg)); -tty_unlock (tty); -tty_write_unlock (tty); - } -} -#endif -static ssize_t file_tty_write (struct file *file,struct kiocb *iocb,struct iov_iter *from) {struct tty_struct *tty =file_tty (file);fs/quota/Kconfig +0
-10@@ -25,16 +25,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 && BROKEN - 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 +2
-79@@ -153,7 +153,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 ) +#ifdef CONFIG_QUOTA_DEBUG static char *quotatypes[] =INITQFNAMES ;#endif static struct quota_format_type *quota_formats;/* List of registered formats */ @@ -1208,72 +1208,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) {@@ -1296,9 +1230,7 @@ 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); }@@ -3008,15 +2940,6 @@ static const 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 };static int __init dquot_init (void )Signature · 1 line
2.55.0
Signature · 2 lines
Jan Kara <[email protected]> SUSE Labs, CR
Quoted 7 lines · Jan Kara
Quoted 6 lines · Jiri Slaby (SUSE)
CONFIG_PRINT_QUOTA_WARNINGwas marked as BROKEN in 2023 by36d532d713db("quota: markPRINT_QUOTA_WARNINGas BROKEN").The code is apparently unused and uninteresting, so remove it all, incl. the abuse of TTY.
Quoted 7 lines
Quoted 4 lines
Signed-off-by Jiri Slaby (SUSE) <[email protected]>Cc Greg Kroah-Hartman <[email protected]>Cc Jan Kara <[email protected]>Cc Yangtao Li <[email protected]>OK, I'm for trying this because so far nobody was complaining about the feature getting marked as BROKEN. Let's see how it goes...
Great!