• Eric Sandeen's avatar
    jbd2: don't write superblock when if its empty · eeecef0a
    Eric Sandeen authored
    This sequence:
    
    # truncate --size=1g fsfile
    # mkfs.ext4 -F fsfile
    # mount -o loop,ro fsfile /mnt
    # umount /mnt
    # dmesg | tail
    
    results in an IO error when unmounting the RO filesystem:
    
    [  318.020828] Buffer I/O error on device loop1, logical block 196608
    [  318.027024] lost page write due to I/O error on loop1
    [  318.032088] JBD2: Error -5 detected when updating journal superblock for loop1-8.
    
    This was a regression introduced by commit 24bcc89c: "jbd2: split
    updating of journal superblock and marking journal empty".
    Signed-off-by: default avatarEric Sandeen <sandeen@redhat.com>
    Signed-off-by: default avatar"Theodore Ts'o" <tytso@mit.edu>
    Cc: stable@vger.kernel.org
    eeecef0a
journal.c 72.7 KB