• Jan Kara's avatar
    jbd2: protect all log tail updates with j_checkpoint_mutex · 7f63bfd0
    Jan Kara authored
    commit a78bb11d upstream.
    
    There are some log tail updates that are not protected by j_checkpoint_mutex.
    Some of these are harmless because they happen during startup or shutdown but
    updates in jbd2_journal_commit_transaction() and jbd2_journal_flush() can
    really race with other log tail updates (e.g. someone doing
    jbd2_journal_flush() with someone running jbd2_cleanup_journal_tail()). So
    protect all log tail updates with j_checkpoint_mutex.
    Signed-off-by: default avatarJan Kara <jack@suse.cz>
    Signed-off-by: default avatar"Theodore Ts'o" <tytso@mit.edu>
    [bwh: Backported to 3.2:
     - Adjust context
     - Add unlock on the error path in jbd2_journal_flush()]
    Signed-off-by: default avatarBen Hutchings <ben@decadent.org.uk>
    Cc: Bartosz Kwitniewski <zerg2000@astral.org.pl>
    7f63bfd0
commit.c 32.1 KB