aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
Diffstat (limited to 'fs')
-rw-r--r--fs/dquot.c14
-rw-r--r--fs/open.c1
2 files changed, 9 insertions, 6 deletions
diff --git a/fs/dquot.c b/fs/dquot.c
index f9cd5e23ebdf..89066b19124d 100644
--- a/fs/dquot.c
+++ b/fs/dquot.c
@@ -828,6 +828,7 @@ static inline int need_print_warning(struct dquot *dquot)
828static void print_warning(struct dquot *dquot, const char warntype) 828static void print_warning(struct dquot *dquot, const char warntype)
829{ 829{
830 char *msg = NULL; 830 char *msg = NULL;
831 struct tty_struct *tty;
831 int flag = (warntype == BHARDWARN || warntype == BSOFTLONGWARN) ? DQ_BLKS_B : 832 int flag = (warntype == BHARDWARN || warntype == BSOFTLONGWARN) ? DQ_BLKS_B :
832 ((warntype == IHARDWARN || warntype == ISOFTLONGWARN) ? DQ_INODES_B : 0); 833 ((warntype == IHARDWARN || warntype == ISOFTLONGWARN) ? DQ_INODES_B : 0);
833 834
@@ -835,14 +836,15 @@ static void print_warning(struct dquot *dquot, const char warntype)
835 return; 836 return;
836 837
837 mutex_lock(&tty_mutex); 838 mutex_lock(&tty_mutex);
838 if (!current->signal->tty) 839 tty = get_current_tty();
840 if (!tty)
839 goto out_lock; 841 goto out_lock;
840 tty_write_message(current->signal->tty, dquot->dq_sb->s_id); 842 tty_write_message(tty, dquot->dq_sb->s_id);
841 if (warntype == ISOFTWARN || warntype == BSOFTWARN) 843 if (warntype == ISOFTWARN || warntype == BSOFTWARN)
842 tty_write_message(current->signal->tty, ": warning, "); 844 tty_write_message(tty, ": warning, ");
843 else 845 else
844 tty_write_message(current->signal->tty, ": write failed, "); 846 tty_write_message(tty, ": write failed, ");
845 tty_write_message(current->signal->tty, quotatypes[dquot->dq_type]); 847 tty_write_message(tty, quotatypes[dquot->dq_type]);
846 switch (warntype) { 848 switch (warntype) {
847 case IHARDWARN: 849 case IHARDWARN:
848 msg = " file limit reached.\r\n"; 850 msg = " file limit reached.\r\n";
@@ -863,7 +865,7 @@ static void print_warning(struct dquot *dquot, const char warntype)
863 msg = " block quota exceeded.\r\n"; 865 msg = " block quota exceeded.\r\n";
864 break; 866 break;
865 } 867 }
866 tty_write_message(current->signal->tty, msg); 868 tty_write_message(tty, msg);
867out_lock: 869out_lock:
868 mutex_unlock(&tty_mutex); 870 mutex_unlock(&tty_mutex);
869} 871}
diff --git a/fs/open.c b/fs/open.c
index 89e0c237a636..3b56192816ca 100644
--- a/fs/open.c
+++ b/fs/open.c
@@ -1087,6 +1087,7 @@ EXPORT_SYMBOL(sys_close);
1087asmlinkage long sys_vhangup(void) 1087asmlinkage long sys_vhangup(void)
1088{ 1088{
1089 if (capable(CAP_SYS_TTY_CONFIG)) { 1089 if (capable(CAP_SYS_TTY_CONFIG)) {
1090 /* XXX: this needs locking */
1090 tty_vhangup(current->signal->tty); 1091 tty_vhangup(current->signal->tty);
1091 return 0; 1092 return 0;
1092 } 1093 }