[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: use of renameat2
From: |
Pádraig Brady |
Subject: |
Re: use of renameat2 |
Date: |
Wed, 18 Nov 2015 16:41:53 +0000 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 |
On 18/11/15 16:05, Eric Blake wrote:
> Where could we use the new Linux renameat2() syscall within coreutils,
> if it is available? Oftentimes, having a working client of a syscall
> for a few filesystems is incentive for other filesystems to prioritize
> implementing support for the syscall. I'm really impressed by
> renameat2()'s ability to atomically swap two files, and moreso by its
> ability to replace a symlink with a directory or vice-versa (without an
> intermediate TOCTTOU race that we currently face via remove()/rename()
> pairs).
>
> http://www.dsm.fordham.edu/cgi-bin/man-cgi.pl?topic=renameat2&sect=2
The file replacing functionality with --backup in copy.c
would probably benefit, as currently the dest file
may be missing for a while or partially written.
I've also noted to investigate it if we ever
get to implementing the "rewrite" utility.
cheers,
Pádraig.