[Devel,RHEL7,COMMIT] fuse: fuse_prepare_write() should not wait on fuse-writeback

Submitted by Konstantin Khorenko on Dec. 5, 2016, 8:35 a.m.

Details

Message ID 201612050835.uB58ZgXV019799@finist_cl7.x64_64.work.ct
State New
Series "fuse: fuse_prepare_write() should not wait on fuse-writeback"
Headers show

Commit Message

Konstantin Khorenko Dec. 5, 2016, 8:35 a.m.
The commit is pushed to "branch-rh7-3.10.0-327.36.1.vz7.20.x-ovz" and will appear at https://src.openvz.org/scm/ovz/vzkernel.git
after rh7-3.10.0-327.36.1.vz7.20.10
------>
commit 97825f6e3a3da5160d57663b0dcb83f942ca67c5
Author: Maxim Patlasov <mpatlasov@virtuozzo.com>
Date:   Mon Dec 5 12:35:42 2016 +0400

    fuse: fuse_prepare_write() should not wait on fuse-writeback
    
    The patch fixes a silly mistake: when fuse_prepare_write() calls
    __fuse_readpage(), the latter will do fuse_wait_on_page_writeback_or_invalidate
    anyway, so explicit fuse_wait_on_page_writeback is redundant.
    
    That silly mistake resulted in deadlock because, fuse_prepare_write
    used fuse_wait_on_page_writeback instead od smarter
    fuse_wait_on_page_writeback_or_invalidate.
    
    https://jira.sw.ru/browse/PSBM-56474
    
    Signed-off-by: Maxim Patlasov <mpatlasov@virtuozzo.com>
---
 fs/fuse/file.c | 7 -------
 1 file changed, 7 deletions(-)

Patch hide | download patch | download mbox

diff --git a/fs/fuse/file.c b/fs/fuse/file.c
index 52bca91..641b570 100644
--- a/fs/fuse/file.c
+++ b/fs/fuse/file.c
@@ -2328,13 +2328,6 @@  static int fuse_prepare_write(struct fuse_conn *fc, struct file *file,
 		return 0;
 	}
 
-	/*
-	 * Page writeback can extend beyond the liftime of the
-	 * page-cache page, so make sure we read a properly synced
-	 * page.
-	 */
-	fuse_wait_on_page_writeback(page->mapping->host, page->index);
-
 	num_read = __fuse_readpage(file, page, page_len, &err, &req, NULL,
 				   NULL);
 	if (req)

Comments

Konstantin Khorenko Dec. 7, 2016, 3:27 p.m.
Please consider to port to PCS6.

--
Best regards,

Konstantin Khorenko,
Virtuozzo Linux Kernel Team

On 12/05/2016 11:35 AM, Konstantin Khorenko wrote:
> The commit is pushed to "branch-rh7-3.10.0-327.36.1.vz7.20.x-ovz" and will appear at https://src.openvz.org/scm/ovz/vzkernel.git
> after rh7-3.10.0-327.36.1.vz7.20.10
> ------>
> commit 97825f6e3a3da5160d57663b0dcb83f942ca67c5
> Author: Maxim Patlasov <mpatlasov@virtuozzo.com>
> Date:   Mon Dec 5 12:35:42 2016 +0400
>
>     fuse: fuse_prepare_write() should not wait on fuse-writeback
>
>     The patch fixes a silly mistake: when fuse_prepare_write() calls
>     __fuse_readpage(), the latter will do fuse_wait_on_page_writeback_or_invalidate
>     anyway, so explicit fuse_wait_on_page_writeback is redundant.
>
>     That silly mistake resulted in deadlock because, fuse_prepare_write
>     used fuse_wait_on_page_writeback instead od smarter
>     fuse_wait_on_page_writeback_or_invalidate.
>
>     https://jira.sw.ru/browse/PSBM-56474
>
>     Signed-off-by: Maxim Patlasov <mpatlasov@virtuozzo.com>
> ---
>  fs/fuse/file.c | 7 -------
>  1 file changed, 7 deletions(-)
>
> diff --git a/fs/fuse/file.c b/fs/fuse/file.c
> index 52bca91..641b570 100644
> --- a/fs/fuse/file.c
> +++ b/fs/fuse/file.c
> @@ -2328,13 +2328,6 @@ static int fuse_prepare_write(struct fuse_conn *fc, struct file *file,
>  		return 0;
>  	}
>
> -	/*
> -	 * Page writeback can extend beyond the liftime of the
> -	 * page-cache page, so make sure we read a properly synced
> -	 * page.
> -	 */
> -	fuse_wait_on_page_writeback(page->mapping->host, page->index);
> -
>  	num_read = __fuse_readpage(file, page, page_len, &err, &req, NULL,
>  				   NULL);
>  	if (req)
> .
>