truncate on /dev/shm drops the guest's record locks
Mantenedores costumam responder em até 2 dias
Ninguém assumiu esta issue ainda.
Avaliação
- Dificuldade
- 4/5
- Tempo estimado
- 3-5 dias
- Facilidade para iniciantes
- 48/100
- Tipo de issue
- Bug
- Clareza
- Razoavelmente clara
- Status de atividade
- Ativa
- Stack de tecnologia
- c, linux, macos
- Domínio
- operating-systems
Direção de pesquisa
Read sys_truncate and shm_open_leaf in src/syscall/fs.c, then compare the /dev/shm branch with the regular-file change in #463. Reproduce the issue with the described aarch64 probe: lock the file, truncate it, and have a child check the lock. Done means /dev/shm truncation preserves the guest's record lock while retaining the branch's protection against following symlinks.
Escrita pelo modelo de indexação a partir do texto da issue.
Descrição
truncate() on a /dev/shm path drops every POSIX record lock the guest holds on that file. sys_truncate in src/syscall/fs.c reaches a /dev/shm leaf through shm_open_leaf, truncates through that descriptor and closes it. On macOS, closing any descriptor for a file releases all of the process's fcntl record locks on it, and guest F_SETLK locks are host record locks.
Measured with a static aarch64 probe: open /dev/shm/elfuse-lock-probe, take an F_SETLK write lock, call truncate(path, 100), then have a forked child check the lock with F_GETLK.
| Linux (qemu) | elfuse main (e9fdbbb) | |
|---|---|---|
| truncate | 0 | 0 |
| lock seen by the child | held | gone |
Linux's vfs_truncate opens nothing, so the lock survives. #463 removed the same open-and-close from the regular-file path of truncate after review; the /dev/shm branch was left as it was.
Goal: truncate on a /dev/shm path leaves the guest's record locks in place. The branch opens the leaf because truncate(2) has no nofollow form, so a fix would have to keep that protection without closing a descriptor on the file.
- Linguagem predominante
- C
- Estrelas
- 287
- Forks
- 33
- Merge médio
- 2d 17h
- PRs com merge (30d)
- 18
Preparar o ambiente
- Sem Dockerfile nem arquivo Docker Compose
- Sem modelo de pull request
- Ler o guia de contribuição
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Mais de sysprog21/elfuse
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 64/100
Mantenedores costumam responder em até 2 dias
-
Dificuldade 1/5 Menos de uma hora Facilidade para iniciantes 80/100
Mantenedores costumam responder em até 2 dias
-
bug
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 86/100
Mantenedores costumam responder em até 2 dias
-
bug
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 72/100
Mantenedores costumam responder em até 2 dias
-
bug
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 75/100
Mantenedores costumam responder em até 2 dias
Todas as issues de sysprog21/elfuse
Issues semelhantes
-
issue: bug report
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 74/100
Mantenedores costumam responder em até 2 dias
-
Dificuldade 1/5 1-3 horas Facilidade para iniciantes 88/100
BasedHardware/omi#26486 ·
Mantenedores costumam responder em até 1 dia
-
The LLVM object can build before collection_config.h is generatedTalvez já em andamento @Vonng assumiu hoje. Aberta
Dificuldade 1/5 Menos de uma hora Facilidade para iniciantes 90/100
aws/pgcollection#51 ·
-
area/docdb kind/failing-test priority/medium status/awaiting-triage
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 82/100
yugabyte/yugabyte-db#39462 ·
Mantenedores costumam responder em até 1 dia
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 70/100
libreswan/libreswan#3185 · 1 comentário ·
Mantenedores costumam responder em até 1 dia