mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2026-12-05 02:27:26 +01:00
* mount: refuse RENAME_EXCHANGE instead of renaming over the target renameat2(a, b, RENAME_EXCHANGE) asks for the two names to be swapped atomically. Rename let the flag through and went on as a plain rename, so a was moved over b, b's content was gone, and the call reported success. The filer's rename moves one entry and cannot swap two, so the mount now answers EINVAL, which is what renameat2(2) returns for a flag the file system does not support, and callers fall back on it. RenameWhiteout was 3, which is RENAME_NOREPLACE|RENAME_EXCHANGE; the flag is 1<<2. Both values, and any other flag the mount does not implement, now get the same EINVAL (3 answered ENOTSUP, 4 already EINVAL). Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> * mount: trim the rename flag comments Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: MapleWhiteZZZ <18653045+MapleWhiteZZZ@users.noreply.github.com> Co-authored-by: Claude Fable 5.2 <noreply@anthropic.com> Co-authored-by: Chris Lu <chrislusf@users.noreply.github.com>