To make swapon -E work with geli detach-on-last-close, don't close the trimming fd until after swapon(2) is invoked.
Details
Details
Ask reviewers to confirm that it fixes geli, and doesn't break swapon trimming for anyone else.
Diff Detail
Diff Detail
- Lint
Lint Skipped - Unit
Tests Skipped
Event Timeline
Comment Actions
Probably not safe to start trimming the swap device *after* the kernel has been told to start using it for swapping (even if the window is probably small).
Comment Actions
Works here. This is cleaner than what I was doing for sure. Got a typo though, it's "Eflag" not "Eflags".
sbin/swapon/swapon.c | ||
---|---|---|
765 | I think a comment explaining why this function handles both trimming and swapon would be appropriate. |