Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 22 Jun 2019 17:02:47 -0700 (PDT)
From:      Sean Eric Fagan <sef@kithrup.com>
To:        rmacklem@uoguelph.ca
Cc:        freebsd-fs@freebsd.org
Subject:   Re: RFC: What should a copy_file_range(2) syscall do by default?
Message-ID:  <20190623000247.B239E14C36@kithrup.com>

next in thread | raw e-mail | index | archive | help
>>Alan mentioned locking, which does buy you something, but it also means
>>*locking the file while it is being copied*.  Which, for large files, is not
>>so great.  I also don't think you can call any large copy atomic, unless
>>you're using a signle transaction for the entire copy.
>I tried posting w.r.t. atomicity and didn't get a lot of responses.
>However, although
>kib@ didn't exactly say it should be the case, he did point out that FreeBSD has
>traditionally ensured atomicity of file updates for syscalls and felt
>that was a good
>thing. As such, I've done the range locking of both files and created
>new primitives
>to do that while avoiding deadlock.

If the source file is locked, then it's easy to create a DOS against editing
by anyone who can read the file.




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