diff options
author | Lennart Poettering <lennart@poettering.net> | 2021-04-20 10:56:38 +0200 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2021-04-20 17:13:56 +0200 |
commit | 31c75fcc415056e7ded80136547fd4658fa554f7 (patch) | |
tree | d627f630f2d8a68f3bd99ce1f288ee290bc33856 /src/shared/loop-util.h | |
parent | 79e8393a6acb0115c6b8995db6ddbf4215d0851c (diff) | |
download | systemd-31c75fcc415056e7ded80136547fd4658fa554f7.tar.gz |
loop-util: read kernel's uevent seqnum right before attaching a loopback device
Later, this will allow us to ignore uevents from earlier attachments a
bit better, as we can compare uevent seqnums with this boundary. It's
not a full fix for the race though, since we cannot atomically determine
the uevent and attach the device, but it at least shortens the window a
bit.
Diffstat (limited to 'src/shared/loop-util.h')
-rw-r--r-- | src/shared/loop-util.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/shared/loop-util.h b/src/shared/loop-util.h index 619b34716b..6df4f91c22 100644 --- a/src/shared/loop-util.h +++ b/src/shared/loop-util.h @@ -13,6 +13,7 @@ struct LoopDevice { dev_t devno; char *node; bool relinquished; + uint64_t uevent_seqnum_not_before; /* uevent sequm right before we attached the loopback device, or UINT64_MAX if we don't know */ }; int loop_device_make(int fd, int open_flags, uint64_t offset, uint64_t size, uint32_t loop_flags, LoopDevice **ret); |