aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2018-12-19 11:32:17 +0100
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2018-12-19 11:32:17 +0100
commite36db5007517698ea07e9e506fcc0fd68820f714 (patch)
treea2dd8d77b55ed2d5482f1484ac5f4dca99cb63a3
parentmount: disable mount-storm protection while mount unit is starting. (diff)
downloadsystemd-e36db5007517698ea07e9e506fcc0fd68820f714.tar.gz
systemd-e36db5007517698ea07e9e506fcc0fd68820f714.tar.bz2
systemd-e36db5007517698ea07e9e506fcc0fd68820f714.zip
Revert "mount: disable mount-storm protection while mount unit is starting."
This reverts commit fcfb1f775ed0e9d282607bb118ba788b98952855.
-rw-r--r--src/core/manager.h1
-rw-r--r--src/core/mount.c25
2 files changed, 1 insertions, 25 deletions
diff --git a/src/core/manager.h b/src/core/manager.h
index 18219a184..9f8fc4643 100644
--- a/src/core/manager.h
+++ b/src/core/manager.h
@@ -230,7 +230,6 @@ struct Manager {
sd_event_source *mount_timeout_source;
usec_t mount_last_read_usec;
usec_t mount_last_duration_usec;
- unsigned mount_pending_count;
/* Data specific to the swap filesystem */
FILE *proc_swaps;
diff --git a/src/core/mount.c b/src/core/mount.c
index 823024b41..cfdcc6e6f 100644
--- a/src/core/mount.c
+++ b/src/core/mount.c
@@ -218,12 +218,6 @@ static void mount_done(Unit *u) {
assert(m);
- if (!IN_SET(m->state, MOUNT_DEAD, MOUNT_MOUNTED, MOUNT_FAILED)) {
- /* This was pending, so need to udpate the count */
- assert(u->manager->mount_pending_count > 0);
- u->manager->mount_pending_count--;
- }
-
m->where = mfree(m->where);
mount_parameters_done(&m->parameters_proc_self_mountinfo);
@@ -656,7 +650,6 @@ static int mount_load(Unit *u) {
static void mount_set_state(Mount *m, MountState state) {
MountState old_state;
- int was_pending, is_pending;
assert(m);
if (m->state != state)
@@ -665,17 +658,6 @@ static void mount_set_state(Mount *m, MountState state) {
old_state = m->state;
m->state = state;
- was_pending = !IN_SET(old_state, MOUNT_DEAD, MOUNT_MOUNTED, MOUNT_FAILED);
- is_pending = !IN_SET(state, MOUNT_DEAD, MOUNT_MOUNTED, MOUNT_FAILED);
-
- if (was_pending && !is_pending) {
- assert(UNIT(m)->manager->mount_pending_count > 0);
- UNIT(m)->manager->mount_pending_count--;
- }
-
- if (is_pending && !was_pending)
- UNIT(m)->manager->mount_pending_count++;
-
if (!MOUNT_STATE_WITH_PROCESS(state)) {
m->timer_event_source = sd_event_source_unref(m->timer_event_source);
mount_unwatch_control_pid(m);
@@ -1808,12 +1790,7 @@ static int mount_dispatch_io(sd_event_source *source, int fd, uint32_t revents,
usec_t next_read = usec_add(m->mount_last_read_usec,
m->mount_last_duration_usec * 10);
- /* If there are pending mounts initiated by systemd, then
- * we need to process changes promptly, otherwise we
- * rate limit re-reading the file.
- */
- if (m->mount_pending_count == 0 &&
- now(CLOCK_MONOTONIC) < next_read) {
+ if (now(CLOCK_MONOTONIC) < next_read) {
/* The (current) API for getting mount events from the Linux kernel
* involves getting a "something changed" notification, and then having
* to re-read the entire /proc/self/mountinfo file. When there are lots