-
-
Notifications
You must be signed in to change notification settings - Fork 64
Description
Is there an existing issue for this?
- I have searched the existing issues
Midnight Commander version and build configuration
4.8.33
Operating system
OpenSuse Tumbleweed with Kernel 6.18.7-1-defaultIs this issue reproducible using the latest version of Midnight Commander?
- I confirm the issue is still reproducible with the latest version of Midnight Commander
How to reproduce
cifs or sshfs mount to remote system, where exported tree is composed of multiple file systems (via mount points). I.e.:
/ (/dev/sda1 mounted)
/data
/data/d1 (/dev/sdb1 mounted)
/data/d2 (/dev/sdb2 mounted)
Use mc to traverse such mount and observe reported space usage info.
Note: nfs is not suitable for reproduction, because it allows only single fs per export, while reproduction needs multiple fs per export.
Expected behavior
Path dependent space usage reported, or in other words: space usage of fs where current dir resides on remote system is reported. Should coincide with what "df -h ." returns.
I.e. entering /data/d1 and /data/d2 should show space usage for /dev/sdb1 and /dev/sdb2 respectively.
Actual behavior
Space usage of fs where top of exported tree resides is always reported even when entering dir residing on different fs on remote system.
I.e. whenever /data/d1 or /data/d2 is entered, space usage for / (/dev/sda1) is always shown.
Additional context
In source: my_statfs(stats,path) loops over mount list and determines mount_dir for given path, then calls get_fs_usage(mount_dir,null,fs_use), which effectively feeds that mount_dir to statvfs() on POSIX system. This is why mc always queries fs on which top of exported tree resides.
At least on Linux, statvfs() accepts full path and then magic follows for such cases. So, trivial fix would be to pass path instead of mount_dir to get_fs_usage(). No, idea about other OSes though.