fat: Check s_dirt in fat_sync_fs()
[pandora-kernel.git] / fs / fat / inode.c
index 8970d8c..a8a3afe 100644 (file)
@@ -451,12 +451,16 @@ static void fat_write_super(struct super_block *sb)
 
 static int fat_sync_fs(struct super_block *sb, int wait)
 {
-       lock_super(sb);
-       fat_clusters_flush(sb);
-       sb->s_dirt = 0;
-       unlock_super(sb);
+       int err = 0;
 
-       return 0;
+       if (sb->s_dirt) {
+               lock_super(sb);
+               sb->s_dirt = 0;
+               err = fat_clusters_flush(sb);
+               unlock_super(sb);
+       }
+
+       return err;
 }
 
 static void fat_put_super(struct super_block *sb)
@@ -820,7 +824,7 @@ static int fat_show_options(struct seq_file *m, struct vfsmount *mnt)
                        seq_puts(m, ",shortname=mixed");
                        break;
                case VFAT_SFN_DISPLAY_LOWER | VFAT_SFN_CREATE_WIN95:
-                       /* seq_puts(m, ",shortname=lower"); */
+                       seq_puts(m, ",shortname=lower");
                        break;
                default:
                        seq_puts(m, ",shortname=unknown");
@@ -971,7 +975,7 @@ static int parse_options(char *options, int is_vfat, int silent, int *debug,
        opts->codepage = fat_default_codepage;
        opts->iocharset = fat_default_iocharset;
        if (is_vfat) {
-               opts->shortname = VFAT_SFN_DISPLAY_LOWER|VFAT_SFN_CREATE_WIN95;
+               opts->shortname = VFAT_SFN_DISPLAY_WINNT|VFAT_SFN_CREATE_WIN95;
                opts->rodir = 0;
        } else {
                opts->shortname = 0;