Commit 24fbf4c4 authored by Hirofumi Ogawa's avatar Hirofumi Ogawa Committed by Linus Torvalds

[PATCH] fat_access cleanup (6/11)

This reads ->free_clusters without lock_fat() in fat_statfs().
parent b2ef7d8a
......@@ -1024,8 +1024,11 @@ int fat_fill_super(struct super_block *sb, void *data, int silent,
int fat_statfs(struct super_block *sb, struct kstatfs *buf)
{
int free,nr;
int free, nr;
if (MSDOS_SB(sb)->free_clusters != -1)
free = MSDOS_SB(sb)->free_clusters;
else {
lock_fat(sb);
if (MSDOS_SB(sb)->free_clusters != -1)
free = MSDOS_SB(sb)->free_clusters;
......@@ -1037,6 +1040,7 @@ int fat_statfs(struct super_block *sb, struct kstatfs *buf)
MSDOS_SB(sb)->free_clusters = free;
}
unlock_fat(sb);
}
buf->f_type = sb->s_magic;
buf->f_bsize = 1 << MSDOS_SB(sb)->cluster_bits;
......
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