Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
Kernel
提交
b9680917
K
Kernel
项目概览
openeuler
/
Kernel
12 个月 前同步成功
通知
5
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
K
Kernel
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
b9680917
编写于
4月 11, 2016
作者:
A
Al Viro
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
security_d_instantiate(): move to the point prior to attaching dentry to inode
Signed-off-by:
N
Al Viro
<
viro@zeniv.linux.org.uk
>
上级
84695ffe
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
7 addition
and
8 deletion
+7
-8
fs/dcache.c
fs/dcache.c
+7
-8
未找到文件。
fs/dcache.c
浏览文件 @
b9680917
...
...
@@ -1775,11 +1775,11 @@ void d_instantiate(struct dentry *entry, struct inode * inode)
{
BUG_ON
(
!
hlist_unhashed
(
&
entry
->
d_u
.
d_alias
));
if
(
inode
)
{
security_d_instantiate
(
entry
,
inode
);
spin_lock
(
&
inode
->
i_lock
);
__d_instantiate
(
entry
,
inode
);
spin_unlock
(
&
inode
->
i_lock
);
}
security_d_instantiate
(
entry
,
inode
);
}
EXPORT_SYMBOL
(
d_instantiate
);
...
...
@@ -1796,6 +1796,7 @@ int d_instantiate_no_diralias(struct dentry *entry, struct inode *inode)
{
BUG_ON
(
!
hlist_unhashed
(
&
entry
->
d_u
.
d_alias
));
security_d_instantiate
(
entry
,
inode
);
spin_lock
(
&
inode
->
i_lock
);
if
(
S_ISDIR
(
inode
->
i_mode
)
&&
!
hlist_empty
(
&
inode
->
i_dentry
))
{
spin_unlock
(
&
inode
->
i_lock
);
...
...
@@ -1804,7 +1805,6 @@ int d_instantiate_no_diralias(struct dentry *entry, struct inode *inode)
}
__d_instantiate
(
entry
,
inode
);
spin_unlock
(
&
inode
->
i_lock
);
security_d_instantiate
(
entry
,
inode
);
return
0
;
}
...
...
@@ -1878,6 +1878,7 @@ static struct dentry *__d_obtain_alias(struct inode *inode, int disconnected)
goto
out_iput
;
}
security_d_instantiate
(
tmp
,
inode
);
spin_lock
(
&
inode
->
i_lock
);
res
=
__d_find_any_alias
(
inode
);
if
(
res
)
{
...
...
@@ -1900,13 +1901,10 @@ static struct dentry *__d_obtain_alias(struct inode *inode, int disconnected)
hlist_bl_unlock
(
&
tmp
->
d_sb
->
s_anon
);
spin_unlock
(
&
tmp
->
d_lock
);
spin_unlock
(
&
inode
->
i_lock
);
security_d_instantiate
(
tmp
,
inode
);
return
tmp
;
out_iput:
if
(
res
&&
!
IS_ERR
(
res
))
security_d_instantiate
(
res
,
inode
);
iput
(
inode
);
return
res
;
}
...
...
@@ -2372,7 +2370,6 @@ static inline void __d_add(struct dentry *dentry, struct inode *inode)
__d_instantiate
(
dentry
,
inode
);
spin_unlock
(
&
inode
->
i_lock
);
}
security_d_instantiate
(
dentry
,
inode
);
d_rehash
(
dentry
);
}
...
...
@@ -2387,8 +2384,10 @@ static inline void __d_add(struct dentry *dentry, struct inode *inode)
void
d_add
(
struct
dentry
*
entry
,
struct
inode
*
inode
)
{
if
(
inode
)
if
(
inode
)
{
security_d_instantiate
(
entry
,
inode
);
spin_lock
(
&
inode
->
i_lock
);
}
__d_add
(
entry
,
inode
);
}
EXPORT_SYMBOL
(
d_add
);
...
...
@@ -2782,6 +2781,7 @@ struct dentry *d_splice_alias(struct inode *inode, struct dentry *dentry)
if
(
!
inode
)
goto
out
;
security_d_instantiate
(
dentry
,
inode
);
spin_lock
(
&
inode
->
i_lock
);
if
(
S_ISDIR
(
inode
->
i_mode
))
{
struct
dentry
*
new
=
__d_find_any_alias
(
inode
);
...
...
@@ -2809,7 +2809,6 @@ struct dentry *d_splice_alias(struct inode *inode, struct dentry *dentry)
}
else
{
__d_move
(
new
,
dentry
,
false
);
write_sequnlock
(
&
rename_lock
);
security_d_instantiate
(
new
,
inode
);
}
iput
(
inode
);
return
new
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录