Skip to content

Commit 9734c97

Browse files
committed
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 <[email protected]> Signed-off-by: Jan Kara <[email protected]>
1 parent c04e88e commit 9734c97

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

fs/udf/super.c

+4
Original file line numberDiff line numberDiff line change
@@ -1866,6 +1866,8 @@ static void udf_open_lvid(struct super_block *sb)
18661866
mark_buffer_dirty(bh);
18671867
sbi->s_lvid_dirty = 0;
18681868
mutex_unlock(&sbi->s_alloc_mutex);
1869+
/* Make opening of filesystem visible on the media immediately */
1870+
sync_dirty_buffer(bh);
18691871
}
18701872

18711873
static void udf_close_lvid(struct super_block *sb)
@@ -1906,6 +1908,8 @@ static void udf_close_lvid(struct super_block *sb)
19061908
mark_buffer_dirty(bh);
19071909
sbi->s_lvid_dirty = 0;
19081910
mutex_unlock(&sbi->s_alloc_mutex);
1911+
/* Make closing of filesystem visible on the media immediately */
1912+
sync_dirty_buffer(bh);
19091913
}
19101914

19111915
u64 lvid_get_unique_id(struct super_block *sb)

0 commit comments

Comments
 (0)