kernel-ark/fs/jbd
Ted Ts'o d9b01934d5 jbd: fix fsync() tid wraparound bug
If an application program does not make any changes to the indirect
blocks or extent tree, i_datasync_tid will not get updated.  If there
are enough commits (i.e., 2**31) such that tid_geq()'s calculations
wrap, and there isn't a currently active transaction at the time of
the fdatasync() call, this can end up triggering a BUG_ON in
fs/jbd/commit.c:

	J_ASSERT(journal->j_running_transaction != NULL);

It's pretty rare that this can happen, since it requires the use of
fdatasync() plus *very* frequent and excessive use of fsync().  But
with the right workload, it can.

We fix this by replacing the use of tid_geq() with an equality test,
since there's only one valid transaction id that is valid for us to
start: namely, the currently running transaction (if it exists).

CC: stable@kernel.org
Reported-by: Martin_Zielinski@McAfee.com
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Signed-off-by: Jan Kara <jack@suse.cz>
2011-05-17 13:47:41 +02:00
..
checkpoint.c jbd: Convert atomic_inc() to get_bh() 2010-10-28 01:30:05 +02:00
commit.c Fix common misspellings 2011-03-31 11:26:23 -03:00
journal.c jbd: fix fsync() tid wraparound bug 2011-05-17 13:47:41 +02:00
Kconfig Revert "task_struct: make journal_info conditional" 2009-12-17 13:23:24 -08:00
Makefile
recovery.c jbd: Move debug message into #ifdef area 2010-10-28 01:30:01 +02:00
revoke.c Fix common misspellings 2011-03-31 11:26:23 -03:00
transaction.c Fix common misspellings 2011-03-31 11:26:23 -03:00