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
798434bd
Commit
798434bd
authored
Mar 24, 2016
by
Al Viro
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
__d_alloc(): treat NULL name as QSTR("/", 1)
Signed-off-by:
Al Viro
<
viro@zeniv.linux.org.uk
>
parent
322ea0bb
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
6 deletions
+7
-6
fs/dcache.c
fs/dcache.c
+7
-6
No files found.
fs/dcache.c
View file @
798434bd
...
...
@@ -1558,7 +1558,11 @@ struct dentry *__d_alloc(struct super_block *sb, const struct qstr *name)
* be overwriting an internal NUL character
*/
dentry
->
d_iname
[
DNAME_INLINE_LEN
-
1
]
=
0
;
if
(
name
->
len
>
DNAME_INLINE_LEN
-
1
)
{
if
(
unlikely
(
!
name
))
{
static
const
struct
qstr
anon
=
QSTR_INIT
(
"/"
,
1
);
name
=
&
anon
;
dname
=
dentry
->
d_iname
;
}
else
if
(
name
->
len
>
DNAME_INLINE_LEN
-
1
)
{
size_t
size
=
offsetof
(
struct
external_name
,
name
[
1
]);
struct
external_name
*
p
=
kmalloc
(
size
+
name
->
len
,
GFP_KERNEL_ACCOUNT
);
...
...
@@ -1812,9 +1816,7 @@ struct dentry *d_make_root(struct inode *root_inode)
struct
dentry
*
res
=
NULL
;
if
(
root_inode
)
{
static
const
struct
qstr
name
=
QSTR_INIT
(
"/"
,
1
);
res
=
__d_alloc
(
root_inode
->
i_sb
,
&
name
);
res
=
__d_alloc
(
root_inode
->
i_sb
,
NULL
);
if
(
res
)
d_instantiate
(
res
,
root_inode
);
else
...
...
@@ -1855,7 +1857,6 @@ EXPORT_SYMBOL(d_find_any_alias);
static
struct
dentry
*
__d_obtain_alias
(
struct
inode
*
inode
,
int
disconnected
)
{
static
const
struct
qstr
anonstring
=
QSTR_INIT
(
"/"
,
1
);
struct
dentry
*
tmp
;
struct
dentry
*
res
;
unsigned
add_flags
;
...
...
@@ -1869,7 +1870,7 @@ static struct dentry *__d_obtain_alias(struct inode *inode, int disconnected)
if
(
res
)
goto
out_iput
;
tmp
=
__d_alloc
(
inode
->
i_sb
,
&
anonstring
);
tmp
=
__d_alloc
(
inode
->
i_sb
,
NULL
);
if
(
!
tmp
)
{
res
=
ERR_PTR
(
-
ENOMEM
);
goto
out_iput
;
...
...
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