summaryrefslogtreecommitdiff
path: root/fs/ext2
diff options
context:
space:
mode:
authorTed Ts'o <tytso@mit.edu>2011-04-30 13:17:11 -0400
committerJan Kara <jack@suse.cz>2011-05-17 13:47:41 +0200
commitd9b01934d56a96d9f4ae2d6204d4ea78a36f5f36 (patch)
tree56a34d3c459bfac781b8f71d866caa7dd092b7c2 /fs/ext2
parent86c4f6d85595cd7da635dc6985d27bfa43b1ae10 (diff)
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>
Diffstat (limited to 'fs/ext2')
0 files changed, 0 insertions, 0 deletions