diff options
author | Theodore Ts'o <tytso@mit.edu> | 2011-05-01 18:16:26 -0400 |
---|---|---|
committer | Theodore Ts'o <tytso@mit.edu> | 2011-05-01 18:16:26 -0400 |
commit | deeeaf13b291420fe4a4a52606b9fc9128387340 (patch) | |
tree | 2e7cbab5f598839771022453e8ed4ea18fb1e0af /sound/sh | |
parent | 59802db0745ddfe5cfd0d965e9d489f1b4713868 (diff) |
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>
Diffstat (limited to 'sound/sh')
0 files changed, 0 insertions, 0 deletions