Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
linux-davinci
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
linux
linux-davinci
Commits
563bdd61
Commit
563bdd61
authored
Mar 26, 2009
by
Theodore Ts'o
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ext4: Check for an valid i_mode when reading the inode from disk
Signed-off-by:
"Theodore Ts'o"
<
tytso@mit.edu
>
parent
7058548c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
1 deletion
+9
-1
fs/ext4/inode.c
fs/ext4/inode.c
+9
-1
No files found.
fs/ext4/inode.c
View file @
563bdd61
...
@@ -4394,7 +4394,8 @@ struct inode *ext4_iget(struct super_block *sb, unsigned long ino)
...
@@ -4394,7 +4394,8 @@ struct inode *ext4_iget(struct super_block *sb, unsigned long ino)
inode
->
i_op
=
&
ext4_symlink_inode_operations
;
inode
->
i_op
=
&
ext4_symlink_inode_operations
;
ext4_set_aops
(
inode
);
ext4_set_aops
(
inode
);
}
}
}
else
{
}
else
if
(
S_ISCHR
(
inode
->
i_mode
)
||
S_ISBLK
(
inode
->
i_mode
)
||
S_ISFIFO
(
inode
->
i_mode
)
||
S_ISSOCK
(
inode
->
i_mode
))
{
inode
->
i_op
=
&
ext4_special_inode_operations
;
inode
->
i_op
=
&
ext4_special_inode_operations
;
if
(
raw_inode
->
i_block
[
0
])
if
(
raw_inode
->
i_block
[
0
])
init_special_inode
(
inode
,
inode
->
i_mode
,
init_special_inode
(
inode
,
inode
->
i_mode
,
...
@@ -4402,6 +4403,13 @@ struct inode *ext4_iget(struct super_block *sb, unsigned long ino)
...
@@ -4402,6 +4403,13 @@ struct inode *ext4_iget(struct super_block *sb, unsigned long ino)
else
else
init_special_inode
(
inode
,
inode
->
i_mode
,
init_special_inode
(
inode
,
inode
->
i_mode
,
new_decode_dev
(
le32_to_cpu
(
raw_inode
->
i_block
[
1
])));
new_decode_dev
(
le32_to_cpu
(
raw_inode
->
i_block
[
1
])));
}
else
{
brelse
(
bh
);
ret
=
-
EIO
;
ext4_error
(
inode
->
i_sb
,
__func__
,
"bogus i_mode (%o) for inode=%lu"
,
inode
->
i_mode
,
inode
->
i_ino
);
goto
bad_inode
;
}
}
brelse
(
iloc
.
bh
);
brelse
(
iloc
.
bh
);
ext4_set_inode_flags
(
inode
);
ext4_set_inode_flags
(
inode
);
...
...
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