All of lore.kernel.org
 help / color / mirror / Atom feed
From: Kiyoshi Ueda <k-ueda@ct.jp.nec.com>
To: Alasdair G Kergon <agk@redhat.com>,
	Mikulas Patocka <mpatocka@redhat.com>
Cc: device-mapper development <dm-devel@redhat.com>
Subject: dm-table-rework-reference-counting.patch
Date: Tue, 06 Jan 2009 16:16:50 +0900	[thread overview]
Message-ID: <49630562.3090107@ct.jp.nec.com> (raw)

Hi Alasdair, Mikulas,

Although I'm not sure this is correct, don't we need to convert
the following 2 dm_table_put()s to dm_table_destroy()?
Otherwise, the created table won't be destroyed and memory leak
will happen in such error cases?

drivers/md/dm-ioctl.c:table_load()
1060         r = dm_table_create(&t, get_mode(param), param->target_count, md);
1061         if (r)
1062                 goto out;
1063 
1064         r = populate_table(t, param, param_size);
1065         if (r) {
1066                 dm_table_put(t);
1067                 goto out;
1068         }
1069 
1070         down_write(&_hash_lock);
1071         hc = dm_get_mdptr(md);
1072         if (!hc || hc->md != md) {
1073                 DMWARN("device has been removed from the dev hash table.");
1074                 dm_table_put(t);
1075                 up_write(&_hash_lock);
1076                 r = -ENXIO;
1077                 goto out;
1078         }

Thanks,
Kiyoshi Ueda

             reply	other threads:[~2009-01-06  7:16 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-01-06  7:16 Kiyoshi Ueda [this message]
2009-01-06 21:27 ` dm-table-rework-reference-counting.patch Mikulas Patocka
2009-01-07  5:23   ` self deadlock possibility during device deletion (Was: dm-table-rework-reference-counting.patch) Kiyoshi Ueda

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=49630562.3090107@ct.jp.nec.com \
    --to=k-ueda@ct.jp.nec.com \
    --cc=agk@redhat.com \
    --cc=dm-devel@redhat.com \
    --cc=mpatocka@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.