Diff Detail
- Repository
- rG FreeBSD src repository
- Lint
Lint Skipped - Unit
Tests Skipped
Event Timeline
Rumors are that it is not too much work to add ZFS support.
I am sure that UFS is hard due to SU and esp. SU+J. I am adding Kirk in case he is interested.
I promise to handle msdosfs if any of large fs (AKA UFS or ZFS) get the flag.
| sys/kern/vfs_syscalls.c | ||
|---|---|---|
| 3789–3792 | The Linux man pages I looked at seem to indicate EINVAL should be returned if both NOREPLACE and EXCHANGE are set, since they're mutually exclusive. Do we need to be concerned about that level of compatibility? The below check that returns EEXIST will still avoid modifying the target file in that case. | |
| sys/kern/vfs_syscalls.c | ||
|---|---|---|
| 3789–3792 | It's probably worth mirroring the Linux behaviour here. | |
The sys/kern/vfs_syscalls.c and sys/sys/fcntl.h changes LGTM with one small note
| sys/sys/fcntl.h | ||
|---|---|---|
| 263 | Perhaps /* Atomically exchange from and to */ | |
I've applied the patch to my tree and will give it a try in Halifax next week.
For reference, OpenZFS commit that added Linux support: https://github.com/openzfs/zfs/commit/dbf6108b4df92341eea40d0b41792ac16eabc514
Thanks to Air Canada giving me an unexpected few hours in YYZ I had a chance to try this out. One remaining issue w/ the tmpfs support - missing directory timestamp update.
I now have a kernel panic from an attempt to swap with source missing, e.g.
#include <fcntl.h>
#include <stdio.h>
#include <unistd.h>
int main(void) {
close(open("target", O_CREAT | O_WRONLY, 0644));
renameat2(AT_FDCWD, "does_not_exist", AT_FDCWD, "target", RENAME_EXCHANGE);
}This thing does not even wrap renameat(2), neither it wraps renameat2(2).
Might be, but I do not have an example that I can thought of.
| lib/libsys/rename.2 | ||
|---|---|---|
| 151 | It is already documented below, in the renameat2() error section. It was done when renameat2() was added. | |