[Virtio-fs] [PATCH 9/9] fuse: fix deadlock in __fuse_file_fallocate()

Vivek Goyal vgoyal at redhat.com
Tue Apr 16 18:07:56 UTC 2019


On Wed, Apr 17, 2019 at 02:03:22AM +0800, Liu Bo wrote:
> From: Xiaoguang Wang <xiaoguang.wang at linux.alibaba.com>
> 
> This bug is obvious, fix it.
> 
> Reviewed-by: Joseph Qi <joseph.qi at linux.alibaba.com>
> Signed-off-by: Xiaoguang Wang <xiaoguang.wang at linux.alibaba.com>

Thanks. This one I ran into late last week while testing
fallocate(PUNCH_HOLE) and fixed it already in my internal branch.

Vivek
> ---
>  fs/fuse/file.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/fs/fuse/file.c b/fs/fuse/file.c
> index 6ab23d7..0236783 100644
> --- a/fs/fuse/file.c
> +++ b/fs/fuse/file.c
> @@ -3623,7 +3623,7 @@ static long __fuse_file_fallocate(struct file *file, int mode,
>  	if (mode & FALLOC_FL_PUNCH_HOLE) {
>  		down_write(&fi->i_mmap_sem);
>  		truncate_pagecache_range(inode, offset, offset + length - 1);
> -		down_write(&fi->i_mmap_sem);
> +		up_write(&fi->i_mmap_sem);
>  	}
>  	fuse_invalidate_attr(inode);
>  
> -- 
> 1.8.3.1
> 
> _______________________________________________
> Virtio-fs mailing list
> Virtio-fs at redhat.com
> https://www.redhat.com/mailman/listinfo/virtio-fs




More information about the Virtio-fs mailing list