diff options
Diffstat (limited to 'fs/ntfs/super.c')
-rw-r--r-- | fs/ntfs/super.c | 34 |
1 files changed, 27 insertions, 7 deletions
diff --git a/fs/ntfs/super.c b/fs/ntfs/super.c index 489f7049146b..368a8ec10668 100644 --- a/fs/ntfs/super.c +++ b/fs/ntfs/super.c | |||
@@ -472,9 +472,16 @@ static int ntfs_remount(struct super_block *sb, int *flags, char *opt) | |||
472 | ntfs_error(sb, "Volume is dirty and read-only%s", es); | 472 | ntfs_error(sb, "Volume is dirty and read-only%s", es); |
473 | return -EROFS; | 473 | return -EROFS; |
474 | } | 474 | } |
475 | if (vol->vol_flags & VOLUME_MODIFIED_BY_CHKDSK) { | ||
476 | ntfs_error(sb, "Volume has been modified by chkdsk " | ||
477 | "and is read-only%s", es); | ||
478 | return -EROFS; | ||
479 | } | ||
475 | if (vol->vol_flags & VOLUME_MUST_MOUNT_RO_MASK) { | 480 | if (vol->vol_flags & VOLUME_MUST_MOUNT_RO_MASK) { |
476 | ntfs_error(sb, "Volume has unsupported flags set and " | 481 | ntfs_error(sb, "Volume has unsupported flags set " |
477 | "is read-only%s", es); | 482 | "(0x%x) and is read-only%s", |
483 | (unsigned)le16_to_cpu(vol->vol_flags), | ||
484 | es); | ||
478 | return -EROFS; | 485 | return -EROFS; |
479 | } | 486 | } |
480 | if (ntfs_set_volume_flags(vol, VOLUME_IS_DIRTY)) { | 487 | if (ntfs_set_volume_flags(vol, VOLUME_IS_DIRTY)) { |
@@ -1845,11 +1852,24 @@ get_ctx_vol_failed: | |||
1845 | /* Make sure that no unsupported volume flags are set. */ | 1852 | /* Make sure that no unsupported volume flags are set. */ |
1846 | if (vol->vol_flags & VOLUME_MUST_MOUNT_RO_MASK) { | 1853 | if (vol->vol_flags & VOLUME_MUST_MOUNT_RO_MASK) { |
1847 | static const char *es1a = "Volume is dirty"; | 1854 | static const char *es1a = "Volume is dirty"; |
1848 | static const char *es1b = "Volume has unsupported flags set"; | 1855 | static const char *es1b = "Volume has been modified by chkdsk"; |
1849 | static const char *es2 = ". Run chkdsk and mount in Windows."; | 1856 | static const char *es1c = "Volume has unsupported flags set"; |
1850 | const char *es1; | 1857 | static const char *es2a = ". Run chkdsk and mount in Windows."; |
1851 | 1858 | static const char *es2b = ". Mount in Windows."; | |
1852 | es1 = vol->vol_flags & VOLUME_IS_DIRTY ? es1a : es1b; | 1859 | const char *es1, *es2; |
1860 | |||
1861 | es2 = es2a; | ||
1862 | if (vol->vol_flags & VOLUME_IS_DIRTY) | ||
1863 | es1 = es1a; | ||
1864 | else if (vol->vol_flags & VOLUME_MODIFIED_BY_CHKDSK) { | ||
1865 | es1 = es1b; | ||
1866 | es2 = es2b; | ||
1867 | } else { | ||
1868 | es1 = es1c; | ||
1869 | ntfs_warning(sb, "Unsupported volume flags 0x%x " | ||
1870 | "encountered.", | ||
1871 | (unsigned)le16_to_cpu(vol->vol_flags)); | ||
1872 | } | ||
1853 | /* If a read-write mount, convert it to a read-only mount. */ | 1873 | /* If a read-write mount, convert it to a read-only mount. */ |
1854 | if (!(sb->s_flags & MS_RDONLY)) { | 1874 | if (!(sb->s_flags & MS_RDONLY)) { |
1855 | if (!(vol->on_errors & (ON_ERRORS_REMOUNT_RO | | 1875 | if (!(vol->on_errors & (ON_ERRORS_REMOUNT_RO | |