Hi
 
I have an application that is using the Linux "unshare" system calls (on RedHat 
5, or "clone" with CLONE_NEWNS), to allocate different volumes for different 
processes on the same mount point. This setup is used to allow multiple 
processes to run against different data sets, without having to change the code.

The 'df' command will report ALL the mount points of the system. I believe the 
order is based on the order of the mounts (first mounts listed first). For 
example, the system has '/home/ mounted from a file server, then few processes 
establish a local '/home/data' tree. For example:

$ df
Filesystem           1K-blocks      Used Available Use% Mounted on
/dev/sda2              8064304   1835928   5818720  24% /
/dev/sda1               101086     12178     83689  13% /boot
none                   4155280         0   4155280   0% /dev/shm
/dev/sda5             57874464  13076584  41857988  24% /home2
appnfs1:/home/dev    258144000  98499552 159644448  39% /home
/dist/2a             258144000  98499552 159644448  39% /home/data
/dist/5a             258144000  98499552 159644448  39% /home/data
/dist/7a             258144000  98499552 159644448  39% /home/data

The problem occur when typing 'df /home/data'. The output is:

$ df /home/data
Filesystem           1K-blocks      Used Available Use% Mounted on
/dist/2a             258144000  98499552 159644448  39% /home/data

This is very misleading (and probably wrong), as the /dist/data for the current 
process is on the "appnfs1" volume. It looks as the translation code that move 
from a path (e.g. /home/data), find the first match, regardless of the 
namespace associated for the current process. This logic cause few scripts to 
fail (e.g., we have a script that checked for free space, before attempting to 
upload large number of files).

Please let me know if you need additional information.

Thanks
Yair Lenga


Reply via email to