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
faf08523
Commit
faf08523
authored
Mar 03, 2004
by
Alexander Viro
Committed by
Linus Torvalds
Mar 03, 2004
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[PATCH] d_alloc_root() fixes: ext3
- inode leak on d_alloc_root() failure
parent
c02d9d1f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
10 deletions
+12
-10
fs/ext3/super.c
fs/ext3/super.c
+12
-10
No files found.
fs/ext3/super.c
View file @
faf08523
...
@@ -1040,6 +1040,7 @@ static int ext3_fill_super (struct super_block *sb, void *data, int silent)
...
@@ -1040,6 +1040,7 @@ static int ext3_fill_super (struct super_block *sb, void *data, int silent)
unsigned
long
offset
=
0
;
unsigned
long
offset
=
0
;
unsigned
long
journal_inum
=
0
;
unsigned
long
journal_inum
=
0
;
unsigned
long
def_mount_opts
;
unsigned
long
def_mount_opts
;
struct
inode
*
root
;
int
blocksize
;
int
blocksize
;
int
hblock
;
int
hblock
;
int
db_count
;
int
db_count
;
...
@@ -1354,16 +1355,17 @@ static int ext3_fill_super (struct super_block *sb, void *data, int silent)
...
@@ -1354,16 +1355,17 @@ static int ext3_fill_super (struct super_block *sb, void *data, int silent)
* so we can safely mount the rest of the filesystem now.
* so we can safely mount the rest of the filesystem now.
*/
*/
sb
->
s_root
=
d_alloc_root
(
iget
(
sb
,
EXT3_ROOT_INO
));
root
=
iget
(
sb
,
EXT3_ROOT_INO
);
if
(
!
sb
->
s_root
||
!
S_ISDIR
(
sb
->
s_root
->
d_inode
->
i_mode
)
||
sb
->
s_root
=
d_alloc_root
(
root
);
!
sb
->
s_root
->
d_inode
->
i_blocks
||
!
sb
->
s_root
->
d_inode
->
i_size
)
{
if
(
!
sb
->
s_root
)
{
if
(
sb
->
s_root
)
{
printk
(
KERN_ERR
"EXT3-fs: get root inode failed
\n
"
);
dput
(
sb
->
s_root
);
iput
(
root
);
sb
->
s_root
=
NULL
;
goto
failed_mount3
;
printk
(
KERN_ERR
}
"EXT3-fs: corrupt root inode, run e2fsck
\n
"
);
if
(
!
S_ISDIR
(
root
->
i_mode
)
||
!
root
->
i_blocks
||
!
root
->
i_size
)
{
}
else
dput
(
sb
->
s_root
);
printk
(
KERN_ERR
"EXT3-fs: get root inode failed
\n
"
);
sb
->
s_root
=
NULL
;
printk
(
KERN_ERR
"EXT3-fs: corrupt root inode, run e2fsck
\n
"
);
goto
failed_mount3
;
goto
failed_mount3
;
}
}
...
...
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