Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
linux
Commits
d14e09af
Commit
d14e09af
authored
May 11, 2004
by
Anton Altaparmakov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
NTFS: 2.1.10 - Force read-only (re)mounting of volumes with unsupported flags.
parent
9d41ab4c
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
78 additions
and
27 deletions
+78
-27
Documentation/filesystems/ntfs.txt
Documentation/filesystems/ntfs.txt
+3
-0
fs/ntfs/ChangeLog
fs/ntfs/ChangeLog
+15
-1
fs/ntfs/Makefile
fs/ntfs/Makefile
+1
-1
fs/ntfs/layout.h
fs/ntfs/layout.h
+25
-22
fs/ntfs/mft.h
fs/ntfs/mft.h
+0
-2
fs/ntfs/super.c
fs/ntfs/super.c
+34
-1
No files found.
Documentation/filesystems/ntfs.txt
View file @
d14e09af
...
...
@@ -273,6 +273,9 @@ ChangeLog
Note, a technical ChangeLog aimed at kernel hackers is in fs/ntfs/ChangeLog.
2.1.10:
- Force read-only (re)mounting of volumes with unsupported volume
flags and various cleanups.
2.1.9:
- Fix two bugs in handling of corner cases in the decompression engine.
2.1.8:
...
...
fs/ntfs/ChangeLog
View file @
d14e09af
...
...
@@ -19,9 +19,23 @@ ToDo:
sufficient for synchronisation here. We then just need to make sure
ntfs_readpage/writepage/truncate interoperate properly with us.
2.1.10 - .
2.1.10 -
Force read-only (re)mounting of volumes with unsupported volume flags
.
- Finish off the white space cleanups (remove trailing spaces, etc).
- Clean up ntfs_fill_super() and ntfs_read_inode_mount() by removing
the kludges around the first iget(). Instead of (re)setting ->s_op
we have the $MFT inode set up by explicit new_inode() / set ->i_ino /
insert_inode_hash() / call ntfs_read_inode_mount() directly. This
kills the need for second super_operations and allows to return error
from ntfs_read_inode_mount() without resorting to ugly "poisoning"
tricks. (Al Viro)
- Force read-only (re)mounting if any of the following bits are set in
the volume information flags:
VOLUME_IS_DIRTY, VOLUME_RESIZE_LOG_FILE,
VOLUME_UPGRADE_ON_MOUNT, VOLUME_DELETE_USN_UNDERWAY,
VOLUME_REPAIR_OBJECT_ID, VOLUME_MODIFIED_BY_CHKDSK
To make this easier we define VOLUME_MUST_MOUNT_RO_MASK with all the
above bits set so the test is made easy.
2.1.9 - Fix two bugs in decompression engine.
...
...
fs/ntfs/Makefile
View file @
d14e09af
...
...
@@ -5,7 +5,7 @@ obj-$(CONFIG_NTFS_FS) += ntfs.o
ntfs-objs
:=
aops.o attrib.o compress.o debug.o dir.o file.o inode.o logfile.o
\
mft.o mst.o namei.o super.o sysctl.o unistr.o upcase.o
EXTRA_CFLAGS
=
-DNTFS_VERSION
=
\"
2.1.10
-WIP
\"
EXTRA_CFLAGS
=
-DNTFS_VERSION
=
\"
2.1.10
\"
ifeq
($(CONFIG_NTFS_DEBUG),y)
EXTRA_CFLAGS
+=
-DDEBUG
...
...
fs/ntfs/layout.h
View file @
d14e09af
...
...
@@ -1790,6 +1790,9 @@ typedef enum {
VOLUME_REPAIR_OBJECT_ID
=
const_cpu_to_le16
(
0x0020
),
VOLUME_MODIFIED_BY_CHKDSK
=
const_cpu_to_le16
(
0x8000
),
VOLUME_FLAGS_MASK
=
const_cpu_to_le16
(
0x803f
),
/* To make our life easier when checking if we must mount read-only. */
VOLUME_MUST_MOUNT_RO_MASK
=
const_cpu_to_le16
(
0x8037
),
}
__attribute__
((
__packed__
))
VOLUME_FLAGS
;
/*
...
...
fs/ntfs/mft.h
View file @
d14e09af
...
...
@@ -28,8 +28,6 @@
#include "inode.h"
extern
int
format_mft_record
(
ntfs_inode
*
ni
,
MFT_RECORD
*
m
);
//extern int format_mft_record2(struct super_block *vfs_sb,
// const unsigned long inum, MFT_RECORD *m);
extern
MFT_RECORD
*
map_mft_record
(
ntfs_inode
*
ni
);
extern
void
unmap_mft_record
(
ntfs_inode
*
ni
);
...
...
fs/ntfs/super.c
View file @
d14e09af
...
...
@@ -314,7 +314,9 @@ static int ntfs_remount(struct super_block *sb, int *flags, char *opt)
#else
/* ! NTFS_RW */
/*
* For the read-write compiled driver, if we are remounting read-write,
* make sure there aren't any volume errors and empty the lofgile.
* make sure there are no volume errors and that no unsupported volume
* flags are set. Also, empty the logfile journal as it would become
* stale as soon as something is written to the volume.
*/
if
((
sb
->
s_flags
&
MS_RDONLY
)
&&
!
(
*
flags
&
MS_RDONLY
))
{
static
const
char
*
es
=
". Cannot remount read-write."
;
...
...
@@ -324,6 +326,11 @@ static int ntfs_remount(struct super_block *sb, int *flags, char *opt)
es
);
return
-
EROFS
;
}
if
(
vol
->
vol_flags
&
VOLUME_MUST_MOUNT_RO_MASK
)
{
ntfs_error
(
sb
,
"Volume has unsupported flags set and "
"is read-only%s"
,
es
);
return
-
EROFS
;
}
if
(
!
ntfs_empty_logfile
(
vol
->
logfile_ino
))
{
ntfs_error
(
sb
,
"Failed to empty journal $LogFile%s"
,
es
);
...
...
@@ -1133,6 +1140,31 @@ static BOOL load_system_files(ntfs_volume *vol)
printk
(
KERN_INFO
"NTFS volume version %i.%i.
\n
"
,
vol
->
major_ver
,
vol
->
minor_ver
);
#ifdef NTFS_RW
/* Make sure that no unsupported volume flags are set. */
if
(
vol
->
vol_flags
&
VOLUME_MUST_MOUNT_RO_MASK
)
{
static
const
char
*
es1
=
"Volume has unsupported flags set "
;
static
const
char
*
es2
=
". Run chkdsk and mount in Windows."
;
/* If a read-write mount, convert it to a read-only mount. */
if
(
!
(
sb
->
s_flags
&
MS_RDONLY
))
{
if
(
!
(
vol
->
on_errors
&
(
ON_ERRORS_REMOUNT_RO
|
ON_ERRORS_CONTINUE
)))
{
ntfs_error
(
sb
,
"%s and neither on_errors="
"continue nor on_errors="
"remount-ro was specified%s"
,
es1
,
es2
);
goto
iput_vol_err_out
;
}
sb
->
s_flags
|=
MS_RDONLY
|
MS_NOATIME
|
MS_NODIRATIME
;
ntfs_error
(
sb
,
"%s. Mounting read-only%s"
,
es1
,
es2
);
}
else
ntfs_warning
(
sb
,
"%s. Will not be able to remount "
"read-write%s"
,
es1
,
es2
);
/*
* Do not set NVolErrors() because ntfs_remount() re-checks the
* flags which we need to do in case any flags have changed.
*/
}
/*
* Get the inode for the logfile, check it and determine if the volume
* was shutdown cleanly.
...
...
@@ -1240,6 +1272,7 @@ static BOOL load_system_files(ntfs_volume *vol)
#ifdef NTFS_RW
if
(
vol
->
logfile_ino
)
iput
(
vol
->
logfile_ino
);
iput_vol_err_out:
#endif
/* NTFS_RW */
iput
(
vol
->
vol_ino
);
iput_lcnbmp_err_out:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment