summaryrefslogtreecommitdiff
path: root/src/home
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2020-09-22 16:32:07 +0200
committerLennart Poettering <lennart@poettering.net>2020-09-23 18:57:36 +0200
commit30f5d10421e6b1a22cf5d707a9c90c32914bce6b (patch)
treee12688a4e9874039917ada0f25159f7b0f7aeb30 /src/home
parent511a8cfe300662963522cea314e3b2426fc2f3ee (diff)
downloadsystemd-30f5d10421e6b1a22cf5d707a9c90c32914bce6b.tar.gz
mount-util: rework umount_verbose() to take log level and flags arg
Let's make umount_verbose() more like mount_verbose_xyz(), i.e. take log level and flags param. In particular the latter matters, since we typically don't actually want to follow symlinks when unmounting.
Diffstat (limited to 'src/home')
-rw-r--r--src/home/homework-directory.c2
-rw-r--r--src/home/homework-luks.c8
-rw-r--r--src/home/homework-mount.c2
-rw-r--r--src/home/homework.c2
4 files changed, 7 insertions, 7 deletions
diff --git a/src/home/homework-directory.c b/src/home/homework-directory.c
index 49660c7389..bffeac0a5e 100644
--- a/src/home/homework-directory.c
+++ b/src/home/homework-directory.c
@@ -67,7 +67,7 @@ int home_activate_directory(
r = mount_nofollow_verbose(LOG_ERR, NULL, hd, NULL, MS_BIND|MS_REMOUNT|user_record_mount_flags(h), NULL);
if (r < 0) {
- (void) umount_verbose(hd);
+ (void) umount_verbose(LOG_ERR, hd, UMOUNT_NOFOLLOW);
return r;
}
diff --git a/src/home/homework-luks.c b/src/home/homework-luks.c
index f13f41e612..947a559c26 100644
--- a/src/home/homework-luks.c
+++ b/src/home/homework-luks.c
@@ -1259,7 +1259,7 @@ int home_prepare_luks(
fail:
if (mounted)
- (void) umount_verbose("/run/systemd/user-home-mount");
+ (void) umount_verbose(LOG_ERR, "/run/systemd/user-home-mount", UMOUNT_NOFOLLOW);
if (dm_activated)
(void) crypt_deactivate(cd, setup->dm_name);
@@ -2168,7 +2168,7 @@ int home_create_luks(
root_fd = safe_close(root_fd);
- r = umount_verbose("/run/systemd/user-home-mount");
+ r = umount_verbose(LOG_ERR, "/run/systemd/user-home-mount", UMOUNT_NOFOLLOW);
if (r < 0)
goto fail;
@@ -2238,7 +2238,7 @@ fail:
root_fd = safe_close(root_fd);
if (mounted)
- (void) umount_verbose("/run/systemd/user-home-mount");
+ (void) umount_verbose(LOG_WARNING, "/run/systemd/user-home-mount", UMOUNT_NOFOLLOW);
if (dm_activated)
(void) crypt_deactivate(cd, dm_name);
@@ -2340,7 +2340,7 @@ static int ext4_offline_resize_fs(HomeSetup *setup, uint64_t new_size, bool disc
}
if (setup->undo_mount) {
- r = umount_verbose("/run/systemd/user-home-mount");
+ r = umount_verbose(LOG_ERR, "/run/systemd/user-home-mount", UMOUNT_NOFOLLOW);
if (r < 0)
return r;
diff --git a/src/home/homework-mount.c b/src/home/homework-mount.c
index 7c94de49cc..853181b80d 100644
--- a/src/home/homework-mount.c
+++ b/src/home/homework-mount.c
@@ -87,7 +87,7 @@ int home_move_mount(const char *user_name_and_realm, const char *target) {
if (r < 0)
return r;
- r = umount_verbose("/run/systemd/user-home-mount");
+ r = umount_verbose(LOG_ERR, "/run/systemd/user-home-mount", UMOUNT_NOFOLLOW);
if (r < 0)
return r;
diff --git a/src/home/homework.c b/src/home/homework.c
index 986ce2b3f0..14e2002c73 100644
--- a/src/home/homework.c
+++ b/src/home/homework.c
@@ -291,7 +291,7 @@ int home_setup_undo(HomeSetup *setup) {
}
if (setup->undo_mount) {
- q = umount_verbose("/run/systemd/user-home-mount");
+ q = umount_verbose(LOG_DEBUG, "/run/systemd/user-home-mount", UMOUNT_NOFOLLOW);
if (q < 0)
r = q;
}