[LU-11557] Implement renameat2() with RENAME_EXCHANGE and RENAME_WHITEOUT Created: 22/Oct/18 Updated: 19/Sep/23 |
|
| Status: | Open |
| Project: | Lustre |
| Component/s: | None |
| Affects Version/s: | Lustre 2.10.5, Lustre 2.12.2 |
| Fix Version/s: | Lustre 2.16.0 |
| Type: | Improvement | Priority: | Minor |
| Reporter: | Stephane Thiell | Assignee: | WC Triage |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | medium | ||
| Environment: |
CentOS 7 |
||
| Issue Links: |
|
||||||||
| Rank (Obsolete): | 9223372036854775807 | ||||||||
| Description |
|
It would be nice to have support for renameat2()'s linux specific flags RENAME_EXCHANGE and RENAME_WHITEOUT so that Lustre could be safely used as a backend to some overlayfs implementations in user space. For example, the code snippet below works on ext4 and xfs but not on Lustre: #include <errno.h> #include <fcntl.h> #include <stdio.h> #include <unistd.h> #include <linux/fs.h> #include <sys/syscall.h> int main(int argc, char *argv[]) { int ret; ret = syscall(SYS_renameat2, AT_FDCWD, argv[1], AT_FDCWD, argv[2], RENAME_EXCHANGE); if (ret != 0) fprintf(stderr, "renameat2(%s, %s) ret=%d, errno=%d\n", argv[1], argv[2], ret, errno); return ret; } $ renameat2 file1 file2 renameat2(file1, file2) ret=-1 errno=22
Example on ext4: $ echo file1 > file1 $ echo file2 > file2 $ ./renameat2 file1 file2 renameat2 ret=0 errno=0 $ cat file1 file2 $ cat file2 file1
Thanks!
|
| Comments |
| Comment by Andreas Dilger [ 23/Oct/18 ] |
|
Stephane, is this something that you will be looking into, or should we try to find someone on our side to look into it? |
| Comment by Stephane Thiell [ 23/Oct/18 ] |
|
Hi Andreas! It's a "would be nice to have" ticket. I don't plan to look into it but I will be happy to test patches if you decide it's worth implementing it in Lustre. |
| Comment by Peter Jones [ 23/Oct/18 ] |
|
Dongyang Could you please look into this? Thanks Peter |
| Comment by Dominique Martinet [ 05/Apr/21 ] |
|
(Was: request to fix the LU description example code. Thanks Andreas!) |