diff options
author | Jan Kara <jack@suse.cz> | 2006-09-29 05:00:26 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-09-29 12:18:14 -0400 |
commit | b525a7e4445c4702dfc541930747517615c0c72a (patch) | |
tree | d6feb0839c37ba70b284d31aa35469c8cee4c113 /fs/dquot.c | |
parent | 254e948b2908dd50df9dca4e6ed14b6cc8524fc9 (diff) |
[PATCH] dquot: add proper locking when using current->signal->tty
Dquot passes the tty to tty_write_message without locking
Signed-off-by: Jan Kara <jack@suse.cz>
Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'fs/dquot.c')
-rw-r--r-- | fs/dquot.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/fs/dquot.c b/fs/dquot.c index 0122a279106a..9af789567e51 100644 --- a/fs/dquot.c +++ b/fs/dquot.c | |||
@@ -834,6 +834,9 @@ static void print_warning(struct dquot *dquot, const char warntype) | |||
834 | if (!need_print_warning(dquot) || (flag && test_and_set_bit(flag, &dquot->dq_flags))) | 834 | if (!need_print_warning(dquot) || (flag && test_and_set_bit(flag, &dquot->dq_flags))) |
835 | return; | 835 | return; |
836 | 836 | ||
837 | mutex_lock(&tty_mutex); | ||
838 | if (!current->signal->tty) | ||
839 | goto out_lock; | ||
837 | tty_write_message(current->signal->tty, dquot->dq_sb->s_id); | 840 | tty_write_message(current->signal->tty, dquot->dq_sb->s_id); |
838 | if (warntype == ISOFTWARN || warntype == BSOFTWARN) | 841 | if (warntype == ISOFTWARN || warntype == BSOFTWARN) |
839 | tty_write_message(current->signal->tty, ": warning, "); | 842 | tty_write_message(current->signal->tty, ": warning, "); |
@@ -861,6 +864,8 @@ static void print_warning(struct dquot *dquot, const char warntype) | |||
861 | break; | 864 | break; |
862 | } | 865 | } |
863 | tty_write_message(current->signal->tty, msg); | 866 | tty_write_message(current->signal->tty, msg); |
867 | out_lock: | ||
868 | mutex_unlock(&tty_mutex); | ||
864 | } | 869 | } |
865 | 870 | ||
866 | static inline void flush_warnings(struct dquot **dquots, char *warntype) | 871 | static inline void flush_warnings(struct dquot **dquots, char *warntype) |