[dm-devel] [PATCH] dm-snap-persistent-fix-dtr-cleanup.patch

Alasdair G Kergon agk at redhat.com
Thu Mar 19 22:42:31 UTC 2009


On Wed, Mar 04, 2009 at 03:33:56PM -0600, Jon Brassow wrote:
> @@ -481,10 +484,17 @@ static void persistent_dtr(struct dm_exc
>  {
>  	struct pstore *ps = get_info(store);
>  
> -	destroy_workqueue(ps->metadata_wq);
> -	dm_io_client_destroy(ps->io_client);
> -	vfree(ps->callbacks);
> +	/* Created in read_header */
> +	if (ps->io_client)
> +		dm_io_client_destroy(ps->io_client);
>  	free_area(ps);
> +
> +	/* Allocated in persistent_read_metadata */
> +	if (ps->callbacks)
> +		vfree(ps->callbacks);
> +
> +	/* Don't need to check these, because they are done in ctr */
> +	destroy_workqueue(ps->metadata_wq);
>  	kfree(ps);
>  }
  
I presume it's safe to reorder those operations as the workqueue is
guaranteed to be empty?  It needs an inline comment though.
(Or can we just keep the original, logical, order?)

Alasdair
-- 
agk at redhat.com




More information about the dm-devel mailing list