diff options
Diffstat (limited to 'fs/dquot.c')
-rw-r--r-- | fs/dquot.c | 14 |
1 files changed, 8 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) | |||
828 | static void print_warning(struct dquot *dquot, const char warntype) | 828 | static 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); |
867 | out_lock: | 869 | out_lock: |
868 | mutex_unlock(&tty_mutex); | 870 | mutex_unlock(&tty_mutex); |
869 | } | 871 | } |