20
20
* In case the file system is remounted read-only, it can be made writable
21
21
* again by remounting it.
23
void __fat_fs_error(struct super_block *s, int report, const char *fmt, ...)
23
void __fat_fs_error(struct super_block *sb, int report, const char *fmt, ...)
25
struct fat_mount_options *opts = &MSDOS_SB(s)->options;
25
struct fat_mount_options *opts = &MSDOS_SB(sb)->options;
29
printk(KERN_ERR "FAT: Filesystem error (dev %s)\n", s->s_id);
32
30
va_start(args, fmt);
33
printk(KERN_ERR "FAT-fs (%s): error, %pV\n", sb->s_id, &vaf);
38
37
if (opts->errors == FAT_ERRORS_PANIC)
39
panic("FAT: fs panic from previous error\n");
40
else if (opts->errors == FAT_ERRORS_RO && !(s->s_flags & MS_RDONLY)) {
41
s->s_flags |= MS_RDONLY;
42
printk(KERN_ERR "FAT: Filesystem has been set read-only\n");
38
panic("FAT-fs (%s): fs panic from previous error\n", sb->s_id);
39
else if (opts->errors == FAT_ERRORS_RO && !(sb->s_flags & MS_RDONLY)) {
40
sb->s_flags |= MS_RDONLY;
41
printk(KERN_ERR "FAT-fs (%s): Filesystem has been "
42
"set read-only\n", sb->s_id);
45
45
EXPORT_SYMBOL_GPL(__fat_fs_error);
48
* fat_msg() - print preformated FAT specific messages. Every thing what is
49
* not fat_fs_error() should be fat_msg().
51
void fat_msg(struct super_block *sb, const char *level, const char *fmt, ...)
59
printk("%sFAT-fs (%s): %pV\n", level, sb->s_id, &vaf);
47
63
/* Flushes the number of free clusters on FAT32 */
48
64
/* XXX: Need to write one per FSINFO block. Currently only writes 1 */
49
65
int fat_clusters_flush(struct super_block *sb)
58
74
bh = sb_bread(sb, sbi->fsinfo_sector);
60
printk(KERN_ERR "FAT: bread failed in fat_clusters_flush\n");
76
fat_msg(sb, KERN_ERR, "bread failed in fat_clusters_flush");
64
80
fsinfo = (struct fat_boot_fsinfo *)bh->b_data;
66
82
if (!IS_FSINFO(fsinfo)) {
67
printk(KERN_ERR "FAT: Invalid FSINFO signature: "
68
"0x%08x, 0x%08x (sector = %lu)\n",
83
fat_msg(sb, KERN_ERR, "Invalid FSINFO signature: "
84
"0x%08x, 0x%08x (sector = %lu)",
69
85
le32_to_cpu(fsinfo->signature1),
70
86
le32_to_cpu(fsinfo->signature2),
71
87
sbi->fsinfo_sector);