Bug 187421

Summary: /sys/fs/fuse/connections not available after returning from its initialization function
Product: File System Reporter: Michael Biebl (biebl)
Component: OtherAssignee: fs_other
Status: NEW ---    
Severity: normal    
Priority: P1    
Hardware: x86-64   
OS: Linux   
Kernel Version: 4.8.5 Subsystem:
Regression: No Bisected commit-id:

Description Michael Biebl 2016-11-10 22:55:29 UTC
This is on Debian unstable, uname -a
Linux pluto 4.8.0-1-amd64 #1 SMP Debian 4.8.5-1 (2016-10-28) x86_64 GNU/Linux

I've originally reported this as https://github.com/systemd/systemd/issues/4574 and was told to file it as a kernel bug.

I have the following udev rule /etc/udev/rules.d/60-fuse.rules:

ACTION=="add", SUBSYSTEM=="module", KERNEL=="fuse", RUN+="/usr/local/bin/fuse-log.sh"

The shell script is /usr/local/bin/fuse-log.sh:

#!/bin/sh

LOG=/run/log-fuse.txt
SLEEP=0
sleep $SLEEP 
if [ -d /sys/fs/fuse/connections ] ; then
	echo "$(date) : /sys/fs/fuse/connections found after sleep $SLEEP" >> $LOG
else
	echo "$(date) : no /sys/fs/fuse/connections found after sleep $SLEEP" >> $LOG
fi


Without a sleep, /sys/fs/fuse/connections is not available. Adding a sleep of .1 or higher, the directory is available.

Thu Nov 10 23:42:10 CET 2016 : no /sys/fs/fuse/connections found after sleep 0
Thu Nov 10 23:42:29 CET 2016 : /sys/fs/fuse/connections found after sleep .1


The /sys/fs/fuse/connections directory should be setup, before the fuse module returns from it's initialization function. Otherwise it breaks userspace which tries to react on this, like say systemd, which tries to run
SUBSYSTEM=="module", KERNEL=="fuse", TAG+="systemd", ENV{SYSTEMD_WANTS}+="sys-fs-fuse-connections.mount" 
to mount the fusectl filesystem.