• dingdinghua's avatar
    jbd2: fix race between write_metadata_buffer and get_write_access · 96577c43
    dingdinghua authored
    The function jbd2_journal_write_metadata_buffer() calls
    jbd_unlock_bh_state(bh_in) too early; this could potentially allow
    another thread to call get_write_access on the buffer head, modify the
    data, and dirty it, and allowing the wrong data to be written into the
    journal.  Fortunately, if we lose this race, the only time this will
    actually cause filesystem corruption is if there is a system crash or
    other unclean shutdown of the system before the next commit can take
    place.
    Signed-off-by: default avatardingdinghua <dingdinghua85@gmail.com>
    Signed-off-by: default avatar"Theodore Ts'o" <tytso@mit.edu>
    96577c43
journal.c 66.6 KB