`open` with `O_DIRECT` succeeds on a FIFO, where Linux returns `EINVAL`
メンテナーはふだん 3 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 初心者へのやさしさ
- 62/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
- 技術スタック
- c, linux, macos
調査の方向性
Start with the reproducer in the issue and find where elfuse handles open flags, especially O_DIRECT and the FIFO and /proc/self/fd/N paths. Compare against the Linux rule in do_dentry_open (fs/open.c), which returns EINVAL when the file lacks FMODE_CAN_ODIRECT. Done when both FIFO and pipe-through-procfs opens with O_DIRECT return -1 with EINVAL, matching Linux 6.12.
索引モデルが issue の本文から書いたものです。
説明
Linux refuses O_DIRECT at open for a file that cannot do direct I/O: do_dentry_open (fs/open.c) returns EINVAL when the flag is set and the file lacks FMODE_CAN_ODIRECT, which a FIFO lacks. A pipe takes the flag through pipe2 and F_SETFL only. Under elfuse the open succeeds, both for a FIFO opened by name and for a pipe reopened through /proc/self/fd/N.
Reproducer:
#define _GNU_SOURCE
#include <errno.h>
#include <fcntl.h>
#include <stdio.h>
#include <sys/stat.h>
#include <unistd.h>
int main(void)
{
const char *fifo = "/tmp/o-direct-fifo";
char link[64];
int p[2];
unlink(fifo);
mkfifo(fifo, 0600);
int rd = open(fifo, O_RDONLY | O_NONBLOCK);
errno = 0;
int wr = open(fifo, O_WRONLY | O_DIRECT);
printf("open(fifo, O_WRONLY|O_DIRECT): %s errno=%d\n",
wr >= 0 ? "an fd" : "-1", errno);
pipe(p);
snprintf(link, sizeof(link), "/proc/self/fd/%d", p[1]);
errno = 0;
int again = open(link, O_WRONLY | O_DIRECT);
printf("open(/proc/self/fd/N, O_WRONLY|O_DIRECT) on a pipe: %s errno=%d\n",
again >= 0 ? "an fd" : "-1", errno);
(void) rd;
unlink(fifo);
return 0;
}
| FIFO by name | pipe through /proc/self/fd/N |
|
|---|---|---|
elfuse b57f367 |
an fd | an fd |
| Linux 6.12 under qemu | -1, EINVAL |
-1, EINVAL |
- 主要言語
- C
- スター
- 273
- フォーク
- 29
- 平均マージ
- 2日 10時間
- マージ済み PR(30日)
- 17
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
sysprog21/elfuse のほかの issue
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
メンテナーはふだん 3 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
メンテナーはふだん 3 日以内に返信
-
難易度 4/5 3〜5日 初心者へのやさしさ 30/100
メンテナーはふだん 3 日以内に返信
-
難易度 4/5 3〜5日 初心者へのやさしさ 35/100
メンテナーはふだん 3 日以内に返信
-
難易度 4/5 3〜5日 初心者へのやさしさ 35/100
メンテナーはふだん 3 日以内に返信
sysprog21/elfuse の issue をすべて見る
似ている issue
-
native-cpu: -Wreturn-type in skainet_row_threads.c:150 (worker fn has no return)対応中かも @Doomguy-BFG9000 が今日担当しました。 オープンgood first issue size:xs skill:native
難易度 1/5 1時間未満 初心者へのやさしさ 78/100
SKaiNET-developers/SKaiNET#1358 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 64/100
libsdl-org/SDL#16539 ·
メンテナーはふだん 1 日以内に返信
-
git-workflow task-4
難易度 2/5 1〜3時間 初心者へのやさしさ 66/100
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 67/100
dosemu2/dosemu2#3178 · コメント 1 件 · リアクション 1 件 ·
メンテナーはふだん 1 日以内に返信