linux-stable/fs/jbd2
Theodore Ts'o deeeaf13b2 jbd2: 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/jbd2/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 we is valid for us to
wait until it is commited: namely, the currently running transaction
(if it exists).

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2011-05-01 18:16:26 -04:00
..
checkpoint.c Merge branch 'next' into upstream-merge 2010-10-27 23:44:47 -04:00
commit.c Merge branch 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4 2011-04-11 15:45:47 -07:00
journal.c jbd2: fix fsync() tid wraparound bug 2011-05-01 18:16:26 -04:00
Kconfig Revert "task_struct: make journal_info conditional" 2009-12-17 13:23:24 -08:00
Makefile
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 Fix common misspellings 2011-03-31 11:26:23 -03:00