[systemd-devel] Swap gets activated twice (through fstab and gpt generators)

Lennart Poettering lennart at poettering.net
Tue Jan 27 16:03:09 PST 2015


On Tue, 27.01.15 23:48, Lennart Poettering (lennart at poettering.net) wrote:

> > That said, it would of course be nicer if we wouldn't have to
> > serialize here...
> 
> Another idea might be to simply accept that activating the swap by two
> names at the same time can happen concurrently, and teach mkswap in
> some way to handle this gracefully.
> 
> For example, mkswap could learn a new switch --idempotent or so, which
> we could always pass from systemd. If set and if activating the swap
> fails with EBUSY because the swap is already activated it would eat
> that up and return success. 

I implemented a different logic now:

http://cgit.freedesktop.org/systemd/systemd/commit/?id=37cf8fee46025d704660a9fc1d1349fe7d0b139d

With this change we'll now dispatch only one mkswap per device node,
regardless which symlinked alias is used to refer to it. I have only
given this very light testing, and I am not sure this solves the
original problem you reported, hence I'd be thankful if you could
check if this makes the problem go away.

Lennart

-- 
Lennart Poettering, Red Hat


More information about the systemd-devel mailing list