Mount point not auto unmounted after system date/time change

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

A auto mounted directory won't be automatically unmounted after a
system date/time change, for example we can reproduce the issue with
below steps in 100% failrate:

$ cat /etc/auto.master
/mnt /etc/auto.misc

$ cat /etc/auto.misc
removable -fstype=auto :/dev/sdb1

### now plugin a usb pendrive

$ cd /mnt/removable
$ sudo date -s "+1 year"
$ sleep 1
$ sudo date -s "-1 year"
$ cd

Now /mnt/removable will not be automatically unmounted, the root cause
is that autofs uses gettimeofday() to identify the timestamp and
calculate the delta for timeouts, however as mentioned in the manpage:

```
NOTES
       The time returned by gettimeofday() is affected by discontinuous jumps
       in the system time (e.g., if the system administrator manually changes
       the system time).  If you need a monotonically increasing  clock,  see
       clock_gettime(2).
```

So in the above reproducer autofs will wait for a one-year-long
timeout to unmount /mnt/removable.

BR
Ning
--
To unsubscribe from this list: send the line "unsubscribe autofs" in



[Index of Archives]     [Linux Filesystem Development]     [Linux Ext4]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux