aboutsummaryrefslogtreecommitdiffstats
path: root/fs/fat/inode.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/fat/inode.c')
-rw-r--r--fs/fat/inode.c34
1 files changed, 15 insertions, 19 deletions
diff --git a/fs/fat/inode.c b/fs/fat/inode.c
index 8970d8c49bb0..76b7961ab663 100644
--- a/fs/fat/inode.c
+++ b/fs/fat/inode.c
@@ -451,12 +451,16 @@ static void fat_write_super(struct super_block *sb)
451 451
452static int fat_sync_fs(struct super_block *sb, int wait) 452static int fat_sync_fs(struct super_block *sb, int wait)
453{ 453{
454 lock_super(sb); 454 int err = 0;
455 fat_clusters_flush(sb);
456 sb->s_dirt = 0;
457 unlock_super(sb);
458 455
459 return 0; 456 if (sb->s_dirt) {
457 lock_super(sb);
458 sb->s_dirt = 0;
459 err = fat_clusters_flush(sb);
460 unlock_super(sb);
461 }
462
463 return err;
460} 464}
461 465
462static void fat_put_super(struct super_block *sb) 466static void fat_put_super(struct super_block *sb)
@@ -470,19 +474,11 @@ static void fat_put_super(struct super_block *sb)
470 474
471 iput(sbi->fat_inode); 475 iput(sbi->fat_inode);
472 476
473 if (sbi->nls_disk) { 477 unload_nls(sbi->nls_disk);
474 unload_nls(sbi->nls_disk); 478 unload_nls(sbi->nls_io);
475 sbi->nls_disk = NULL; 479
476 sbi->options.codepage = fat_default_codepage; 480 if (sbi->options.iocharset != fat_default_iocharset)
477 }
478 if (sbi->nls_io) {
479 unload_nls(sbi->nls_io);
480 sbi->nls_io = NULL;
481 }
482 if (sbi->options.iocharset != fat_default_iocharset) {
483 kfree(sbi->options.iocharset); 481 kfree(sbi->options.iocharset);
484 sbi->options.iocharset = fat_default_iocharset;
485 }
486 482
487 sb->s_fs_info = NULL; 483 sb->s_fs_info = NULL;
488 kfree(sbi); 484 kfree(sbi);
@@ -820,7 +816,7 @@ static int fat_show_options(struct seq_file *m, struct vfsmount *mnt)
820 seq_puts(m, ",shortname=mixed"); 816 seq_puts(m, ",shortname=mixed");
821 break; 817 break;
822 case VFAT_SFN_DISPLAY_LOWER | VFAT_SFN_CREATE_WIN95: 818 case VFAT_SFN_DISPLAY_LOWER | VFAT_SFN_CREATE_WIN95:
823 /* seq_puts(m, ",shortname=lower"); */ 819 seq_puts(m, ",shortname=lower");
824 break; 820 break;
825 default: 821 default:
826 seq_puts(m, ",shortname=unknown"); 822 seq_puts(m, ",shortname=unknown");
@@ -971,7 +967,7 @@ static int parse_options(char *options, int is_vfat, int silent, int *debug,
971 opts->codepage = fat_default_codepage; 967 opts->codepage = fat_default_codepage;
972 opts->iocharset = fat_default_iocharset; 968 opts->iocharset = fat_default_iocharset;
973 if (is_vfat) { 969 if (is_vfat) {
974 opts->shortname = VFAT_SFN_DISPLAY_LOWER|VFAT_SFN_CREATE_WIN95; 970 opts->shortname = VFAT_SFN_DISPLAY_WINNT|VFAT_SFN_CREATE_WIN95;
975 opts->rodir = 0; 971 opts->rodir = 0;
976 } else { 972 } else {
977 opts->shortname = 0; 973 opts->shortname = 0;