diff options
author | Mikulas Patocka <mikulas@artax.karlin.mff.cuni.cz> | 2011-05-08 14:44:08 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2011-05-09 12:04:24 -0400 |
commit | dab4c82a6e7ee2c60e63737eaa2ec283f9784df6 (patch) | |
tree | 27f33c66d2d4b20ae8f353e9b6e10daac4dc308a /fs | |
parent | 48f10e8ce7461b393186c4c7c6d6f6634082159c (diff) |
HPFS: Fix a bug that filesystem was not marked dirty when remounting it
Fix a bug that filesystem was not marked dirty when remounting it
Signed-off-by: Mikulas Patocka <mikulas@artax.karlin.mff.cuni.cz>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/hpfs/super.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/fs/hpfs/super.c b/fs/hpfs/super.c index 07e8d0c34fdf..4a7d0266342b 100644 --- a/fs/hpfs/super.c +++ b/fs/hpfs/super.c | |||
@@ -18,9 +18,9 @@ | |||
18 | 18 | ||
19 | /* Mark the filesystem dirty, so that chkdsk checks it when os/2 booted */ | 19 | /* Mark the filesystem dirty, so that chkdsk checks it when os/2 booted */ |
20 | 20 | ||
21 | static void mark_dirty(struct super_block *s) | 21 | static void mark_dirty(struct super_block *s, int remount) |
22 | { | 22 | { |
23 | if (hpfs_sb(s)->sb_chkdsk && !(s->s_flags & MS_RDONLY)) { | 23 | if (hpfs_sb(s)->sb_chkdsk && (remount || !(s->s_flags & MS_RDONLY))) { |
24 | struct buffer_head *bh; | 24 | struct buffer_head *bh; |
25 | struct hpfs_spare_block *sb; | 25 | struct hpfs_spare_block *sb; |
26 | if ((sb = hpfs_map_sector(s, 17, &bh, 0))) { | 26 | if ((sb = hpfs_map_sector(s, 17, &bh, 0))) { |
@@ -66,13 +66,13 @@ void hpfs_error(struct super_block *s, const char *fmt, ...) | |||
66 | if (!hpfs_sb(s)->sb_was_error) { | 66 | if (!hpfs_sb(s)->sb_was_error) { |
67 | if (hpfs_sb(s)->sb_err == 2) { | 67 | if (hpfs_sb(s)->sb_err == 2) { |
68 | printk("; crashing the system because you wanted it\n"); | 68 | printk("; crashing the system because you wanted it\n"); |
69 | mark_dirty(s); | 69 | mark_dirty(s, 0); |
70 | panic("HPFS panic"); | 70 | panic("HPFS panic"); |
71 | } else if (hpfs_sb(s)->sb_err == 1) { | 71 | } else if (hpfs_sb(s)->sb_err == 1) { |
72 | if (s->s_flags & MS_RDONLY) printk("; already mounted read-only\n"); | 72 | if (s->s_flags & MS_RDONLY) printk("; already mounted read-only\n"); |
73 | else { | 73 | else { |
74 | printk("; remounting read-only\n"); | 74 | printk("; remounting read-only\n"); |
75 | mark_dirty(s); | 75 | mark_dirty(s, 0); |
76 | s->s_flags |= MS_RDONLY; | 76 | s->s_flags |= MS_RDONLY; |
77 | } | 77 | } |
78 | } else if (s->s_flags & MS_RDONLY) printk("; going on - but anything won't be destroyed because it's read-only\n"); | 78 | } else if (s->s_flags & MS_RDONLY) printk("; going on - but anything won't be destroyed because it's read-only\n"); |
@@ -419,7 +419,7 @@ static int hpfs_remount_fs(struct super_block *s, int *flags, char *data) | |||
419 | sbi->sb_eas = eas; sbi->sb_chk = chk; sbi->sb_chkdsk = chkdsk; | 419 | sbi->sb_eas = eas; sbi->sb_chk = chk; sbi->sb_chkdsk = chkdsk; |
420 | sbi->sb_err = errs; sbi->sb_timeshift = timeshift; | 420 | sbi->sb_err = errs; sbi->sb_timeshift = timeshift; |
421 | 421 | ||
422 | if (!(*flags & MS_RDONLY)) mark_dirty(s); | 422 | if (!(*flags & MS_RDONLY)) mark_dirty(s, 1); |
423 | 423 | ||
424 | replace_mount_options(s, new_opts); | 424 | replace_mount_options(s, new_opts); |
425 | 425 | ||
@@ -576,7 +576,7 @@ static int hpfs_fill_super(struct super_block *s, void *options, int silent) | |||
576 | if (spareblock->hotfixes_used || spareblock->n_spares_used) { | 576 | if (spareblock->hotfixes_used || spareblock->n_spares_used) { |
577 | if (errs >= 2) { | 577 | if (errs >= 2) { |
578 | printk("HPFS: Hotfixes not supported here, try chkdsk\n"); | 578 | printk("HPFS: Hotfixes not supported here, try chkdsk\n"); |
579 | mark_dirty(s); | 579 | mark_dirty(s, 0); |
580 | goto bail4; | 580 | goto bail4; |
581 | } | 581 | } |
582 | hpfs_error(s, "hotfixes not supported here, try chkdsk"); | 582 | hpfs_error(s, "hotfixes not supported here, try chkdsk"); |
@@ -586,7 +586,7 @@ static int hpfs_fill_super(struct super_block *s, void *options, int silent) | |||
586 | if (spareblock->n_dnode_spares != spareblock->n_dnode_spares_free) { | 586 | if (spareblock->n_dnode_spares != spareblock->n_dnode_spares_free) { |
587 | if (errs >= 2) { | 587 | if (errs >= 2) { |
588 | printk("HPFS: Spare dnodes used, try chkdsk\n"); | 588 | printk("HPFS: Spare dnodes used, try chkdsk\n"); |
589 | mark_dirty(s); | 589 | mark_dirty(s, 0); |
590 | goto bail4; | 590 | goto bail4; |
591 | } | 591 | } |
592 | hpfs_error(s, "warning: spare dnodes used, try chkdsk"); | 592 | hpfs_error(s, "warning: spare dnodes used, try chkdsk"); |
@@ -605,7 +605,7 @@ static int hpfs_fill_super(struct super_block *s, void *options, int silent) | |||
605 | if (hpfs_chk_sectors(s, superblock->dir_band_start, superblock->n_dir_band, "dir_band") || | 605 | if (hpfs_chk_sectors(s, superblock->dir_band_start, superblock->n_dir_band, "dir_band") || |
606 | hpfs_chk_sectors(s, superblock->dir_band_bitmap, 4, "dir_band_bitmap") || | 606 | hpfs_chk_sectors(s, superblock->dir_band_bitmap, 4, "dir_band_bitmap") || |
607 | hpfs_chk_sectors(s, superblock->bitmaps, 4, "bitmaps")) { | 607 | hpfs_chk_sectors(s, superblock->bitmaps, 4, "bitmaps")) { |
608 | mark_dirty(s); | 608 | mark_dirty(s, 0); |
609 | goto bail4; | 609 | goto bail4; |
610 | } | 610 | } |
611 | sbi->sb_dirband_size = a; | 611 | sbi->sb_dirband_size = a; |