[LTP] [PATCH v4 1/2] syscalls/splice04: add test for splice() from pipe to pipe

Cyril Hrubis chrubis@suse.cz
Fri May 19 16:38:02 CEST 2017


Hi!
> > +	SAFE_PIPE(pp1);
> > +	SAFE_PIPE(pp2);
> > +	SAFE_WRITE(1, pp1[1], arr_in, num_len_data);
> > +	for (i = 0; i < num_len_data; i++) {
> > +		ret = splice(pp1[0], NULL, pp2[1], NULL, 1, SPLICE_F_MOVE);
> > +		if (ret == -1) {
> > +			tst_res(TFAIL | TERRNO, "splice error");
> > +			goto exit;
> > +		}
> > +		SAFE_READ(1, pp2[0], arr_out + i, 1);
> > +	}
> 
> I do not understand why we are moving the data byte by byte here?
> 
> And also the SPLICE_F_MOVE flag, even if that was correctly implemented,
> would be useless here.

Looked at the previous version of the patch and the comment from Jan.

What he meant there was that we should decrease the number of requested
bytes by the number of bytes we spliced already.

-- 
Cyril Hrubis
chrubis@suse.cz


More information about the ltp mailing list