All of lore.kernel.org
 help / color / mirror / Atom feed
* Mount point not auto unmounted after system date/time change
@ 2015-09-16  8:29 Ning Yu
  2015-09-16  8:45 ` Ning Yu
  0 siblings, 1 reply; 32+ messages in thread
From: Ning Yu @ 2015-09-16  8:29 UTC (permalink / raw)
  To: autofs

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

^ permalink raw reply	[flat|nested] 32+ messages in thread

end of thread, other threads:[~2015-09-18  7:20 UTC | newest]

Thread overview: 32+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-09-16  8:29 Mount point not auto unmounted after system date/time change Ning Yu
2015-09-16  8:45 ` Ning Yu
2015-09-16  9:16   ` Ian Kent
2015-09-16 10:28     ` Ning Yu
2015-09-16 10:43       ` Ian Kent
2015-09-16 11:02         ` Ning Yu
2015-09-16 11:21           ` Ian Kent
2015-09-17  3:48             ` [PATCH v3 1/3] autofs-5.1.1 - use clock_gettime() instead of gettimeofday() Yu Ning
2015-09-17  3:48               ` [PATCH v3 2/3] autofs-5.1.1 - use monotonic clock for pthread cond timed wait Yu Ning
2015-09-17  6:49                 ` Ian Kent
2015-09-17  7:19                   ` Ning Yu
2015-09-17  8:39                     ` Ian Kent
2015-09-17  9:12                       ` Ning Yu
2015-09-18  1:36                         ` Ian Kent
2015-09-18  7:16                           ` [PATCH v5 1/3] autofs-5.1.1 - use clock_gettime() instead of gettimeofday() Yu Ning
2015-09-18  7:16                             ` [PATCH v5 2/3] autofs-5.1.1 - use monotonic clock for pthread cond timed wait Yu Ning
2015-09-18  7:16                             ` [PATCH v5 3/3] autofs-5.1.1 - use monotonic clock instead of time() Yu Ning
2015-09-18  7:20                           ` [PATCH v3 2/3] autofs-5.1.1 - use monotonic clock for pthread cond timed wait Ning Yu
2015-09-17  3:48               ` [PATCH v3 3/3] autofs-5.1.1 - use monotonic clock instead of time() Yu Ning
2015-09-17  7:04                 ` Ian Kent
2015-09-17  7:16                   ` Ian Kent
2015-09-17  7:34                     ` Ning Yu
2015-09-17  4:02             ` Mount point not auto unmounted after system date/time change Ning Yu
2015-09-17  4:09               ` [PATCH v4 1/3] autofs-5.1.1 - use clock_gettime() instead of gettimeofday() Yu Ning
2015-09-17  4:09                 ` [PATCH v4 2/3] autofs-5.1.1 - use monotonic clock for pthread cond timed wait Yu Ning
2015-09-17  4:09                 ` [PATCH v4 3/3] autofs-5.1.1 - use monotonic clock instead of time() Yu Ning
2015-09-17  4:17               ` Mount point not auto unmounted after system date/time change Ning Yu
2015-09-17  6:07                 ` Ian Kent
2015-09-17  6:05               ` Ian Kent
2015-09-16 10:30     ` Ning Yu
2015-09-16 10:30     ` Ning Yu
2015-09-16 10:30     ` Ning Yu

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.