From: Jérémie Galarneau Date: Wed, 29 Jan 2020 04:53:49 +0000 (-0500) Subject: fd-tracker: restore suspended handles from their inode's path X-Git-Tag: v2.12.0-rc1~37 X-Git-Url: https://git.lttng.org/?p=lttng-tools.git;a=commitdiff_plain;h=f7c3ffd79ddcece895eb0de616001d549aced5fc;hp=f7c3ffd79ddcece895eb0de616001d549aced5fc fd-tracker: restore suspended handles from their inode's path In order to support session rotations and, to a lesser degree, the "clear" command, the fd-tracker internals (lttng_inode and fs_handle) need to recover from files being renamed while the handle to it is suspended. This refactor introduces a "location" to the lttng_inode which is updated anytime an unlink or rename is performed on an fs_handle. Keep in mind that multiple independent fs_handles can refer to the same lttng_inode (a unique tuple of device id and inode number). This location is used to restore the fs_handle whenever it is needed. Moreover, since the session rotation/clear operations sometimes rely on directories having been emptied after rename/unlink, the current scheme of renaming unlinked files to the form "filename-deleted-suffix" no longer works. The renaming scheme is replaced by a new "unlinked file pool", which is an hidden directory at the base of the output directory which contains the files which were unlinked to which references (fs_handles) are still being held. The API of the fd-tracker itself had to be changed slightly and the tests are adapted as a consequence. New tests targeting this new behaviour are also added. Signed-off-by: Jérémie Galarneau Change-Id: I9b1344da1966c85bdd6b51838507d3208e1d9a42 ---