All of lore.kernel.org
 help / color / mirror / Atom feed
* Leaking btrfs_qgroup_inherit on snapshot creation?
@ 2013-02-06 11:18 Alex Lyakas
  2013-02-06 12:14 ` Arne Jansen
  0 siblings, 1 reply; 3+ messages in thread
From: Alex Lyakas @ 2013-02-06 11:18 UTC (permalink / raw)
  To: Jan Schmidt, Arne Jansen, linux-btrfs; +Cc: Lev Vainblat

Hi Jan, Arne,
I see this code in create_snapshot:

	if (inherit) {
		pending_snapshot->inherit = *inherit;
		*inherit = NULL;	/* take responsibility to free it */
	}

So, first thing I think it should be:
if (*inherit)
because in btrfs_ioctl_snap_create_v2() we have:
struct btrfs_qgroup_inherit *inherit = NULL;
...
btrfs_ioctl_snap_create_transid(..., &inherit)

so the current check is very unlikely to be NULL.

Second, I don't see anybody freeing pending_snapshot->inherit. I guess
it should be freed after callin btrfs_qgroup_inherit() and also in
btrfs_destroy_pending_snapshots().

Thanks,
Alex.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2013-02-07  5:09 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-02-06 11:18 Leaking btrfs_qgroup_inherit on snapshot creation? Alex Lyakas
2013-02-06 12:14 ` Arne Jansen
2013-02-07  5:10   ` Miao Xie

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.