[systemd-devel] [PATCH RFC] swap: use aliases to group swap units for same device

jjacky i.am.jack.mail at gmail.com
Fri Oct 19 05:39:23 PDT 2012



On 10/19/12 11:24, Zbigniew Jędrzejewski-Szmek wrote:
> On Fri, Oct 19, 2012 at 10:06:03AM +0100, Colin Guthrie wrote:
>> 'Twas brillig, and Zbigniew Jędrzejewski-Szmek at 18/10/12 23:56 did
>> gyre and gimble:
>>> A series of .swap units "following" one another are replaced with a
>>> single unit with multiple names.
>>>
>>> The idea is to simplify things for the user: only one swap unit per
>>> swap area. It shouldn't matter whether the swap area was activated by
>>> systemd or by direct swapon invocation. The kernel name (from
>>> /proc/swaps) is preferred, but if swap is configured through a unit
>>> file and not active, that name will be used instead.
>>>
>>> The case where a swap unit refers (What=) to a symlink should behave
>>> better than before.
>>>
>>> Note: this patch is goes on top of some cleanup patches that are
>>> pretty boring and thus I'm not posting them, so it might not apply
>>> cleanly.
>>>
>>> ---
>>> Hi,
>>> another RFC. Comments appreciated.
>>>
>>> I think that this change will simplify swap unit handling. I've been
>>> running with it for some time, and things seem to work. Systemclt
>>> output is definitely simpler: just one line.
>>
>>
>> I've not reviewed the patch, but I figured it would be worth
>> highlighting Olivier Brunel's patch from the 13th October "[PATCH] Fix
>> starting swap unit on symlink made it unstoppable".
>>
>> I presume your patch would fix this same problem but in a different way?
> It goes further than his patch, by treating all names for a swap
> device as equivalent, including the name from /proc/swaps.
> 
> Olivier is in CC, I hope he can test that this patch also works for him.

Yes, took a little work to apply, but I've just tried it and it works
perfectly fine. All troubles I had linked to symlinks are also fixed
with this patch.

Thanks,
-j

> 
> Cheers,
> Zbyszek
> 


More information about the systemd-devel mailing list