`open` with `O_DIRECT` succeeds on a FIFO, where Linux returns `EINVAL`
Los mantenedores suelen responder en 2 días
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Aptitud para principiantes
- 62/100
- Tipo de issue
- Error
- Claridad
- Bien especificado
- Estado de actividad
- Activo
- Stack tecnológico
- c, linux, macos
- Área
- operating-systems
Línea de trabajo
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.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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 |
- Lenguaje dominante
- C
- Estrellas
- 273
- Forks
- 29
- Merge medio
- 2 d 20 h
- PR fusionados (30 d)
- 16
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Sin plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de sysprog21/elfuse
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
Los mantenedores suelen responder en 2 días
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
Los mantenedores suelen responder en 2 días
-
Dificultad 3/5 Medio día Aptitud para principiantes 62/100
Los mantenedores suelen responder en 2 días
-
bug
Dificultad 3/5 1-2 días Aptitud para principiantes 50/100
Los mantenedores suelen responder en 2 días
-
enhancement
Dificultad 4/5 3-5 días Aptitud para principiantes 40/100
Los mantenedores suelen responder en 2 días
Todos los issues de sysprog21/elfuse
Issues similares
-
UB: (int) cast of a user double outside int range in dispatch / vm_index_is_int / flat_index_atAbiertoarea:runtime-vm
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
InauguralSystems/EigenScript#1748 ·
Los mantenedores suelen responder en 1 día
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
wasm-micro-runtime/wasm-micro-runtime#5159 ·
Los mantenedores suelen responder en 7 días
-
chore: update release scheduleAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
Los mantenedores suelen responder en 4 días
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 Medio día Aptitud para principiantes 62/100
Los mantenedores suelen responder en 1 día