Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

udf: Write LVID to disk after opening / closing

So far we just marked the buffer as dirty and left writing on flusher thread
but especially on opening that opens possible race window where we could write
other modified fs structures to disk before we mark filesystem as open. So sync
LVID buffer to disk after opening and closing fs.

Reported-by: Steve Nickel <snickel58@gmail.com>
Signed-off-by: Jan Kara <jack@suse.cz>

Jan Kara 9734c971 c04e88e2

+4
+4
fs/udf/super.c
··· 1866 1866 mark_buffer_dirty(bh); 1867 1867 sbi->s_lvid_dirty = 0; 1868 1868 mutex_unlock(&sbi->s_alloc_mutex); 1869 + /* Make opening of filesystem visible on the media immediately */ 1870 + sync_dirty_buffer(bh); 1869 1871 } 1870 1872 1871 1873 static void udf_close_lvid(struct super_block *sb) ··· 1908 1906 mark_buffer_dirty(bh); 1909 1907 sbi->s_lvid_dirty = 0; 1910 1908 mutex_unlock(&sbi->s_alloc_mutex); 1909 + /* Make closing of filesystem visible on the media immediately */ 1910 + sync_dirty_buffer(bh); 1911 1911 } 1912 1912 1913 1913 u64 lvid_get_unique_id(struct super_block *sb)