Skip to content

Commit

Permalink
udf: Write LVID to disk after opening / closing
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
jankara committed Jan 21, 2013
1 parent c04e88e commit 9734c97
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions fs/udf/super.c
Original file line number Diff line number Diff line change
Expand Up @@ -1866,6 +1866,8 @@ static void udf_open_lvid(struct super_block *sb)
mark_buffer_dirty(bh);
sbi->s_lvid_dirty = 0;
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)
Expand Down Expand Up @@ -1906,6 +1908,8 @@ static void udf_close_lvid(struct super_block *sb)
mark_buffer_dirty(bh);
sbi->s_lvid_dirty = 0;
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)
Expand Down

0 comments on commit 9734c97

Please sign in to comment.