[lttng-dev] [PATCH lttng-tools 2/2] Clean-up shm directory tree after freeing the channel
Jérémie Galarneau
jeremie.galarneau at efficios.com
Thu Mar 24 19:15:59 UTC 2016
Merged in master, stable-2.8 and stable-2.7, thanks!
I'll wait for a v2 of the first patch.
Jérémie
On Fri, Mar 18, 2016 at 1:20 PM, Jonathan Rajotte
<jonathan.rajotte-julien at efficios.com> wrote:
> On NFS an unlinked file that is still mmaped or unclosed is kept around
> by creating a .nfsXXXX file since an unlinked file can still be used.[1]
>
> This prevent the effective cleanup of the shm tree directory because it happens
> before the userspace consumer shm handles table cleanup [2].
>
> Moving the tree removal to lttng_ustconsumer_free_channel ensure that the
> cleanup is done when the files are considered completely closed/unmapped.
>
> [1] http://nfs.sourceforge.net/ Look for "silly rename"
> [2] See channel_free subcall to shm_object_table_destroy
>
> Signed-off-by: Jonathan Rajotte <jonathan.rajotte-julien at efficios.com>
> ---
> src/common/ust-consumer/ust-consumer.c | 10 +++++-----
> 1 file changed, 5 insertions(+), 5 deletions(-)
>
> diff --git a/src/common/ust-consumer/ust-consumer.c b/src/common/ust-consumer/ust-consumer.c
> index fe7445b..a113ef1 100644
> --- a/src/common/ust-consumer/ust-consumer.c
> +++ b/src/common/ust-consumer/ust-consumer.c
> @@ -1985,11 +1985,6 @@ void lttng_ustconsumer_del_channel(struct lttng_consumer_channel *chan)
> }
> }
> }
> - /* Try to rmdir all directories under shm_path root. */
> - if (chan->root_shm_path[0]) {
> - (void) run_as_recursive_rmdir(chan->root_shm_path,
> - chan->uid, chan->gid);
> - }
> }
>
> void lttng_ustconsumer_free_channel(struct lttng_consumer_channel *chan)
> @@ -1999,6 +1994,11 @@ void lttng_ustconsumer_free_channel(struct lttng_consumer_channel *chan)
>
> consumer_metadata_cache_destroy(chan);
> ustctl_destroy_channel(chan->uchan);
> + /* Try to rmdir all directories under shm_path root. */
> + if (chan->root_shm_path[0]) {
> + (void) run_as_recursive_rmdir(chan->root_shm_path,
> + chan->uid, chan->gid);
> + }
> free(chan->stream_fds);
> }
>
> --
> 2.7.0
>
--
Jérémie Galarneau
EfficiOS Inc.
http://www.efficios.com
More information about the lttng-dev
mailing list