Hacker News new | ask | show | jobs
by dozzie 3348 days ago
...unless something else holds a pointer to the handle you're swapping with.
2 comments

This is already a problem if you're removing an item, regardless of whether it's done with swap remove or not.
For the item you're removing, you are presumably removing it because all handles have been closed. But the item you're potentially swapping with may certainly have open handles.
True.
kernels don't tend to give userspace raw pointers into kernel memory
But kernels tend to give raw pointers to other kernel code.
a good chunk of the fun in kernel code is maintaining the various layers of self-referential lists and dealing with the cleanup