aboutsummaryrefslogtreecommitdiffstats
path: root/fs/udf/super.c
diff options
context:
space:
mode:
authorJan Kara <jack@suse.cz>2013-01-17 16:11:38 -0500
committerJan Kara <jack@suse.cz>2013-01-21 05:19:58 -0500
commit9734c971aa6be6db61226b0046e080ca10383748 (patch)
tree57d202ecd9b18e033c569129fce0c32a64983349 /fs/udf/super.c
parentc04e88e271ab67de1409c3b4a4e80dbe13eac7b0 (diff)
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>
Diffstat (limited to 'fs/udf/super.c')
-rw-r--r--fs/udf/super.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/fs/udf/super.c b/fs/udf/super.c
index e9be396a558d..186adbf94b20 100644
--- a/fs/udf/super.c
+++ b/fs/udf/super.c
@@ -1866,6 +1866,8 @@ static void udf_open_lvid(struct super_block *sb)
1866 mark_buffer_dirty(bh); 1866 mark_buffer_dirty(bh);
1867 sbi->s_lvid_dirty = 0; 1867 sbi->s_lvid_dirty = 0;
1868 mutex_unlock(&sbi->s_alloc_mutex); 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
1871static void udf_close_lvid(struct super_block *sb) 1873static void udf_close_lvid(struct super_block *sb)
@@ -1906,6 +1908,8 @@ static void udf_close_lvid(struct super_block *sb)
1906 mark_buffer_dirty(bh); 1908 mark_buffer_dirty(bh);
1907 sbi->s_lvid_dirty = 0; 1909 sbi->s_lvid_dirty = 0;
1908 mutex_unlock(&sbi->s_alloc_mutex); 1910 mutex_unlock(&sbi->s_alloc_mutex);
1911 /* Make closing of filesystem visible on the media immediately */
1912 sync_dirty_buffer(bh);
1909} 1913}
1910 1914
1911u64 lvid_get_unique_id(struct super_block *sb) 1915u64 lvid_get_unique_id(struct super_block *sb)