On Thu, Jun 27, 2024 at 01:24:48PM GMT, Josef Bacik wrote: > On Thu, Jun 27, 2024 at 04:11:39PM +0200, Christian Brauner wrote: > > Add a helper that returns the file descriptor and ensures that the old > > variable contains a negative value. This makes it easy to rely on > > CLASS(get_unused_fd). > > > > Can we get an extra bit of explanation here, because I had to go read a bunch of > code to figure out what exactly was happening here. Something like > > This makes it easy to rely on CLASS(get_unused_fd) for success, as the fd will > be returned and the cleanup will not occur. Yes, absolutely.