A folder whose `statfs()` is pending blocks opening its sibling folders and its parent
Los mantenedores suelen responder en 2 días
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 48/100
Línea de trabajo
Start with filesystem_info_start() and start_or_stop_io() in libnemo-private/nemo-directory-async.c to see how the per-directory statfs query and the low-priority queue serialize siblings. Then read load_directory() in src/nemo-view.c where NEMO_FILE_ATTRIBUTE_FILESYSTEM_INFO is awaited for the folder and its loaded subfolders. Reproduce with the provided FUSE helper and confirm that only the slow folder waits while its sibling and parent open; no test file is named in the payload.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Distribution
Linux Mint 22.3
Package version
6.6.3
Frequency
Always
Bug description
While the filesystem info query (statfs()) for one folder is pending, Nemo doesn't open that folder's siblings or its parent. When the query returns, all the pending windows appear at once. Folders elsewhere open normally in the meantime, and the UI stays responsive.
I ran into it with an rclone mount on my Desktop. After a network change its statfs() took 5 minutes to answer. For those 5 minutes the folders on the desktop wouldn't open, the mount among them, and a Nemo window wouldn't show the Desktop folder either. Then they all opened together.
Steps to reproduce
- Save this as
slowstatfs.c. It is an empty FUSE filesystem where onlystatfs()is slow:
slowstatfs.c
/* Empty FUSE filesystem where only statfs() is slow.
* gcc slowstatfs.c -o slowstatfs $(pkg-config fuse3 --cflags --libs)
* SLOW=120 ./slowstatfs <mountpoint>
*/
#define FUSE_USE_VERSION 31
#include <fuse.h>
#include <errno.h>
#include <stdlib.h>
#include <string.h>
#include <sys/stat.h>
#include <unistd.h>
static int slow_getattr(const char *path, struct stat *st, struct fuse_file_info *fi)
{
if (strcmp(path, "/") != 0)
return -ENOENT;
memset(st, 0, sizeof *st);
st->st_mode = S_IFDIR | 0755;
st->st_nlink = 2;
return 0;
}
static int slow_readdir(const char *path, void *buf, fuse_fill_dir_t fill, off_t off,
struct fuse_file_info *fi, enum fuse_readdir_flags flags)
{
fill(buf, ".", NULL, 0, 0);
fill(buf, "..", NULL, 0, 0);
return 0;
}
static int slow_statfs(const char *path, struct statvfs *st)
{
sleep(atoi(getenv("SLOW") ? getenv("SLOW") : "120"));
memset(st, 0, sizeof *st);
st->f_bsize = st->f_frsize = 4096;
st->f_namemax = 255;
return 0;
}
static const struct fuse_operations ops = {
.getattr = slow_getattr,
.readdir = slow_readdir,
.statfs = slow_statfs,
};
int main(int argc, char *argv[])
{
return fuse_main(argc, argv, &ops, NULL);
}
- Build and mount it (needs
libfuse3-dev):
gcc slowstatfs.c -o slowstatfs $(pkg-config fuse3 --cflags --libs)
mkdir -p ~/statfs-test/slow ~/statfs-test/a ~/other-test
SLOW=60 ./slowstatfs ~/statfs-test/slow
- Open the folders, a few seconds apart:
nemo ~/statfs-test/slow & # no window
nemo ~/statfs-test/a & # sibling: no window
nemo ~/statfs-test & # parent: no window
nemo ~/other-test & # unrelated folder: opens right away
About 60 s after the first command, the three missing windows appear at once. ls -la ~/statfs-test and stat ~/statfs-test/slow are instant the whole time.
- Unmount with
fusermount3 -uz ~/statfs-test/slow.
Expected behavior
Only the folder whose query is pending should have to wait. Its siblings and its parent should open normally.
Additional information
Time after the first command at which each window appeared, in seconds. The commands were run at 0, 5, 8 and 11 s. Both versions were built from source on Ubuntu 24.04, master at 7df652f:
| Command | 6.6.3 | master |
|---|---|---|
nemo ~/statfs-test/slow (0 s) |
62.5 | 60.7 |
nemo ~/statfs-test/a (5 s) |
62.5 | 60.7 |
nemo ~/statfs-test (8 s) |
62.5 | 60.7 |
nemo ~/other-test (11 s) |
11.4 | 11.2 |
While it waits, Nemo has one thread inside statfs() and its main thread is idle in poll(). strace -f -tt -e trace=statfs on 6.6.3 shows that the sibling's query isn't sent until the slow one returns, and that the parent's own query is answered at once (other calls omitted, PID column dropped, paths shortened, results elided):
06:36:10.081962 statfs("~/statfs-test/slow", <unfinished ...>
06:36:15.872210 statfs("~/statfs-test", {...}) = 0
06:37:10.082529 <... statfs resumed>{...}) = 0
06:37:10.085034 statfs("~/statfs-test/a", {...}) = 0
Two things in the code seem to combine:
filesystem_info_start()runs one query per directory at a time, and while one is pendingstart_or_stop_io()stops at the first file in the low priority queue. That holds back the sibling, whose query goes through the queue of the same parent directory.load_directory()waits forNEMO_FILE_ATTRIBUTE_FILESYSTEM_INFOon the folder and on the subfolders Nemo already has loaded in it before the view finishes loading. That holds back the parent: if I drop that attribute from thenemo_directory_call_when_ready()call, the parent opens right away while the sibling still waits.
This is a different path from the sidebar's synchronous disk space queries behind #3764, which froze the whole window and were removed in a7c6f70893cbf81b5b7ce667a2da185f3618245f. Here the UI keeps working, and master, which has that commit, behaves the same as 6.6.3.
- Lenguaje dominante
- C
- Estrellas
- 1.6k
- Forks
- 387
- Merge medio
- 2 d 19 h
- PR fusionados (30 d)
- 4
Preparar el entorno
Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.
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 linuxmint/nemo
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
Los mantenedores suelen responder en 2 días
-
Copy dialog: Enter key accidentally cancels file copyPosiblemente ocupada @jackjusko la tomó hace 3 días. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
Los mantenedores suelen responder en 2 días
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 74/100
linuxmint/nemo#3838 · 1 comentario · 2 reacciones ·
Los mantenedores suelen responder en 2 días
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
Los mantenedores suelen responder en 2 días
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
linuxmint/nemo#3805 · 2 comentarios · 1 reacción ·
Los mantenedores suelen responder en 2 días
Todos los issues de linuxmint/nemo
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 74/100
389ds/389-ds-base#8152 ·
Los mantenedores suelen responder en 2 días
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
Los mantenedores suelen responder en 1 día
-
isolation2 lockmodes fails on cassert builds: extra AccessShareLock on partition rootPosiblemente ocupada @tuhaihe la tomó hoy. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
apache/cloudberry#2356 ·
Los mantenedores suelen responder en 2 días
-
windows-artifacts: the win-arm64 job uses a Visual Studio generator missing from windows-11-armAbierto
Dificultad 1/5 Menos de una hora Aptitud para principiantes 86/100
-
documentation
Dificultad 1/5 Menos de una hora Aptitud para principiantes 91/100