Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
Kernel
提交
cf6605d1
K
Kernel
项目概览
openeuler
/
Kernel
接近 2 年 前同步成功
通知
8
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看板
提交
cf6605d1
编写于
2月 18, 2020
作者:
T
Trond Myklebust
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
NFSv4: Ensure layout headers are RCU safe
Signed-off-by:
N
Trond Myklebust
<
trond.myklebust@hammerspace.com
>
上级
d911c57a
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
13 addition
and
11 deletion
+13
-11
fs/nfs/blocklayout/blocklayout.c
fs/nfs/blocklayout/blocklayout.c
+1
-1
fs/nfs/filelayout/filelayout.c
fs/nfs/filelayout/filelayout.c
+1
-1
fs/nfs/flexfilelayout/flexfilelayout.c
fs/nfs/flexfilelayout/flexfilelayout.c
+3
-3
fs/nfs/pnfs.c
fs/nfs/pnfs.c
+6
-6
fs/nfs/pnfs.h
fs/nfs/pnfs.h
+2
-0
未找到文件。
fs/nfs/blocklayout/blocklayout.c
浏览文件 @
cf6605d1
...
...
@@ -476,7 +476,7 @@ static void bl_free_layout_hdr(struct pnfs_layout_hdr *lo)
err
=
ext_tree_remove
(
bl
,
true
,
0
,
LLONG_MAX
);
WARN_ON
(
err
);
kfree
(
bl
);
kfree
_rcu
(
bl
,
bl_layout
.
plh_rcu
);
}
static
struct
pnfs_layout_hdr
*
__bl_alloc_layout_hdr
(
struct
inode
*
inode
,
...
...
fs/nfs/filelayout/filelayout.c
浏览文件 @
cf6605d1
...
...
@@ -1146,7 +1146,7 @@ filelayout_alloc_layout_hdr(struct inode *inode, gfp_t gfp_flags)
static
void
filelayout_free_layout_hdr
(
struct
pnfs_layout_hdr
*
lo
)
{
kfree
(
FILELAYOUT_FROM_HDR
(
lo
)
);
kfree
_rcu
(
FILELAYOUT_FROM_HDR
(
lo
),
generic_hdr
.
plh_rcu
);
}
static
struct
pnfs_ds_commit_info
*
...
...
fs/nfs/flexfilelayout/flexfilelayout.c
浏览文件 @
cf6605d1
...
...
@@ -59,14 +59,14 @@ ff_layout_alloc_layout_hdr(struct inode *inode, gfp_t gfp_flags)
static
void
ff_layout_free_layout_hdr
(
struct
pnfs_layout_hdr
*
lo
)
{
struct
nfs4_flexfile_layout
*
ffl
=
FF_LAYOUT_FROM_HDR
(
lo
);
struct
nfs4_ff_layout_ds_err
*
err
,
*
n
;
list_for_each_entry_safe
(
err
,
n
,
&
FF_LAYOUT_FROM_HDR
(
lo
)
->
error_list
,
list
)
{
list_for_each_entry_safe
(
err
,
n
,
&
ffl
->
error_list
,
list
)
{
list_del
(
&
err
->
list
);
kfree
(
err
);
}
kfree
(
FF_LAYOUT_FROM_HDR
(
lo
)
);
kfree
_rcu
(
ffl
,
generic_hdr
.
plh_rcu
);
}
static
int
decode_pnfs_stateid
(
struct
xdr_stream
*
xdr
,
nfs4_stateid
*
stateid
)
...
...
fs/nfs/pnfs.c
浏览文件 @
cf6605d1
...
...
@@ -268,11 +268,11 @@ pnfs_free_layout_hdr(struct pnfs_layout_hdr *lo)
struct
nfs_server
*
server
=
NFS_SERVER
(
lo
->
plh_inode
);
struct
pnfs_layoutdriver_type
*
ld
=
server
->
pnfs_curr_ld
;
if
(
!
list_empty
(
&
lo
->
plh_layout
s
))
{
if
(
test_and_clear_bit
(
NFS_LAYOUT_HASHED
,
&
lo
->
plh_flag
s
))
{
struct
nfs_client
*
clp
=
server
->
nfs_client
;
spin_lock
(
&
clp
->
cl_lock
);
list_del_
init
(
&
lo
->
plh_layouts
);
list_del_
rcu
(
&
lo
->
plh_layouts
);
spin_unlock
(
&
clp
->
cl_lock
);
}
put_cred
(
lo
->
plh_lc_cred
);
...
...
@@ -784,7 +784,8 @@ pnfs_layout_bulk_destroy_byserver_locked(struct nfs_client *clp,
break
;
inode
=
igrab
(
lo
->
plh_inode
);
if
(
inode
!=
NULL
)
{
list_del_init
(
&
lo
->
plh_layouts
);
if
(
test_and_clear_bit
(
NFS_LAYOUT_HASHED
,
&
lo
->
plh_flags
))
list_del_rcu
(
&
lo
->
plh_layouts
);
if
(
pnfs_layout_add_bulk_destroy_list
(
inode
,
layout_list
))
continue
;
...
...
@@ -1870,15 +1871,14 @@ static void pnfs_clear_first_layoutget(struct pnfs_layout_hdr *lo)
static
void
_add_to_server_list
(
struct
pnfs_layout_hdr
*
lo
,
struct
nfs_server
*
server
)
{
if
(
list_empty
(
&
lo
->
plh_layout
s
))
{
if
(
!
test_and_set_bit
(
NFS_LAYOUT_HASHED
,
&
lo
->
plh_flag
s
))
{
struct
nfs_client
*
clp
=
server
->
nfs_client
;
/* The lo must be on the clp list if there is any
* chance of a CB_LAYOUTRECALL(FILE) coming in.
*/
spin_lock
(
&
clp
->
cl_lock
);
if
(
list_empty
(
&
lo
->
plh_layouts
))
list_add_tail
(
&
lo
->
plh_layouts
,
&
server
->
layouts
);
list_add_tail_rcu
(
&
lo
->
plh_layouts
,
&
server
->
layouts
);
spin_unlock
(
&
clp
->
cl_lock
);
}
}
...
...
fs/nfs/pnfs.h
浏览文件 @
cf6605d1
...
...
@@ -105,6 +105,7 @@ enum {
NFS_LAYOUT_INVALID_STID
,
/* layout stateid id is invalid */
NFS_LAYOUT_FIRST_LAYOUTGET
,
/* Serialize first layoutget */
NFS_LAYOUT_INODE_FREEING
,
/* The inode is being freed */
NFS_LAYOUT_HASHED
,
/* The layout visible */
};
enum
layoutdriver_policy_flags
{
...
...
@@ -203,6 +204,7 @@ struct pnfs_layout_hdr {
loff_t
plh_lwb
;
/* last write byte for layoutcommit */
const
struct
cred
*
plh_lc_cred
;
/* layoutcommit cred */
struct
inode
*
plh_inode
;
struct
rcu_head
plh_rcu
;
};
struct
pnfs_device
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录