Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 5 Jul 2019 08:26:22 -0600
From:      Alan Somers <asomers@freebsd.org>
To:        Rick Macklem <rmacklem@uoguelph.ca>
Cc:        "freebsd-current@FreeBSD.org" <freebsd-current@freebsd.org>, "kib@freebsd.org" <kib@freebsd.org>
Subject:   Re: should a copy_file_range(2) syscall be interrupted via a signal
Message-ID:  <CAOtMX2jfkcN3tM8oCEtogfeQrnX7_D-xFgAjGbROkrENsFVcQg@mail.gmail.com>
In-Reply-To: <YTXPR01MB0285E79DFAAE250FD7A7A181DDF50@YTXPR01MB0285.CANPRD01.PROD.OUTLOOK.COM>
References:  <YTXPR01MB0285E79DFAAE250FD7A7A181DDF50@YTXPR01MB0285.CANPRD01.PROD.OUTLOOK.COM>

next in thread | previous in thread | raw e-mail | index | archive | help
On Thu, Jul 4, 2019 at 6:29 PM Rick Macklem <rmacklem@uoguelph.ca> wrote:
>
> Hi,
>
> I have been working on a Linux compatible copy_file_range(2) syscall
> (the current code can be found at https://reviews.freebsd.org/D20584).
>
> One outstanding issue is how it should deal with signals.
> Right now, I have vn_start_write() without PCATCH, so that it won't be
> interrupted by a signal, but I notice that vn_write() {ie. write syscall } does
> have PCATCH on vn_start_write() and so does vn_rdwr() when it is called
> without IO_NODELOCKED.
>
> I am thinking that copy_file_range(2) should do this also.
> However, if it returns an error, it is impossible for the caller to know how much
> of the data range got copied.
>
> What do you think the copy_file_range(2) code should do?
>
> Thanks, rick
> ps: I've used FreeBSD-current@ this time, to see if I get more replies than I
>       did using FreeBSD-fs@.

I though copy_file_range(2) is allowed to return short.  Why can't it
do that if it gets interrupted?



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAOtMX2jfkcN3tM8oCEtogfeQrnX7_D-xFgAjGbROkrENsFVcQg>