pwritev2 RWF_APPEND can overwrite a concurrent append
メンテナーはふだん 3 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 5/5
- 見積もり時間
- 1週間以上
- 初心者へのやさしさ
- 30/100
- issue の種類
- バグ
- 明瞭さ
- おおむね明確
- 活発さ
- 活発
- 技術スタック
- c, macos
調査の方向性
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.
索引モデルが issue の本文から書いたものです。
説明
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.
- 主要言語
- C
- スター
- 275
- フォーク
- 29
- 平均マージ
- 2日 22時間
- マージ済み PR(30日)
- 18
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
sysprog21/elfuse のほかの issue
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 86/100
メンテナーはふだん 3 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
メンテナーはふだん 3 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
メンテナーはふだん 3 日以内に返信
-
bug
難易度 5/5 1週間以上 初心者へのやさしさ 35/100
メンテナーはふだん 3 日以内に返信
-
難易度 5/5 1週間以上 初心者へのやさしさ 25/100
メンテナーはふだん 3 日以内に返信
sysprog21/elfuse の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
HexaCluster/credcheck#86 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 66/100
mongodb/winkerberos#175 ·
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
AOMediaCodec/SVT-AV1#3320 ·
-
difficulty: easy
難易度 2/5 1〜3時間 初心者へのやさしさ 64/100