From: Ning Yu <ning.yu@canonical.com>
To: autofs <autofs@vger.kernel.org>
Subject: Mount point not auto unmounted after system date/time change
Date: Wed, 16 Sep 2015 16:29:00 +0800 [thread overview]
Message-ID: <CAA1QoHSyMHh9LoPwAM_Nto0iTVbvaVAFH2s-gCSrpYUX1zuPuQ@mail.gmail.com> (raw)
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
next reply other threads:[~2015-09-16 8:29 UTC|newest]
Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-09-16 8:29 Ning Yu [this message]
2015-09-16 8:45 ` Mount point not auto unmounted after system date/time change 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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CAA1QoHSyMHh9LoPwAM_Nto0iTVbvaVAFH2s-gCSrpYUX1zuPuQ@mail.gmail.com \
--to=ning.yu@canonical.com \
--cc=autofs@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).