Commit 9734c971 authored by Jan Kara's avatar Jan Kara

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: default avatarSteve Nickel <snickel58@gmail.com>
Signed-off-by: default avatarJan Kara <jack@suse.cz>
parent c04e88e2
...@@ -1866,6 +1866,8 @@ static void udf_open_lvid(struct super_block *sb) ...@@ -1866,6 +1866,8 @@ static void udf_open_lvid(struct super_block *sb)
mark_buffer_dirty(bh); mark_buffer_dirty(bh);
sbi->s_lvid_dirty = 0; sbi->s_lvid_dirty = 0;
mutex_unlock(&sbi->s_alloc_mutex); mutex_unlock(&sbi->s_alloc_mutex);
/* Make opening of filesystem visible on the media immediately */
sync_dirty_buffer(bh);
} }
static void udf_close_lvid(struct super_block *sb) static void udf_close_lvid(struct super_block *sb)
...@@ -1906,6 +1908,8 @@ static void udf_close_lvid(struct super_block *sb) ...@@ -1906,6 +1908,8 @@ static void udf_close_lvid(struct super_block *sb)
mark_buffer_dirty(bh); mark_buffer_dirty(bh);
sbi->s_lvid_dirty = 0; sbi->s_lvid_dirty = 0;
mutex_unlock(&sbi->s_alloc_mutex); mutex_unlock(&sbi->s_alloc_mutex);
/* Make closing of filesystem visible on the media immediately */
sync_dirty_buffer(bh);
} }
u64 lvid_get_unique_id(struct super_block *sb) u64 lvid_get_unique_id(struct super_block *sb)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment