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
6a08ab84
Commit
6a08ab84
authored
Mar 05, 2010
by
Joern Engel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[LogFS] Check feature flags
parent
c6d38301
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
2 deletions
+12
-2
fs/logfs/logfs_abi.h
fs/logfs/logfs_abi.h
+4
-0
fs/logfs/super.c
fs/logfs/super.c
+8
-2
No files found.
fs/logfs/logfs_abi.h
View file @
6a08ab84
...
@@ -193,6 +193,10 @@ struct logfs_segment_header {
...
@@ -193,6 +193,10 @@ struct logfs_segment_header {
SIZE_CHECK
(
logfs_segment_header
,
LOGFS_SEGMENT_HEADERSIZE
);
SIZE_CHECK
(
logfs_segment_header
,
LOGFS_SEGMENT_HEADERSIZE
);
#define LOGFS_FEATURES_INCOMPAT (0ull)
#define LOGFS_FEATURES_RO_COMPAT (0ull)
#define LOGFS_FEATURES_COMPAT (0ull)
/**
/**
* struct logfs_disk_super - on-medium superblock
* struct logfs_disk_super - on-medium superblock
*
*
...
...
fs/logfs/super.c
View file @
6a08ab84
...
@@ -440,7 +440,7 @@ static int __logfs_read_sb(struct super_block *sb)
...
@@ -440,7 +440,7 @@ static int __logfs_read_sb(struct super_block *sb)
return
0
;
return
0
;
}
}
static
int
logfs_read_sb
(
struct
super_block
*
sb
)
static
int
logfs_read_sb
(
struct
super_block
*
sb
,
int
read_only
)
{
{
struct
logfs_super
*
super
=
logfs_super
(
sb
);
struct
logfs_super
*
super
=
logfs_super
(
sb
);
int
ret
;
int
ret
;
...
@@ -460,6 +460,12 @@ static int logfs_read_sb(struct super_block *sb)
...
@@ -460,6 +460,12 @@ static int logfs_read_sb(struct super_block *sb)
if
(
ret
)
if
(
ret
)
return
ret
;
return
ret
;
if
(
super
->
s_feature_incompat
&
~
LOGFS_FEATURES_INCOMPAT
)
return
-
EIO
;
if
((
super
->
s_feature_ro_compat
&
~
LOGFS_FEATURES_RO_COMPAT
)
&&
!
read_only
)
return
-
EIO
;
mutex_init
(
&
super
->
s_dirop_mutex
);
mutex_init
(
&
super
->
s_dirop_mutex
);
mutex_init
(
&
super
->
s_object_alias_mutex
);
mutex_init
(
&
super
->
s_object_alias_mutex
);
INIT_LIST_HEAD
(
&
super
->
s_freeing_list
);
INIT_LIST_HEAD
(
&
super
->
s_freeing_list
);
...
@@ -555,7 +561,7 @@ int logfs_get_sb_device(struct file_system_type *type, int flags,
...
@@ -555,7 +561,7 @@ int logfs_get_sb_device(struct file_system_type *type, int flags,
sb
->
s_op
=
&
logfs_super_operations
;
sb
->
s_op
=
&
logfs_super_operations
;
sb
->
s_flags
=
flags
|
MS_NOATIME
;
sb
->
s_flags
=
flags
|
MS_NOATIME
;
err
=
logfs_read_sb
(
sb
);
err
=
logfs_read_sb
(
sb
,
sb
->
s_flags
&
MS_RDONLY
);
if
(
err
)
if
(
err
)
goto
err1
;
goto
err1
;
...
...
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