ceph: don't freeze during write page faults
diff mbox series

Message ID 20190801201242.16675-1-jlayton@kernel.org
State New
Headers show
Series
  • ceph: don't freeze during write page faults
Related show

Commit Message

Jeff Layton Aug. 1, 2019, 8:12 p.m. UTC
Prevent freezing operations during write page faults. This is good
practice for most filesystems, but especially for ceph since we're
monkeying with the signal table here.

Signed-off-by: Jeff Layton <jlayton@kernel.org>
---
 fs/ceph/addr.c | 2 ++
 1 file changed, 2 insertions(+)

Comments

Yan, Zheng Aug. 2, 2019, 6:56 a.m. UTC | #1
On Fri, Aug 2, 2019 at 11:14 AM Jeff Layton <jlayton@kernel.org> wrote:
>
> Prevent freezing operations during write page faults. This is good
> practice for most filesystems, but especially for ceph since we're
> monkeying with the signal table here.
>
> Signed-off-by: Jeff Layton <jlayton@kernel.org>
> ---
>  fs/ceph/addr.c | 2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/fs/ceph/addr.c b/fs/ceph/addr.c
> index 563423891a98..731d96f8270d 100644
> --- a/fs/ceph/addr.c
> +++ b/fs/ceph/addr.c
> @@ -1548,6 +1548,7 @@ static vm_fault_t ceph_page_mkwrite(struct vm_fault *vmf)
>         if (!prealloc_cf)
>                 return VM_FAULT_OOM;
>
> +       sb_start_pagefault(inode->i_sb);
>         ceph_block_sigs(&oldset);
>
>         if (ci->i_inline_version != CEPH_INLINE_NONE) {
> @@ -1622,6 +1623,7 @@ static vm_fault_t ceph_page_mkwrite(struct vm_fault *vmf)
>         ceph_put_cap_refs(ci, got);
>  out_free:
>         ceph_restore_sigs(&oldset);
> +       sb_end_pagefault(inode->i_sb);
>         ceph_free_cap_flush(prealloc_cf);
>         if (err < 0)
>                 ret = vmf_error(err);
> --
> 2.21.0
>

Reviewed-by

Patch
diff mbox series

diff --git a/fs/ceph/addr.c b/fs/ceph/addr.c
index 563423891a98..731d96f8270d 100644
--- a/fs/ceph/addr.c
+++ b/fs/ceph/addr.c
@@ -1548,6 +1548,7 @@  static vm_fault_t ceph_page_mkwrite(struct vm_fault *vmf)
 	if (!prealloc_cf)
 		return VM_FAULT_OOM;
 
+	sb_start_pagefault(inode->i_sb);
 	ceph_block_sigs(&oldset);
 
 	if (ci->i_inline_version != CEPH_INLINE_NONE) {
@@ -1622,6 +1623,7 @@  static vm_fault_t ceph_page_mkwrite(struct vm_fault *vmf)
 	ceph_put_cap_refs(ci, got);
 out_free:
 	ceph_restore_sigs(&oldset);
+	sb_end_pagefault(inode->i_sb);
 	ceph_free_cap_flush(prealloc_cf);
 	if (err < 0)
 		ret = vmf_error(err);