pwritev2 RWF_APPEND can overwrite a concurrent append
I maintainer di solito rispondono entro 3 giorni
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Idoneità per principianti
- 30/100
- Tipo di issue
- Bug
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Attiva
- Stack tecnologico
- c, macos
- Ambito
- operating-systems
Direzione di ricerca
Start in src/syscall/io.c at sys_pwritev_append, then compare the O_APPEND paths in sys_pwrite64 and sys_pwritev. The issue describes a race but no safe approach for descriptors without O_APPEND; investigate available host mechanisms while accounting for shared file-description flags. Done means concurrent RWF_APPEND writes do not overwrite one another, including on descriptors opened without O_APPEND.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
pwritev2 with RWF_APPEND (sys_pwritev_append in src/syscall/io.c) reads the end of file with fstat and then writes there with pwritev, in two host calls. Linux finds the end of file and writes under the inode lock, so two processes appending to one file with RWF_APPEND never overwrite each other. Under elfuse both can read the same st_size, and the second write lands on the first one's bytes while each call returns success.
For a descriptor that is already O_APPEND, sys_pwrite64 and sys_pwritev now route the write through the host's own append (#463), and RWF_APPEND on such a descriptor could share that path. For a descriptor opened without O_APPEND, macOS has no call that appends atomically without changing the open file description's flags. Setting O_APPEND with F_SETFL around the write would change the flags that a forked child and sibling threads share.
Found in review on #463. It is not changed there because the same fstat then pwritev shape exists on main.
- Lingua principale
- C
- Stelle
- 275
- Fork
- 29
- Merge medio
- 2g 22h
- PR unite (30g)
- 18
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di sysprog21/elfuse
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 86/100
I maintainer di solito rispondono entro 3 giorni
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
I maintainer di solito rispondono entro 3 giorni
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
I maintainer di solito rispondono entro 3 giorni
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 48/100
I maintainer di solito rispondono entro 3 giorni
-
bug
Difficoltà 5/5 Più di una settimana Idoneità per principianti 35/100
I maintainer di solito rispondono entro 3 giorni
Tutte le issue di sysprog21/elfuse
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
HexaCluster/credcheck#86 ·
-
Wheels for Python 3.15Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 66/100
mongodb/winkerberos#175 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 63/100
raspberrypi/linux#7718 · 2 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
AOMediaCodec/SVT-AV1#3320 ·