[Devel] [PATCH] fs/fuse kio: fix getting a non-existent pcs inode in kpcs_kill_requests()

Kirill Tkhai ktkhai at virtuozzo.com
Thu Mar 28 11:41:08 MSK 2019


On 26.03.2019 13:57, Pavel Butsykin wrote:
> Some files may not have pcs inode, so it will be safer to check for !fi->private
> before using it.
>> Signed-off-by: Pavel Butsykin <pbutsykin at virtuozzo.com>

Reviewed-by: Kirill Tkhai <ktkhai at virtuozzo.com>

> ---
>  fs/fuse/kio/pcs/pcs_fuse_kdirect.c | 7 ++++++-
>  1 file changed, 6 insertions(+), 1 deletion(-)
> 
> diff --git a/fs/fuse/kio/pcs/pcs_fuse_kdirect.c b/fs/fuse/kio/pcs/pcs_fuse_kdirect.c
> index 875ad18df4a7..a8c235244506 100644
> --- a/fs/fuse/kio/pcs/pcs_fuse_kdirect.c
> +++ b/fs/fuse/kio/pcs/pcs_fuse_kdirect.c
> @@ -1506,11 +1506,16 @@ static void kpcs_kill_requests(struct fuse_conn *fc, struct inode *inode)
>  
>  	list_for_each_entry(ff, &fc->conn_files, fl) {
>  		struct pcs_dentry_info *di;
> +		struct fuse_inode *fi;
>  
>  		if (!ff->ff_dentry)
>  			continue;
>  
> -		di = get_pcs_inode(ff->ff_dentry->d_inode);
> +		fi = get_fuse_inode(ff->ff_dentry->d_inode);
> +		if (!fi->private)
> +			continue;
> +
> +		di = pcs_inode_from_fuse(fi);
>  
>  		spin_lock(&di->kq_lock);
>  		fuse_kill_requests(fc, inode, &di->kq);
> 



More information about the Devel mailing list