[PATCH 1/1] backing-file: covert to using fops->splice_write

Matthew Wilcox willy at infradead.org
Sun Jul 7 13:42:42 PDT 2024


On Fri, Jul 05, 2024 at 04:16:39PM +0800, ed.tsai at mediatek.com wrote:
> +++ b/fs/backing-file.c
> @@ -280,13 +280,16 @@ ssize_t backing_file_splice_write(struct pipe_inode_info *pipe,
>  	if (WARN_ON_ONCE(!(out->f_mode & FMODE_BACKING)))
>  		return -EIO;
>  
> +	if (out->f_op->splice_write)
> +		return -EINVAL;

Umm ... shouldn't this have been !out->f_op->splice_write?

>  	ret = file_remove_privs(ctx->user_file);
>  	if (ret)
>  		return ret;
>  
>  	old_cred = override_creds(ctx->cred);
>  	file_start_write(out);
> -	ret = iter_file_splice_write(pipe, out, ppos, len, flags);
> +	ret = out->f_op->splice_write(pipe, out, ppos, len, flags);
>  	file_end_write(out);
>  	revert_creds(old_cred);
>  
> -- 
> 2.18.0
> 
> 



More information about the linux-arm-kernel mailing list