xlog: fix xdir_say_gc() usage in xdir_collect_garbage()
xdir_say_gc() takes errno and return code of unlink() sys call. If RC is negative (meaning that unlink failed) we reset errno to given value and log corresponding error message (it is done this way since eio saves errno to internal structure so we have to restore it manually). Before this patch, unlink() call was "in-place" of argument. However, the order of argument evaluation is unspecified. So it may turn out that we assign errno to the previous value, which is obviously wrong. To fix it let's firstly invoke unlink() and then pass the result of call to xdir_say_gc().
Loading
Please register or sign in to comment