Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
raspberrypi-kernel
提交
6ce026e4
R
raspberrypi-kernel
项目概览
openeuler
/
raspberrypi-kernel
通知
13
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
R
raspberrypi-kernel
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
6ce026e4
编写于
5月 10, 2016
作者:
Y
Yan, Zheng
提交者:
Ilya Dryomov
5月 26, 2016
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
ceph: make fault/page_mkwrite return VM_FAULT_OOM for -ENOMEM
Signed-off-by:
N
Yan, Zheng
<
zyan@redhat.com
>
上级
4f7e89f6
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
17 addition
and
20 deletion
+17
-20
fs/ceph/addr.c
fs/ceph/addr.c
+17
-20
未找到文件。
fs/ceph/addr.c
浏览文件 @
6ce026e4
...
...
@@ -1351,10 +1351,9 @@ static int ceph_filemap_fault(struct vm_area_struct *vma, struct vm_fault *vmf)
got
=
0
;
ret
=
ceph_get_caps
(
ci
,
CEPH_CAP_FILE_RD
,
want
,
-
1
,
&
got
,
&
pinned_page
);
if
(
ret
<
0
)
{
ret
=
VM_FAULT_SIGBUS
;
if
(
ret
<
0
)
goto
out_restore
;
}
dout
(
"filemap_fault %p %llu~%zd got cap refs on %s
\n
"
,
inode
,
off
,
(
size_t
)
PAGE_SIZE
,
ceph_cap_string
(
got
));
...
...
@@ -1392,7 +1391,10 @@ static int ceph_filemap_fault(struct vm_area_struct *vma, struct vm_fault *vmf)
if
(
ret1
<
0
||
off
>=
i_size_read
(
inode
))
{
unlock_page
(
page
);
put_page
(
page
);
ret
=
VM_FAULT_SIGBUS
;
if
(
ret1
<
0
)
ret
=
ret1
;
else
ret
=
VM_FAULT_SIGBUS
;
goto
out_inline
;
}
if
(
ret1
<
PAGE_SIZE
)
...
...
@@ -1408,6 +1410,9 @@ static int ceph_filemap_fault(struct vm_area_struct *vma, struct vm_fault *vmf)
}
out_restore:
ceph_restore_sigs
(
&
oldset
);
if
(
ret
<
0
)
ret
=
(
ret
==
-
ENOMEM
)
?
VM_FAULT_OOM
:
VM_FAULT_SIGBUS
;
return
ret
;
}
...
...
@@ -1429,7 +1434,7 @@ static int ceph_page_mkwrite(struct vm_area_struct *vma, struct vm_fault *vmf)
prealloc_cf
=
ceph_alloc_cap_flush
();
if
(
!
prealloc_cf
)
return
VM_FAULT_
SIGBUS
;
return
VM_FAULT_
OOM
;
ceph_block_sigs
(
&
oldset
);
...
...
@@ -1442,10 +1447,8 @@ static int ceph_page_mkwrite(struct vm_area_struct *vma, struct vm_fault *vmf)
ret
=
ceph_uninline_data
(
vma
->
vm_file
,
locked_page
);
if
(
locked_page
)
unlock_page
(
locked_page
);
if
(
ret
<
0
)
{
ret
=
VM_FAULT_SIGBUS
;
if
(
ret
<
0
)
goto
out_free
;
}
}
if
(
off
+
PAGE_SIZE
<=
size
)
...
...
@@ -1463,10 +1466,9 @@ static int ceph_page_mkwrite(struct vm_area_struct *vma, struct vm_fault *vmf)
got
=
0
;
ret
=
ceph_get_caps
(
ci
,
CEPH_CAP_FILE_WR
,
want
,
off
+
len
,
&
got
,
NULL
);
if
(
ret
<
0
)
{
ret
=
VM_FAULT_SIGBUS
;
if
(
ret
<
0
)
goto
out_free
;
}
dout
(
"page_mkwrite %p %llu~%zd got cap refs on %s
\n
"
,
inode
,
off
,
len
,
ceph_cap_string
(
got
));
...
...
@@ -1475,10 +1477,9 @@ static int ceph_page_mkwrite(struct vm_area_struct *vma, struct vm_fault *vmf)
lock_page
(
page
);
ret
=
VM_FAULT_NOPAGE
;
if
((
off
>
size
)
||
(
page
->
mapping
!=
inode
->
i_mapping
))
{
if
((
off
>
size
)
||
(
page
->
mapping
!=
inode
->
i_mapping
))
{
unlock_page
(
page
);
ret
=
VM_FAULT_NOPAGE
;
goto
out
;
}
...
...
@@ -1487,11 +1488,6 @@ static int ceph_page_mkwrite(struct vm_area_struct *vma, struct vm_fault *vmf)
/* success. we'll keep the page locked. */
set_page_dirty
(
page
);
ret
=
VM_FAULT_LOCKED
;
}
else
{
if
(
ret
==
-
ENOMEM
)
ret
=
VM_FAULT_OOM
;
else
ret
=
VM_FAULT_SIGBUS
;
}
out:
if
(
ret
==
VM_FAULT_LOCKED
||
...
...
@@ -1512,7 +1508,8 @@ static int ceph_page_mkwrite(struct vm_area_struct *vma, struct vm_fault *vmf)
out_free:
ceph_restore_sigs
(
&
oldset
);
ceph_free_cap_flush
(
prealloc_cf
);
if
(
ret
<
0
)
ret
=
(
ret
==
-
ENOMEM
)
?
VM_FAULT_OOM
:
VM_FAULT_SIGBUS
;
return
ret
;
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录