linux-stable/fs/jbd2
Theodore Ts'o 23643c00e5 jbd2: fix theoretical race in jbd2__journal_restart
commit 39c04153fd upstream.

Once we decrement transaction->t_updates, if this is the last handle
holding the transaction from closing, and once we release the
t_handle_lock spinlock, it's possible for the transaction to commit
and be released.  In practice with normal kernels, this probably won't
happen, since the commit happens in a separate kernel thread and it's
unlikely this could all happen within the space of a few CPU cycles.

On the other hand, with a real-time kernel, this could potentially
happen, so save the tid found in transaction->t_tid before we release
t_handle_lock.  It would require an insane configuration, such as one
where the jbd2 thread was set to a very high real-time priority,
perhaps because a high priority real-time thread is trying to read or
write to a file system.  But some people who use real-time kernels
have been known to do insane things, including controlling
laser-wielding industrial robots.  :-)

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-07-21 18:14:40 -07:00
..
checkpoint.c jbd2: Fix oops in jbd2_journal_remove_journal_head() 2011-06-13 15:38:22 -04:00
commit.c jbd2: use GFP_NOFS for blkdev_issue_flush 2012-04-27 09:51:07 -07:00
journal.c jbd/jbd2: validate sb->s_first in journal_get_superblock() 2011-12-21 12:57:40 -08:00
Kconfig Revert "task_struct: make journal_info conditional" 2009-12-17 13:23:24 -08:00
Makefile [PATCH] jbd2: rename jbd2 symbols to avoid duplication of jbd symbols 2006-10-11 11:14:15 -07:00
recovery.c jbd2: move debug message into debug #ifdef 2010-12-18 13:36:33 -05:00
revoke.c Fix common misspellings 2011-03-31 11:26:23 -03:00
transaction.c jbd2: fix theoretical race in jbd2__journal_restart 2013-07-21 18:14:40 -07:00