summaryrefslogtreecommitdiffstats
path: root/src/shutdown
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2021-10-15 17:58:13 +0200
committerLennart Poettering <lennart@poettering.net>2021-10-16 10:11:15 +0200
commit48f462547d63e1d03bee612e1c77073263e71293 (patch)
treea9578347ec7a53458cda8d67de54e52fef43edf9 /src/shutdown
parentuserdb: fix type to pass to connect() (diff)
downloadsystemd-48f462547d63e1d03bee612e1c77073263e71293.tar.xz
systemd-48f462547d63e1d03bee612e1c77073263e71293.zip
homed,shutdown: call valgrind magic after LOOP_GET_STATUS64
valgrind doesn't understand LOOP_GET_STATUS64. We already work around this in various placed, via VALGRIND_MAKE_MEM_DEFINE(), but we forgot three places. Let's fix that.
Diffstat (limited to 'src/shutdown')
-rw-r--r--src/shutdown/umount.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/shutdown/umount.c b/src/shutdown/umount.c
index 09fc339ab1..881d4e471e 100644
--- a/src/shutdown/umount.c
+++ b/src/shutdown/umount.c
@@ -15,6 +15,10 @@
#include <sys/types.h>
#include <unistd.h>
+#if HAVE_VALGRIND_MEMCHECK_H
+#include <valgrind/memcheck.h>
+#endif
+
#include "sd-device.h"
#include "alloc-util.h"
@@ -409,6 +413,10 @@ static int delete_loopback(const char *device) {
return -EBUSY; /* propagate original error */
}
+#if HAVE_VALGRIND_MEMCHECK_H
+ VALGRIND_MAKE_MEM_DEFINED(&info, sizeof(info));
+#endif
+
if (FLAGS_SET(info.lo_flags, LO_FLAGS_AUTOCLEAR)) /* someone else already set LO_FLAGS_AUTOCLEAR for us? fine by us */
return -EBUSY; /* propagate original error */
@@ -434,6 +442,10 @@ static int delete_loopback(const char *device) {
return 1;
}
+#if HAVE_VALGRIND_MEMCHECK_H
+ VALGRIND_MAKE_MEM_DEFINED(&info, sizeof(info));
+#endif
+
/* Linux makes LOOP_CLR_FD succeed whenever LO_FLAGS_AUTOCLEAR is set without actually doing
* anything. Very confusing. Let's hence not claim we did anything in this case. */
if (FLAGS_SET(info.lo_flags, LO_FLAGS_AUTOCLEAR))