<?xml version="1.0" encoding="UTF-8"?>
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns="http://purl.org/rss/1.0/" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:syn="http://purl.org/rss/1.0/modules/syndication/" xmlns:admin="http://webns.net/mvcb/">
  <channel rdf:about="http://blog.gmane.org/gmane.linux.kernel.device-mapper.devel">
    <title>gmane.linux.kernel.device-mapper.devel</title>
    <link>http://blog.gmane.org/gmane.linux.kernel.device-mapper.devel</link>
    <description/>
    <syn:updatePeriod>hourly</syn:updatePeriod>
    <syn:updateFrequency>1</syn:updateFrequency>
    <syn:updateBase>1901-01-01T00:00+00:00</syn:updateBase>
    <items>
      <rdf:Seq>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.linux.kernel.device-mapper.devel/15973"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.linux.kernel.device-mapper.devel/15958"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.linux.kernel.device-mapper.devel/15928"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.linux.kernel.device-mapper.devel/15907"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.linux.kernel.device-mapper.devel/15906"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.linux.kernel.device-mapper.devel/15903"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.linux.kernel.device-mapper.devel/15902"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.linux.kernel.device-mapper.devel/15900"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.linux.kernel.device-mapper.devel/15892"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.linux.kernel.device-mapper.devel/15863"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.linux.kernel.device-mapper.devel/15845"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.linux.kernel.device-mapper.devel/15842"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.linux.kernel.device-mapper.devel/15841"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.linux.kernel.device-mapper.devel/15837"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.linux.kernel.device-mapper.devel/15791"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.linux.kernel.device-mapper.devel/15790"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.linux.kernel.device-mapper.devel/15783"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.linux.kernel.device-mapper.devel/15779"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.linux.kernel.device-mapper.devel/15771"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.linux.kernel.device-mapper.devel/15765"/>
      </rdf:Seq>
    </items>
    <image rdf:resource="http://gmane.org/img/gmane-25t.png"/>
    <textinput rdf:resource=""/>
  </channel>
  <image rdf:about="http://gmane.org/img/gmane-25t.png">
    <title>Gmane</title>
    <url>http://gmane.org/img/gmane-25t.png</url>
    <link>http://gmane.org</link>
  </image>
  <item rdf:about="http://comments.gmane.org/gmane.linux.kernel.device-mapper.devel/15973">
    <title>[PATCH v3 00/16] Block cleanups</title>
    <link>http://comments.gmane.org/gmane.linux.kernel.device-mapper.devel/15973</link>
    <description>&lt;pre&gt;Incorporated various review feedback, and I reordered/reworked the patches to
make them more coherent.

This also has the latest version of the closure code, incorporating review
feedback from Joe and Tejun. I may rewrite the bio splitting stuff to not
depend on it so it can go in sooner (Tejun is not a fan of closures), but IMO
the patch is better for using them.

First 5 patches: Kill bi_destructor

Next 3 patches: Better bio splitting

Next 3 patches: Rework bio cloning to not clone entire bio vec

Tejun also pointed out that with the bio splitting improvements we ought to be
able to get rid of merge_bvec_fn, so I started on that. Those patches are
definitely a WIP, though.

For most of the md code, it looks like things will almost just work - they
already had bio_pair_split() calls to handle single page bios that crossed bvec
boundries, but bio_pair_split() now splits arbitrary bios so things should just work.

(I just thought of one problem - previously, in practice you'd never need to
split a bio more than once, but that's no longer true - so the
bio_pair_split() calls do need to be stuck in a loop, and the as is the
patches aren't correct.)

For raid5 though I couldn't find any splitting in the existing code - it looks
like it's depending on merge_bvec_fn to make sure bios never need to be split.
Adding bio splitting looks to be not quite trivial - Neil, any thoughts?

For dm, it was already splitting multi page bios when necessary, it looked like
its merge_bvec_fn was mostly for propagating device limits - which my
generic_make_request() patch handles. Any dm folks want to take a look?

There are only 4 merge_bvec_fns left in my kernel:

drivers/md/raid5.c - raid5_mergeable_bvec()
drivers/block/drbd/drbd_req.c - drbd_merge_bvec()
drivers/block/pktcdvd.c - pkt_merge_bvec()
drivers/block/rbd.c - rbd_merge_bvec()

I haven't looked at the last three, but if the maintainers want to help out a
bit it should be pretty easy to get rid of merge_bvec_fn entirely.

Kent Overstreet (16):
  block: Generalized bio pool freeing
  dm: Use bioset's front_pad for dm_rq_clone_bio_info
  block: Add bio_reset()
  pktcdvd: Switch to bio_kmalloc()
  block: Kill bi_destructor
  block: Add an explicit bio flag for bios that own their bvec
  block: Rename bio_split() -&amp;gt; bio_pair_split()
  block: Rework bio splitting
  block: Add bio_clone_kmalloc()
  block: Add bio_clone_bioset()
  block: Only clone bio vecs that are in use
  Closures
  Make generic_make_request handle arbitrarily large bios
  Gut bio_add_page()
  md: Kill merge_bvec_fn()s
  dm: Kill merge_bvec_fn()

 Documentation/block/biodoc.txt      |    5 -
 block/blk-core.c                    |  126 ++++++-
 drivers/block/drbd/drbd_req.c       |   18 +-
 drivers/block/osdblk.c              |    3 +-
 drivers/block/pktcdvd.c             |  121 +++----
 drivers/block/rbd.c                 |    8 +-
 drivers/md/dm-crypt.c               |    9 -
 drivers/md/dm-io.c                  |   11 -
 drivers/md/dm.c                     |  118 +------
 drivers/md/linear.c                 |   52 +--
 drivers/md/md.c                     |   44 +--
 drivers/md/raid0.c                  |   70 +---
 drivers/md/raid1.c                  |   34 --
 drivers/md/raid10.c                 |  100 +-----
 drivers/target/target_core_iblock.c |    9 -
 fs/bio-integrity.c                  |   44 ---
 fs/bio.c                            |  437 ++++++++++++-----------
 fs/exofs/ore.c                      |    5 +-
 include/linux/bio.h                 |   43 ++-
 include/linux/blk_types.h           |    9 +-
 include/linux/blkdev.h              |    3 +
 include/linux/closure.h             |  658 +++++++++++++++++++++++++++++++++++
 lib/Kconfig.debug                   |    8 +
 lib/Makefile                        |    2 +-
 lib/closure.c                       |  344 ++++++++++++++++++
 25 files changed, 1482 insertions(+), 799 deletions(-)
 create mode 100644 include/linux/closure.h
 create mode 100644 lib/closure.c

&lt;/pre&gt;</description>
    <dc:creator>Kent Overstreet</dc:creator>
    <dc:date>2012-05-25T20:25:23</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.linux.kernel.device-mapper.devel/15958">
    <title>[PATCH 0/2] multipath: compile cleanup</title>
    <link>http://comments.gmane.org/gmane.linux.kernel.device-mapper.devel/15958</link>
    <description>&lt;pre&gt;When the multipath code is compiled with the standard redhat rpm cflags,
there are a number of warnings that get issued, some about real problems.

These patches switch multipath to use those cflags, and then clean up
warnings. If people want upstream to continue using the existing cflags,
I don't particularly mind.  I really included the first patch to make sure
people can see the warnings that the second patch corrects.

Also, some of the warnings are for actual errors, and how to fix them is
obvious.  Others won't actually cause problems, and if people object to
the changes I made to make them go away, I'm happy to fix them differently. 

Benjamin Marzinski (2):
  multipath: Build with standard rpm cflags
  multipath: Fix warnings from stricter compile options.

 Makefile.inc                     |    6 +++++-
 libmpathpersist/mpath_persist.c  |   10 +++++++---
 libmpathpersist/mpath_pr_ioctl.c |    9 +++++++++
 libmultipath/alias.c             |    8 ++++++--
 mpathpersist/main.c              |    2 --
 multipathd/main.c                |   24 +++++++++++++++++++-----
 6 files changed, 46 insertions(+), 13 deletions(-)

&lt;/pre&gt;</description>
    <dc:creator>Benjamin Marzinski</dc:creator>
    <dc:date>2012-05-25T04:57:41</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.linux.kernel.device-mapper.devel/15928">
    <title>bcache performance test problem</title>
    <link>http://comments.gmane.org/gmane.linux.kernel.device-mapper.devel/15928</link>
    <description>&lt;pre&gt;Hi Kent,

I have tested bcache on my platform, but the result is not good. I think maybe the wrong config caused it. Would you pls help me to check the config, or give me some advice for bcache performance testing?

My SSD card is  a PCIe SSD card (about 120,000 IOPS), and I used 10GB.

I have download the code from git://evilpiepirate.org/~kent/linux-bcache.git.
The commands creating bcache is below:
make-bcache -B /dev/sdb8
make-bcache -C -w4k -b1M -writeback /dev/hioa5

I use FIO to test the seq./random IO performance, and the result is below:
write             read                    randwrite    randread
bcache               10809 KB/s    164502.5 KB/s     2713 KB/s    29640 KB/s
cache_hit_rate  80                  79                         94                92


And the basic test result is:
Write                   read                  randwrite             randread
HDD      81211.6 KB/s       172242 KB/s     2606 KB/s             1855 KB/s
SSD       250948.2 KB/s     813855 KB/s     238892.7 KB/s      657319.5 KB/s

&lt;/pre&gt;</description>
    <dc:creator>Qinling</dc:creator>
    <dc:date>2012-05-24T01:14:01</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.linux.kernel.device-mapper.devel/15907">
    <title>[PATCH] multipath: Some device configuration changes forNetAppLUNs</title>
    <link>http://comments.gmane.org/gmane.linux.kernel.device-mapper.devel/15907</link>
    <description>&lt;pre&gt;NetApp has asked for these configuration changes.

Signed-off-by: Benjamin Marzinski &amp;lt;bmarzins&amp;lt; at &amp;gt;redhat.com&amp;gt;
---
 libmultipath/hwtable.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Index: multipath-tools-120518/libmultipath/hwtable.c
===================================================================
--- multipath-tools-120518.orig/libmultipath/hwtable.c
+++ multipath-tools-120518/libmultipath/hwtable.c
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -912,11 +912,12 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; static struct hwentry default_hw[] = {
 {
 .vendor        = "NETAPP",
 .product       = "LUN.*",
-.features      = "1 queue_if_no_path",
+.features      = "3 queue_if_no_path pg_init_retries 50",
 .hwhandler     = DEFAULT_HWHANDLER,
 .selector      = DEFAULT_SELECTOR,
 .pgpolicy      = GROUP_BY_PRIO,
 .pgfailback    = -FAILBACK_IMMEDIATE,
+.flush_on_last_del = FLUSH_ENABLED,
 .rr_weight     = RR_WEIGHT_NONE,
 .no_path_retry = NO_PATH_RETRY_UNDEF,
 .minio         = 128,

&lt;/pre&gt;</description>
    <dc:creator>Benjamin Marzinski</dc:creator>
    <dc:date>2012-05-23T21:42:20</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.linux.kernel.device-mapper.devel/15906">
    <title>[PATCH][RESEND] multipath: fix scsi async tur checkercorruption</title>
    <link>http://comments.gmane.org/gmane.linux.kernel.device-mapper.devel/15906</link>
    <description>&lt;pre&gt;Since the tur checker runs asynchronously in its own thread, there is nothing
that keeps a path from being orphaned or deleted before the tur thread has
finished. When this happenes the checker struct gets deleted.  However, the tur
thread might still we writing to that memory.  This can lead to memory
corruption.  This patch adds all of the necessary data to the checker context,
and makes the tur thread only use that. This way, if the checker is deleted
while the thread is still using the context, the thread will clean up the
context itself.

Since the context can only be freed when both the thread and the paths checker
structure have stopped needing it, and these can get get finished with the
context asychronously with respect to each other, the context has a holders
counter, protected by a spinlock, to keep track of the users.  When the
counter drops to zero, the context gets freed.

Signed-off-by: Benjamin Marzinski &amp;lt;bmarzins&amp;lt; at &amp;gt;redhat.com&amp;gt;
---
 libmultipath/checkers/tur.c |   85 +++++++++++++++++++++++++++++++++-----------
 libmultipath/discovery.c    |    1 
 2 files changed, 65 insertions(+), 21 deletions(-)

Index: multipath-tools-120518/libmultipath/checkers/tur.c
===================================================================
--- multipath-tools-120518.orig/libmultipath/checkers/tur.c
+++ multipath-tools-120518/libmultipath/checkers/tur.c
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -35,10 +35,15 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; struct tur_checker_context {
 dev_t devt;
 int state;
 int running;
-time_t timeout;
+int fd;
+unsigned int timeout;
+time_t time;
 pthread_t thread;
 pthread_mutex_t lock;
 pthread_cond_t active;
+pthread_spinlock_t hldr_lock;
+int holders;
+char message[CHECKER_MSG_LEN];
 };
 
 #define TUR_DEVT(c) major((c)-&amp;gt;devt), minor((c)-&amp;gt;devt)
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -53,28 +58,49 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; int libcheck_init (struct checker * c)
 memset(ct, 0, sizeof(struct tur_checker_context));
 
 ct-&amp;gt;state = PATH_UNCHECKED;
+ct-&amp;gt;fd = -1;
+ct-&amp;gt;holders = 1;
 pthread_cond_init(&amp;amp;ct-&amp;gt;active, NULL);
 pthread_mutex_init(&amp;amp;ct-&amp;gt;lock, NULL);
+pthread_spin_init(&amp;amp;ct-&amp;gt;hldr_lock, PTHREAD_PROCESS_PRIVATE);
 c-&amp;gt;context = ct;
 
 return 0;
 }
 
+void cleanup_context(struct tur_checker_context *ct)
+{
+pthread_mutex_destroy(&amp;amp;ct-&amp;gt;lock);
+pthread_cond_destroy(&amp;amp;ct-&amp;gt;active);
+pthread_spin_destroy(&amp;amp;ct-&amp;gt;hldr_lock);
+free(ct);
+}
+
 void libcheck_free (struct checker * c)
 {
 if (c-&amp;gt;context) {
 struct tur_checker_context *ct = c-&amp;gt;context;
+int holders;
+pthread_t thread;
 
-pthread_mutex_destroy(&amp;amp;ct-&amp;gt;lock);
-pthread_cond_destroy(&amp;amp;ct-&amp;gt;active);
-free(c-&amp;gt;context);
+pthread_spin_lock(&amp;amp;ct-&amp;gt;hldr_lock);
+ct-&amp;gt;holders--;
+holders = ct-&amp;gt;holders;
+thread = ct-&amp;gt;thread;
+pthread_spin_unlock(&amp;amp;ct-&amp;gt;hldr_lock);
+if (holders)
+pthread_cancel(thread);
+else
+cleanup_context(ct);
 c-&amp;gt;context = NULL;
 }
 return;
 }
 
+#define TUR_MSG(msg, fmt, args...) snprintf(msg, CHECKER_MSG_LEN, fmt, ##args);
+
 int
-tur_check (struct checker * c)
+tur_check(int fd, unsigned int timeout, char *msg)
 {
 struct sg_io_hdr io_hdr;
 unsigned char turCmdBlk[TUR_CMD_LEN] = { 0x00, 0, 0, 0, 0, 0 };
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -90,10 +116,10 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; tur_check (struct checker * c)
 io_hdr.dxfer_direction = SG_DXFER_NONE;
 io_hdr.cmdp = turCmdBlk;
 io_hdr.sbp = sense_buffer;
-io_hdr.timeout = c-&amp;gt;timeout;
+io_hdr.timeout = timeout;
 io_hdr.pack_id = 0;
-if (ioctl(c-&amp;gt;fd, SG_IO, &amp;amp;io_hdr) &amp;lt; 0) {
-MSG(c, MSG_TUR_DOWN);
+if (ioctl(fd, SG_IO, &amp;amp;io_hdr) &amp;lt; 0) {
+TUR_MSG(msg, MSG_TUR_DOWN);
 return PATH_DOWN;
 }
 if ((io_hdr.status &amp;amp; 0x7e) == 0x18) {
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -101,7 +127,7 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; tur_check (struct checker * c)
  * SCSI-3 arrays might return
  * reservation conflict on TUR
  */
-MSG(c, MSG_TUR_UP);
+TUR_MSG(msg, MSG_TUR_UP);
 return PATH_UP;
 }
 if (io_hdr.info &amp;amp; SG_INFO_OK_MASK) {
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -146,14 +172,14 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; tur_check (struct checker * c)
  * LOGICAL UNIT NOT ACCESSIBLE,
  * TARGET PORT IN STANDBY STATE
  */
-MSG(c, MSG_TUR_GHOST);
+TUR_MSG(msg, MSG_TUR_GHOST);
 return PATH_GHOST;
 }
 }
-MSG(c, MSG_TUR_DOWN);
+TUR_MSG(msg, MSG_TUR_DOWN);
 return PATH_DOWN;
 }
-MSG(c, MSG_TUR_UP);
+TUR_MSG(msg, MSG_TUR_UP);
 return PATH_UP;
 }
 
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -162,18 +188,25 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; tur_check (struct checker * c)
 
 void cleanup_func(void *data)
 {
+int holders;
 struct tur_checker_context *ct = data;
+pthread_spin_lock(&amp;amp;ct-&amp;gt;hldr_lock);
+ct-&amp;gt;holders--;
+holders = ct-&amp;gt;holders;
 ct-&amp;gt;thread = 0;
+pthread_spin_unlock(&amp;amp;ct-&amp;gt;hldr_lock);
+if (!holders)
+cleanup_context(ct);
 }
 
 void *tur_thread(void *ctx)
 {
-struct checker *c = ctx;
-struct tur_checker_context *ct = c-&amp;gt;context;
+struct tur_checker_context *ct = ctx;
 int state;
 
 condlog(3, "%d:%d: tur checker starting up", TUR_DEVT(ct));
 
+ct-&amp;gt;message[0] = '\0';
 /* This thread can be canceled, so setup clean up */
 tur_thread_cleanup_push(ct)
 
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -182,7 +215,7 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; void *tur_thread(void *ctx)
 ct-&amp;gt;state = PATH_PENDING;
 pthread_mutex_unlock(&amp;amp;ct-&amp;gt;lock);
 
-state = tur_check(c);
+state = tur_check(ct-&amp;gt;fd, ct-&amp;gt;timeout, ct-&amp;gt;message);
 
 /* TUR checker done */
 pthread_mutex_lock(&amp;amp;ct-&amp;gt;lock);
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -213,7 +246,7 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; void tur_set_async_timeout(struct checke
 struct timeval now;
 
 gettimeofday(&amp;amp;now, NULL);
-ct-&amp;gt;timeout = now.tv_sec + c-&amp;gt;timeout;
+ct-&amp;gt;time = now.tv_sec + c-&amp;gt;timeout;
 }
 
 int tur_check_async_timeout(struct checker *c)
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -222,7 +255,7 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; int tur_check_async_timeout(struct check
 struct timeval now;
 
 gettimeofday(&amp;amp;now, NULL);
-return (now.tv_sec &amp;gt; ct-&amp;gt;timeout);
+return (now.tv_sec &amp;gt; ct-&amp;gt;time);
 }
 
 extern int
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -242,7 +275,7 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; libcheck_check (struct checker * c)
 ct-&amp;gt;devt = sb.st_rdev;
 
 if (c-&amp;gt;sync)
-return tur_check(c);
+return tur_check(c-&amp;gt;fd, c-&amp;gt;timeout, c-&amp;gt;message);
 
 /*
  * Async mode
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -276,6 +309,8 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; libcheck_check (struct checker * c)
 /* TUR checker done */
 ct-&amp;gt;running = 0;
 tur_status = ct-&amp;gt;state;
+strncpy(c-&amp;gt;message, ct-&amp;gt;message, CHECKER_MSG_LEN);
+c-&amp;gt;message[CHECKER_MSG_LEN - 1] = '\0';
 }
 pthread_mutex_unlock(&amp;amp;ct-&amp;gt;lock);
 } else {
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -284,24 +319,32 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; libcheck_check (struct checker * c)
 pthread_mutex_unlock(&amp;amp;ct-&amp;gt;lock);
 condlog(3, "%d:%d: tur thread not responding, "
 "using sync mode", TUR_DEVT(ct));
-return tur_check(c);
+return tur_check(c-&amp;gt;fd, c-&amp;gt;timeout, c-&amp;gt;message);
 }
 /* Start new TUR checker */
 ct-&amp;gt;state = PATH_UNCHECKED;
+ct-&amp;gt;fd = c-&amp;gt;fd;
+ct-&amp;gt;timeout = c-&amp;gt;timeout;
+pthread_spin_lock(&amp;amp;ct-&amp;gt;hldr_lock);
+ct-&amp;gt;holders++;
+pthread_spin_unlock(&amp;amp;ct-&amp;gt;hldr_lock);
 tur_set_async_timeout(c);
 setup_thread_attr(&amp;amp;attr, 32 * 1024, 1);
-r = pthread_create(&amp;amp;ct-&amp;gt;thread, &amp;amp;attr, tur_thread, c);
+r = pthread_create(&amp;amp;ct-&amp;gt;thread, &amp;amp;attr, tur_thread, ct);
 if (r) {
 pthread_mutex_unlock(&amp;amp;ct-&amp;gt;lock);
 ct-&amp;gt;thread = 0;
+ct-&amp;gt;holders--;
 condlog(3, "%d:%d: failed to start tur thread, using"
 " sync mode", TUR_DEVT(ct));
-return tur_check(c);
+return tur_check(c-&amp;gt;fd, c-&amp;gt;timeout, c-&amp;gt;message);
 }
 pthread_attr_destroy(&amp;amp;attr);
 tur_timeout(&amp;amp;tsp);
 r = pthread_cond_timedwait(&amp;amp;ct-&amp;gt;active, &amp;amp;ct-&amp;gt;lock, &amp;amp;tsp);
 tur_status = ct-&amp;gt;state;
+strncpy(c-&amp;gt;message, ct-&amp;gt;message,CHECKER_MSG_LEN);
+c-&amp;gt;message[CHECKER_MSG_LEN -1] = '\0';
 pthread_mutex_unlock(&amp;amp;ct-&amp;gt;lock);
 if (ct-&amp;gt;thread &amp;amp;&amp;amp;
     (tur_status == PATH_PENDING || tur_status == PATH_UNCHECKED)) {
Index: multipath-tools-120518/libmultipath/discovery.c
===================================================================
--- multipath-tools-120518.orig/libmultipath/discovery.c
+++ multipath-tools-120518/libmultipath/discovery.c
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -747,6 +747,7 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; get_state (struct path * pp, int daemon)
 }
 checker_set_fd(c, pp-&amp;gt;fd);
 if (checker_init(c, pp-&amp;gt;mpp?&amp;amp;pp-&amp;gt;mpp-&amp;gt;mpcontext:NULL)) {
+memset(c, 0x0, sizeof(struct checker));
 condlog(3, "%s: checker init failed", pp-&amp;gt;dev);
 return PATH_UNCHECKED;
 }

&lt;/pre&gt;</description>
    <dc:creator>Benjamin Marzinski</dc:creator>
    <dc:date>2012-05-23T21:05:20</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.linux.kernel.device-mapper.devel/15903">
    <title>[PATCH] multipath: Allow user_friendly_names in moreconfigsections</title>
    <link>http://comments.gmane.org/gmane.linux.kernel.device-mapper.devel/15903</link>
    <description>&lt;pre&gt;This patch adds support for setting user_friendly_names in the devices and
multipaths config sections.

Signed-off-by: Benjamin Marzinski &amp;lt;bmarzins&amp;lt; at &amp;gt;redhat.com&amp;gt;
---
 libmultipath/config.c  |    2 +
 libmultipath/config.h  |    2 +
 libmultipath/dict.c    |   94 +++++++++++++++++++++++++++++++++++++++++++++----
 libmultipath/propsel.c |   14 ++++++-
 libmultipath/structs.h |    6 +++
 5 files changed, 110 insertions(+), 8 deletions(-)

Index: multipath-tools-120518/libmultipath/config.c
===================================================================
--- multipath-tools-120518.orig/libmultipath/config.c
+++ multipath-tools-120518/libmultipath/config.c
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -325,6 +325,7 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; merge_hwe (struct hwentry * dst, struct
 merge_num(flush_on_last_del);
 merge_num(fast_io_fail);
 merge_num(dev_loss);
+merge_num(user_friendly_names);
 
 return 0;
 }
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -383,6 +384,7 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; store_hwe (vector hwtable, struct hwentr
 hwe-&amp;gt;flush_on_last_del = dhwe-&amp;gt;flush_on_last_del;
 hwe-&amp;gt;fast_io_fail = dhwe-&amp;gt;fast_io_fail;
 hwe-&amp;gt;dev_loss = dhwe-&amp;gt;dev_loss;
+hwe-&amp;gt;user_friendly_names = dhwe-&amp;gt;user_friendly_names;
 
 if (dhwe-&amp;gt;bl_product &amp;amp;&amp;amp; !(hwe-&amp;gt;bl_product = set_param_str(dhwe-&amp;gt;bl_product)))
 goto out;
Index: multipath-tools-120518/libmultipath/config.h
===================================================================
--- multipath-tools-120518.orig/libmultipath/config.h
+++ multipath-tools-120518/libmultipath/config.h
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -44,6 +44,7 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; struct hwentry {
 int flush_on_last_del;
 int fast_io_fail;
 unsigned int dev_loss;
+int user_friendly_names;
 char * bl_product;
 };
 
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -66,6 +67,7 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; struct mpentry {
 int pg_timeout;
 int flush_on_last_del;
 int attribute_flags;
+int user_friendly_names;
 uid_t uid;
 gid_t gid;
 mode_t mode;
Index: multipath-tools-120518/libmultipath/dict.c
===================================================================
--- multipath-tools-120518.orig/libmultipath/dict.c
+++ multipath-tools-120518/libmultipath/dict.c
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -583,7 +583,7 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; def_reservation_key_handler(vector strve
 }
 
 static int
-names_handler(vector strvec)
+def_names_handler(vector strvec)
 {
 char * buff;
 
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -594,10 +594,12 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; names_handler(vector strvec)
 
 if ((strlen(buff) == 2 &amp;amp;&amp;amp; !strcmp(buff, "no")) ||
     (strlen(buff) == 1 &amp;amp;&amp;amp; !strcmp(buff, "0")))
-conf-&amp;gt;user_friendly_names = 0;
+conf-&amp;gt;user_friendly_names = USER_FRIENDLY_NAMES_OFF;
 else if ((strlen(buff) == 3 &amp;amp;&amp;amp; !strcmp(buff, "yes")) ||
  (strlen(buff) == 1 &amp;amp;&amp;amp; !strcmp(buff, "1")))
-conf-&amp;gt;user_friendly_names = 1;
+conf-&amp;gt;user_friendly_names = USER_FRIENDLY_NAMES_ON;
+else
+conf-&amp;gt;user_friendly_names = USER_FRIENDLY_NAMES_UNDEF;
 
 FREE(buff);
 return 0;
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -1207,6 +1209,32 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; hw_flush_on_last_del_handler(vector strv
 return 0;
 }
 
+static int
+hw_names_handler(vector strvec)
+{
+struct hwentry *hwe = VECTOR_LAST_SLOT(conf-&amp;gt;hwtable);
+char * buff;
+
+if (!hwe)
+return 1;
+
+buff = set_value(strvec);
+if (!buff)
+return 1;
+
+if ((strlen(buff) == 2 &amp;amp;&amp;amp; strcmp(buff, "no") == 0) ||
+    (strlen(buff) == 1 &amp;amp;&amp;amp; strcmp(buff, "0") == 0))
+hwe-&amp;gt;user_friendly_names = USER_FRIENDLY_NAMES_OFF;
+else if ((strlen(buff) == 3 &amp;amp;&amp;amp; strcmp(buff, "yes") == 0) ||
+ (strlen(buff) == 1 &amp;amp;&amp;amp; strcmp(buff, "1") == 0))
+hwe-&amp;gt;user_friendly_names = USER_FRIENDLY_NAMES_ON;
+else
+hwe-&amp;gt;user_friendly_names = USER_FRIENDLY_NAMES_UNDEF;
+
+FREE(buff);
+return 0;
+}
+
 /*
  * multipaths block handlers
  */
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -1654,6 +1682,31 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; mp_reservation_key_handler (vector strve
 return 0;
 }
 
+static int
+mp_names_handler(vector strvec)
+{
+struct mpentry *mpe = VECTOR_LAST_SLOT(conf-&amp;gt;mptable);
+char * buff;
+
+if (!mpe)
+return 1;
+
+buff = set_value(strvec);
+if (!buff)
+return 1;
+
+if ((strlen(buff) == 2 &amp;amp;&amp;amp; strcmp(buff, "no") == 0) ||
+    (strlen(buff) == 1 &amp;amp;&amp;amp; strcmp(buff, "0") == 0))
+mpe-&amp;gt;user_friendly_names = USER_FRIENDLY_NAMES_OFF;
+else if ((strlen(buff) == 3 &amp;amp;&amp;amp; strcmp(buff, "yes") == 0) ||
+ (strlen(buff) == 1 &amp;amp;&amp;amp; strcmp(buff, "1") == 0))
+mpe-&amp;gt;user_friendly_names = USER_FRIENDLY_NAMES_ON;
+else
+mpe-&amp;gt;user_friendly_names = USER_FRIENDLY_NAMES_UNDEF;
+
+FREE(buff);
+return 0;
+}
 
 /*
  * config file keywords printing
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -1884,6 +1937,18 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; snprint_mp_reservation_key (char * buff,
 return snprintf(buff, len, "%s" , mpe-&amp;gt;reservation_key);
 }
 
+static int
+snprint_mp_user_friendly_names (char * buff, int len, void * data)
+{
+struct mpentry * mpe = (struct mpentry *)data;
+
+if (mpe-&amp;gt;user_friendly_names == USER_FRIENDLY_NAMES_UNDEF)
+return 0;
+else if (mpe-&amp;gt;user_friendly_names == USER_FRIENDLY_NAMES_OFF)
+return snprintf(buff, len, "no");
+else
+return snprintf(buff, len, "yes");
+}
 
 static int
 snprint_hw_fast_io_fail(char * buff, int len, void * data)
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -2174,6 +2239,19 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; snprint_hw_path_checker (char * buff, in
 return snprintf(buff, len, "%s", hwe-&amp;gt;checker_name);
 }
 
+static int
+snprint_hw_user_friendly_names (char * buff, int len, void * data)
+{
+struct hwentry * hwe = (struct hwentry *)data;
+
+if (hwe-&amp;gt;user_friendly_names == USER_FRIENDLY_NAMES_UNDEF)
+return 0;
+else if (hwe-&amp;gt;user_friendly_names == USER_FRIENDLY_NAMES_OFF)
+return snprintf(buff, len, "no");
+else
+return snprintf(buff, len, "yes");
+}
+
 static int
 snprint_def_polling_interval (char * buff, int len, void * data)
 {
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -2461,10 +2539,10 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; snprint_def_log_checker_err (char * buff
 static int
 snprint_def_user_friendly_names (char * buff, int len, void * data)
 {
-if (!conf-&amp;gt;user_friendly_names)
+if (conf-&amp;gt;user_friendly_names  == USER_FRIENDLY_NAMES_ON)
+return snprintf(buff, len, "yes");
+else
 return snprintf(buff, len, "no");
-
-return snprintf(buff, len, "yes");
 }
 
 static int
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -2547,7 +2625,7 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; init_keywords(void)
 install_keyword("checker_timeout", &amp;amp;def_checker_timeout_handler, &amp;amp;snprint_def_checker_timeout);
 install_keyword("pg_timeout", &amp;amp;def_pg_timeout_handler, &amp;amp;snprint_def_pg_timeout);
 install_keyword("flush_on_last_del", &amp;amp;def_flush_on_last_del_handler, &amp;amp;snprint_def_flush_on_last_del);
-install_keyword("user_friendly_names", &amp;amp;names_handler, &amp;amp;snprint_def_user_friendly_names);
+install_keyword("user_friendly_names", &amp;amp;def_names_handler, &amp;amp;snprint_def_user_friendly_names);
 install_keyword("mode", &amp;amp;def_mode_handler, &amp;amp;snprint_def_mode);
 install_keyword("uid", &amp;amp;def_uid_handler, &amp;amp;snprint_def_uid);
 install_keyword("gid", &amp;amp;def_gid_handler, &amp;amp;snprint_def_gid);
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -2616,6 +2694,7 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; init_keywords(void)
 install_keyword("flush_on_last_del", &amp;amp;hw_flush_on_last_del_handler, &amp;amp;snprint_hw_flush_on_last_del);
 install_keyword("fast_io_fail_tmo", &amp;amp;hw_fast_io_fail_handler, &amp;amp;snprint_hw_fast_io_fail);
 install_keyword("dev_loss_tmo", &amp;amp;hw_dev_loss_handler, &amp;amp;snprint_hw_dev_loss);
+install_keyword("user_friendly_names", &amp;amp;hw_names_handler, &amp;amp;snprint_hw_user_friendly_names);
 install_sublevel_end();
 
 install_keyword_root("multipaths", &amp;amp;multipaths_handler);
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -2639,5 +2718,6 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; init_keywords(void)
 install_keyword("uid", &amp;amp;mp_uid_handler, &amp;amp;snprint_mp_uid);
 install_keyword("gid", &amp;amp;mp_gid_handler, &amp;amp;snprint_mp_gid);
 install_keyword("reservation_key", &amp;amp;mp_reservation_key_handler, &amp;amp;snprint_mp_reservation_key);
+install_keyword("user_friendly_names", &amp;amp;mp_names_handler, &amp;amp;snprint_mp_user_friendly_names);
 install_sublevel_end();
 }
Index: multipath-tools-120518/libmultipath/propsel.c
===================================================================
--- multipath-tools-120518.orig/libmultipath/propsel.c
+++ multipath-tools-120518/libmultipath/propsel.c
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -237,6 +237,18 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; select_alias_prefix (struct multipath *
 mp-&amp;gt;wwid, mp-&amp;gt;alias_prefix);
 }
 
+static int
+want_user_friendly_names(struct multipath * mp)
+{
+if (mp-&amp;gt;mpe &amp;amp;&amp;amp;
+    mp-&amp;gt;mpe-&amp;gt;user_friendly_names != USER_FRIENDLY_NAMES_UNDEF)
+return (mp-&amp;gt;mpe-&amp;gt;user_friendly_names == USER_FRIENDLY_NAMES_ON);
+if (mp-&amp;gt;hwe &amp;amp;&amp;amp;
+    mp-&amp;gt;hwe-&amp;gt;user_friendly_names != USER_FRIENDLY_NAMES_UNDEF)
+return (mp-&amp;gt;hwe-&amp;gt;user_friendly_names == USER_FRIENDLY_NAMES_ON);
+return (conf-&amp;gt;user_friendly_names  == USER_FRIENDLY_NAMES_ON);
+}
+
 extern int
 select_alias (struct multipath * mp)
 {
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -244,7 +256,7 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; select_alias (struct multipath * mp)
 mp-&amp;gt;alias = STRDUP(mp-&amp;gt;mpe-&amp;gt;alias);
 else {
 mp-&amp;gt;alias = NULL;
-if (conf-&amp;gt;user_friendly_names) {
+if (want_user_friendly_names(mp)) {
 select_alias_prefix(mp);
 mp-&amp;gt;alias = get_user_friendly_alias(mp-&amp;gt;wwid,
 conf-&amp;gt;bindings_file, mp-&amp;gt;alias_prefix, conf-&amp;gt;bindings_read_only);
Index: multipath-tools-120518/libmultipath/structs.h
===================================================================
--- multipath-tools-120518.orig/libmultipath/structs.h
+++ multipath-tools-120518/libmultipath/structs.h
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -92,6 +92,12 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; enum log_checker_err_states {
 LOG_CHKR_ERR_ONCE,
 };
 
+enum user_friendly_names_states {
+USER_FRIENDLY_NAMES_UNDEF,
+USER_FRIENDLY_NAMES_OFF,
+USER_FRIENDLY_NAMES_ON,
+};
+
 struct scsi_idlun {
 int dev_id;
 int host_unique_id;

&lt;/pre&gt;</description>
    <dc:creator>Benjamin Marzinski</dc:creator>
    <dc:date>2012-05-23T20:36:30</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.linux.kernel.device-mapper.devel/15902">
    <title>[PATCH] multipath: Make sure we store all the hwentryattributes.</title>
    <link>http://comments.gmane.org/gmane.linux.kernel.device-mapper.devel/15902</link>
    <description>&lt;pre&gt;Not all of the attributes from the hardware table entries were getting stored
when the built-in devices configurations were being setup.

Signed-off-by: Benjamin Marzinski &amp;lt;bmarzins&amp;lt; at &amp;gt;redhat.com&amp;gt;
---
 libmultipath/config.c |    4 ++++
 1 file changed, 4 insertions(+)

Index: multipath-tools-120518/libmultipath/config.c
===================================================================
--- multipath-tools-120518.orig/libmultipath/config.c
+++ multipath-tools-120518/libmultipath/config.c
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -379,6 +379,10 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; store_hwe (vector hwtable, struct hwentr
 hwe-&amp;gt;no_path_retry = dhwe-&amp;gt;no_path_retry;
 hwe-&amp;gt;minio = dhwe-&amp;gt;minio;
 hwe-&amp;gt;minio_rq = dhwe-&amp;gt;minio_rq;
+hwe-&amp;gt;pg_timeout = dhwe-&amp;gt;pg_timeout;
+hwe-&amp;gt;flush_on_last_del = dhwe-&amp;gt;flush_on_last_del;
+hwe-&amp;gt;fast_io_fail = dhwe-&amp;gt;fast_io_fail;
+hwe-&amp;gt;dev_loss = dhwe-&amp;gt;dev_loss;
 
 if (dhwe-&amp;gt;bl_product &amp;amp;&amp;amp; !(hwe-&amp;gt;bl_product = set_param_str(dhwe-&amp;gt;bl_product)))
 goto out;

&lt;/pre&gt;</description>
    <dc:creator>Benjamin Marzinski</dc:creator>
    <dc:date>2012-05-23T20:29:05</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.linux.kernel.device-mapper.devel/15900">
    <title>does file system page cache work after device mapping?</title>
    <link>http://comments.gmane.org/gmane.linux.kernel.device-mapper.devel/15900</link>
    <description>&lt;pre&gt;Hi everyone, I have some questions regarding to the mechanism of device
mapper: After the device mapper layer gets the mapping information, it will
issue IO request to the real device. How does it perform IO operation at
this stage? For example, if the device is a block device, will it go to the
page cache and check whether the desired block is in cache? If the block is
not in cache and it read from the physical device, will the block be cached
in memory?

Thanks very much!


Zhiming
&lt;/pre&gt;</description>
    <dc:creator>zhiming shen</dc:creator>
    <dc:date>2012-05-22T19:18:42</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.linux.kernel.device-mapper.devel/15892">
    <title>[PATCH]] multipath-tools : Minor typo inmultipath.conf.annotated</title>
    <link>http://comments.gmane.org/gmane.linux.kernel.device-mapper.devel/15892</link>
    <description>&lt;pre&gt;path checking alorithm &amp;lt;= should be algorithm
---
  multipath.conf.annotated |    2 +-
  1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/multipath.conf.annotated b/multipath.conf.annotated
index c8e8218..8700d33 100644
--- a/multipath.conf.annotated
+++ b/multipath.conf.annotated
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -491,7 +491,7 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt;
  ##
  #              # name    : path_checker, checker
  #              # scope   : multipathd &amp;amp; multipathd
-#              # desc    : path checking alorithm to use to check path 
state
+#              # desc    : path checking algorithm to use to check path 
state
  #              # values  : 
readsector0|tur|emc_clariion|hp_sw|directio|rdac|
  #              #           cciss_tur
  #              #
&lt;/pre&gt;</description>
    <dc:creator>Cedric Buissart</dc:creator>
    <dc:date>2012-05-23T12:47:35</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.linux.kernel.device-mapper.devel/15863">
    <title>[PATCH] dm-cache (block level disk cache target): UPDATElatest kernel</title>
    <link>http://comments.gmane.org/gmane.linux.kernel.device-mapper.devel/15863</link>
    <description>&lt;pre&gt;A new patch for the 3.3.5 kernel.
Signed-off-by: Ming Zhao &amp;lt;dm-cache&amp;lt; at &amp;gt;xxxxxxxxxxxxxxxx&amp;gt;

URL:
http://visa.cs.fiu.edu/tiki/dm-cache

check the code also at:
https://github.com/mingzhao/dm-cache


-Dulcardo
&lt;/pre&gt;</description>
    <dc:creator>Dulcardo Arteaga</dc:creator>
    <dc:date>2012-05-22T20:40:50</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.linux.kernel.device-mapper.devel/15845">
    <title>working with dm-raid module</title>
    <link>http://comments.gmane.org/gmane.linux.kernel.device-mapper.devel/15845</link>
    <description>&lt;pre&gt;Hello!

I am engineer in Tver State University. We would like to use dm-raid driver in our storage system. But we must understand how we can rebuild the array (e.g raid1) and how mark a disk as failed. I have not found any documentation about it. Could you tell how to do it? 

Thank you for advice!

---
WBR, Andrew Zhukov
TvSU IC Dep


&lt;/pre&gt;</description>
    <dc:creator>Andrew Zhukov</dc:creator>
    <dc:date>2012-05-19T19:41:04</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.linux.kernel.device-mapper.devel/15842">
    <title>[PATCH] multipath: clean up code for stopping the waiterthreads</title>
    <link>http://comments.gmane.org/gmane.linux.kernel.device-mapper.devel/15842</link>
    <description>&lt;pre&gt;The way multipathd currently stops the waiter threads needs some work.
Right now they are stopped by being sent the SIGUSR1 signal. However their
cleanup code assumes that they are being cancelled, just like all the other
threads are.  There's no reason for them to be so unnecessarily
complicated and different from the other threads

This patch does a couple of things.  First, it removes the mutex from
the event_thread.  This wasn't doing anything. It was designed to protect
the wp-&amp;gt;mapname variable, which the waiter threads were checking to see
if they should quit. However, the mutex was only ever being used by the
thread itself, and it clearly didn't need to serialize with itself.  Also,
the function to clear the mapname, signal_waiter(), was set with
pthread_cleanup_push(), which never got called early, since the threads
weren't being cancelled.  Thus, the mapname never got cleared
until the pthreads were about to shut down.

The patch also rips out all the signal stopping code, and just uses
pthread_cancel.  There already are cancellation points in the waiter
thread code. Between the cancellation points, both explicit and implicit,
and the fact that the waiter threads will never be killed except when the
killer is holding the vecs lock, there shouldn't be any place where the
waiter thread can access freed data.

To make sure the waiter thread cleans itself up properly, the dmt
has been moved into the event_thread structure, and is destroyed in
free_waiter() if necessary.

Signed-off-by: Benjamin Marzinski &amp;lt;bmarzins&amp;lt; at &amp;gt;redhat.com&amp;gt;
---
 libmultipath/waiter.c |   74 +++++++++++---------------------------------------
 libmultipath/waiter.h |    4 +-
 2 files changed, 19 insertions(+), 59 deletions(-)

Index: multipath-tools-120518/libmultipath/waiter.c
===================================================================
--- multipath-tools-120518.orig/libmultipath/waiter.c
+++ multipath-tools-120518/libmultipath/waiter.c
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -29,23 +29,17 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; struct event_thread *alloc_waiter (void)
 
 wp = (struct event_thread *)MALLOC(sizeof(struct event_thread));
 memset(wp, 0, sizeof(struct event_thread));
-pthread_mutex_init(&amp;amp;wp-&amp;gt;lock, NULL);
 
 return wp;
 }
 
-void signal_waiter (void *data)
+void free_waiter (void *data)
 {
 struct event_thread *wp = (struct event_thread *)data;
 
-pthread_mutex_lock(&amp;amp;wp-&amp;gt;lock);
-memset(wp-&amp;gt;mapname, 0, WWID_SIZE);
-pthread_mutex_unlock(&amp;amp;wp-&amp;gt;lock);
-}
+if (wp-&amp;gt;dmt)
+dm_task_destroy(wp-&amp;gt;dmt);
 
-void free_waiter (struct event_thread *wp)
-{
-pthread_mutex_destroy(&amp;amp;wp-&amp;gt;lock);
 FREE(wp);
 }
 
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -58,83 +52,56 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; void stop_waiter_thread (struct multipat
 }
 condlog(2, "%s: stop event checker thread (%lu)", mpp-&amp;gt;alias,
 mpp-&amp;gt;waiter);
-pthread_kill(mpp-&amp;gt;waiter, SIGUSR1);
+pthread_cancel(mpp-&amp;gt;waiter);
 mpp-&amp;gt;waiter = (pthread_t)0;
 }
 
-static sigset_t unblock_signals(void)
-{
-sigset_t set, old;
-
-sigemptyset(&amp;amp;set);
-sigaddset(&amp;amp;set, SIGHUP);
-sigaddset(&amp;amp;set, SIGUSR1);
-pthread_sigmask(SIG_UNBLOCK, &amp;amp;set, &amp;amp;old);
-return old;
-}
-
 /*
  * returns the reschedule delay
  * negative means *stop*
  */
 int waiteventloop (struct event_thread *waiter)
 {
-sigset_t set;
-struct dm_task *dmt = NULL;
 int event_nr;
 int r;
 
-pthread_mutex_lock(&amp;amp;waiter-&amp;gt;lock);
 if (!waiter-&amp;gt;event_nr)
 waiter-&amp;gt;event_nr = dm_geteventnr(waiter-&amp;gt;mapname);
 
-if (!(dmt = dm_task_create(DM_DEVICE_WAITEVENT))) {
+if (!(waiter-&amp;gt;dmt = dm_task_create(DM_DEVICE_WAITEVENT))) {
 condlog(0, "%s: devmap event #%i dm_task_create error",
 waiter-&amp;gt;mapname, waiter-&amp;gt;event_nr);
-pthread_mutex_unlock(&amp;amp;waiter-&amp;gt;lock);
 return 1;
 }
 
-if (!dm_task_set_name(dmt, waiter-&amp;gt;mapname)) {
+if (!dm_task_set_name(waiter-&amp;gt;dmt, waiter-&amp;gt;mapname)) {
 condlog(0, "%s: devmap event #%i dm_task_set_name error",
 waiter-&amp;gt;mapname, waiter-&amp;gt;event_nr);
-dm_task_destroy(dmt);
-pthread_mutex_unlock(&amp;amp;waiter-&amp;gt;lock);
+dm_task_destroy(waiter-&amp;gt;dmt);
+waiter-&amp;gt;dmt = NULL;
 return 1;
 }
 
-if (waiter-&amp;gt;event_nr &amp;amp;&amp;amp; !dm_task_set_event_nr(dmt,
+if (waiter-&amp;gt;event_nr &amp;amp;&amp;amp; !dm_task_set_event_nr(waiter-&amp;gt;dmt,
       waiter-&amp;gt;event_nr)) {
 condlog(0, "%s: devmap event #%i dm_task_set_event_nr error",
 waiter-&amp;gt;mapname, waiter-&amp;gt;event_nr);
-dm_task_destroy(dmt);
-pthread_mutex_unlock(&amp;amp;waiter-&amp;gt;lock);
+dm_task_destroy(waiter-&amp;gt;dmt);
+waiter-&amp;gt;dmt = NULL;
 return 1;
 }
-pthread_mutex_unlock(&amp;amp;waiter-&amp;gt;lock);
 
-dm_task_no_open_count(dmt);
-
-/* accept wait interruption */
-set = unblock_signals();
+dm_task_no_open_count(waiter-&amp;gt;dmt);
 
 /* wait */
-r = dm_task_run(dmt);
-
-/* wait is over : event or interrupt */
-pthread_sigmask(SIG_SETMASK, &amp;amp;set, NULL);
+r = dm_task_run(waiter-&amp;gt;dmt);
 
-dm_task_destroy(dmt);
+dm_task_destroy(waiter-&amp;gt;dmt);
+waiter-&amp;gt;dmt = NULL;
 
 if (!r)/* wait interrupted by signal */
 return -1;
 
-pthread_mutex_lock(&amp;amp;waiter-&amp;gt;lock);
-if (!strlen(waiter-&amp;gt;mapname)) {
-/* waiter should exit */
-pthread_mutex_unlock(&amp;amp;waiter-&amp;gt;lock);
-return -1;
-}
 waiter-&amp;gt;event_nr++;
 
 /*
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -164,20 +131,16 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; int waiteventloop (struct event_thread *
 if (r) {
 condlog(2, "%s: event checker exit",
 waiter-&amp;gt;mapname);
-pthread_mutex_unlock(&amp;amp;waiter-&amp;gt;lock);
 return -1; /* stop the thread */
 }
 
 event_nr = dm_geteventnr(waiter-&amp;gt;mapname);
 
-if (waiter-&amp;gt;event_nr == event_nr) {
-pthread_mutex_unlock(&amp;amp;waiter-&amp;gt;lock);
+if (waiter-&amp;gt;event_nr == event_nr)
 return 1; /* upon problem reschedule 1s later */
-}
 
 waiter-&amp;gt;event_nr = event_nr;
 }
-pthread_mutex_unlock(&amp;amp;waiter-&amp;gt;lock);
 return -1; /* never reach there */
 }
 
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -189,7 +152,7 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; void *waitevent (void *et)
 mlockall(MCL_CURRENT | MCL_FUTURE);
 
 waiter = (struct event_thread *)et;
-pthread_cleanup_push(signal_waiter, et);
+pthread_cleanup_push(free_waiter, et);
 
 block_signal(SIGUSR1, NULL);
 block_signal(SIGHUP, NULL);
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -203,7 +166,6 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; void *waitevent (void *et)
 }
 
 pthread_cleanup_pop(1);
-free_waiter(waiter);
 return NULL;
 }
 
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -219,10 +181,8 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; int start_waiter_thread (struct multipat
 if (!wp)
 goto out;
 
-pthread_mutex_lock(&amp;amp;wp-&amp;gt;lock);
 strncpy(wp-&amp;gt;mapname, mpp-&amp;gt;alias, WWID_SIZE);
 wp-&amp;gt;vecs = vecs;
-pthread_mutex_unlock(&amp;amp;wp-&amp;gt;lock);
 
 if (pthread_create(&amp;amp;wp-&amp;gt;thread, &amp;amp;waiter_attr, waitevent, wp)) {
 condlog(0, "%s: cannot create event checker", wp-&amp;gt;mapname);
Index: multipath-tools-120518/libmultipath/waiter.h
===================================================================
--- multipath-tools-120518.orig/libmultipath/waiter.h
+++ multipath-tools-120518/libmultipath/waiter.h
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -4,15 +4,15 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt;
 extern pthread_attr_t waiter_attr;
 
 struct event_thread {
+struct dm_task *dmt;
 pthread_t thread;
-pthread_mutex_t lock;
 int event_nr;
 char mapname[WWID_SIZE];
 struct vectors *vecs;
 };
 
 struct event_thread * alloc_waiter (void);
-void signal_waiter (void *data);
+void free_waiter (void *data);
 void stop_waiter_thread (struct multipath *mpp, struct vectors *vecs);
 int start_waiter_thread (struct multipath *mpp, struct vectors *vecs);
 int waiteventloop (struct event_thread *waiter);

&lt;/pre&gt;</description>
    <dc:creator>Benjamin Marzinski</dc:creator>
    <dc:date>2012-05-19T06:37:03</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.linux.kernel.device-mapper.devel/15841">
    <title>Changing some multipath defaults</title>
    <link>http://comments.gmane.org/gmane.linux.kernel.device-mapper.devel/15841</link>
    <description>&lt;pre&gt;Now that we have better path selectors than round-robin, is seems kind
of silly to have all of our built-in device configs actually setting
their path selector to round-robin.  I think we should either
change the default, or not set a path selector in the builtin device
configs, unless the harware vendor thinks that one of them will
give the best performace. Personally I'd be in favor of doing both.
Removing them from the builtin device configs, and changing the default
to either queue-length or service-time.

Also, since we are now increasing dev_loss_tmo to make sure that devices
don't get removed before queue_if_no_path times out, it seems reasonable
to set a default value for fast_io_fail_tmo, so that devices which will
queue forever will actually fail back the IO in a reasonable time,
something like 5.

These would go a long way towards make the defaults work better on more
systems.  Any thoughts?

-Ben

&lt;/pre&gt;</description>
    <dc:creator>Benjamin Marzinski</dc:creator>
    <dc:date>2012-05-19T02:01:26</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.linux.kernel.device-mapper.devel/15837">
    <title>[PATCH] multipath: fix select_no_path_retry for flushingdevices.</title>
    <link>http://comments.gmane.org/gmane.linux.kernel.device-mapper.devel/15837</link>
    <description>&lt;pre&gt;The select_no_path_retry code was falling through if a flush was
in progress, and so it wasn't honoring flush_on_last_del.

Signed-off-by: Benjamin Marzinski &amp;lt;bmarzins&amp;lt; at &amp;gt;redhat.com&amp;gt;
---
 libmultipath/propsel.c |    1 +
 1 file changed, 1 insertion(+)

Index: multipath-tools-120403/libmultipath/propsel.c
===================================================================
--- multipath-tools-120403.orig/libmultipath/propsel.c
+++ multipath-tools-120403/libmultipath/propsel.c
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -415,6 +415,7 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; select_no_path_retry(struct multipath *m
 if (mp-&amp;gt;flush_on_last_del == FLUSH_IN_PROGRESS) {
 condlog(0, "flush_on_last_del in progress");
 mp-&amp;gt;no_path_retry = NO_PATH_RETRY_FAIL;
+return 0;
 }
 if (mp-&amp;gt;mpe &amp;amp;&amp;amp; mp-&amp;gt;mpe-&amp;gt;no_path_retry != NO_PATH_RETRY_UNDEF) {
 mp-&amp;gt;no_path_retry = mp-&amp;gt;mpe-&amp;gt;no_path_retry;

&lt;/pre&gt;</description>
    <dc:creator>Benjamin Marzinski</dc:creator>
    <dc:date>2012-05-18T22:33:26</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.linux.kernel.device-mapper.devel/15791">
    <title>[PATCH] dm thin: fix table output when pool targetdisables discard passdown internally</title>
    <link>http://comments.gmane.org/gmane.linux.kernel.device-mapper.devel/15791</link>
    <description>&lt;pre&gt;When the thin pool target clears the discard_passdown parameter
internally, it incorrectly reports this to userspace on the table line.
This patch corrects this by no longer changing the table line to reflect
that discard passdown was disabled.

We can still tell when discard passdown is overridden by looking for the
message "Discard unsupported by data device: Disabling discard passdown."

Signed-off-by: Mike Snitzer &amp;lt;snitzer&amp;lt; at &amp;gt;redhat.com&amp;gt;
---
 drivers/md/dm-thin.c |   12 ++++++++++--
 1 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/drivers/md/dm-thin.c b/drivers/md/dm-thin.c
index 2fd87b5..d05fefd 100644
--- a/drivers/md/dm-thin.c
+++ b/drivers/md/dm-thin.c
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -497,6 +497,12 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; struct pool_features {
 unsigned zero_new_blocks:1;
 unsigned discard_enabled:1;
 unsigned discard_passdown:1;
+/*
+ * 'discard_passdown_original' preserves the value supplied to the
+ * constructor that could be overridden internally if the data device
+ * doesn't support discards.
+ */
+unsigned discard_passdown_original:1;
 };
 
 struct pool {
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -1650,6 +1656,7 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; static void pool_features_init(struct pool_features *pf)
 pf-&amp;gt;zero_new_blocks = 1;
 pf-&amp;gt;discard_enabled = 1;
 pf-&amp;gt;discard_passdown = 1;
+pf-&amp;gt;discard_passdown_original = 1;
 }
 
 static void __pool_destroy(struct pool *pool)
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -1873,6 +1880,7 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; static int parse_pool_features(struct dm_arg_set *as, struct pool_features *pf,
 continue;
 } else if (!strcasecmp(arg_name, "no_discard_passdown")) {
 pf-&amp;gt;discard_passdown = 0;
+pf-&amp;gt;discard_passdown_original = 0;
 continue;
 }
 
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -2385,7 +2393,7 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; static int pool_status(struct dm_target *ti, status_type_t type,
        (unsigned long long)pt-&amp;gt;low_water_blocks);
 
 count = !pool-&amp;gt;pf.zero_new_blocks + !pool-&amp;gt;pf.discard_enabled +
-!pool-&amp;gt;pf.discard_passdown;
+!pool-&amp;gt;pf.discard_passdown_original;
 DMEMIT("%u ", count);
 
 if (!pool-&amp;gt;pf.zero_new_blocks)
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -2394,7 +2402,7 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; static int pool_status(struct dm_target *ti, status_type_t type,
 if (!pool-&amp;gt;pf.discard_enabled)
 DMEMIT("ignore_discard ");
 
-if (!pool-&amp;gt;pf.discard_passdown)
+if (!pool-&amp;gt;pf.discard_passdown_original)
 DMEMIT("no_discard_passdown ");
 
 break;
&lt;/pre&gt;</description>
    <dc:creator>Mike Snitzer</dc:creator>
    <dc:date>2012-05-18T03:00:59</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.linux.kernel.device-mapper.devel/15790">
    <title>[PATCH 00/13] Block cleanups (for bcache)</title>
    <link>http://comments.gmane.org/gmane.linux.kernel.device-mapper.devel/15790</link>
    <description>&lt;pre&gt;From: Kent Overstreet &amp;lt;koverstreet&amp;lt; at &amp;gt;google.com&amp;gt;

Couple related things in this patch series. This is mostly stuff I did for
bcache, polished/expanded up a bit:

 * Bio pool freeing. This moves freeing of bios allocated from bio pools into
   generic code.

 * Kill bi_destructor. That was Tejun's idea, but it turned out to be easier
   than I expected.

 * Improved bio splitting. This was originally part of bcache, but I pulled it
   out and replaced the existing bio splitting code with it.

 * Closures - this is from bcache. I didn't really need to use it for the next
   patch, but IMO it makes the code a bit more elegant.

 * Make generic_make_request() handle arbitrary size bios. I think this is
   going to enable a lot of cleanups in the future.

   The idea here isn't for generic_make_request() to be doing the splitting in
   practice long term, it's more just an intermediate stage. If this goes in, I
   think a lot of driver code - certainly a lot of virtual block drivers -
   could easily be made to handle arbitrary sized bios, and splitting will only
   happen when a bio is being redirected to two different devices or something
   like that. But this should enable a lot of cleanups without having to change
   every block driver first.

Kent Overstreet (13):
  block: Generalized bio pool freeing
  dm: kill dm_rq_bio_destructor
  block: Add bio_clone_bioset()
  block: Add bio_clone_kmalloc()
  block: Only clone bio vecs that are in use
  block: Add bio_reset()
  pktcdvd: Switch to bio_kmalloc()
  block: Kill bi_destructor
  block: Add an explicit bio flag for bios that own their bvec
  block: Rework bio splitting
  Closures
  Make generic_make_request handle arbitrarily large bios
  Gut bio_add_page()

 Documentation/block/biodoc.txt      |    5 -
 block/blk-core.c                    |  119 +++++++-
 drivers/block/drbd/drbd_req.c       |   18 +-
 drivers/block/osdblk.c              |    3 +-
 drivers/block/pktcdvd.c             |  121 +++-----
 drivers/block/rbd.c                 |   12 +-
 drivers/md/dm-crypt.c               |    9 -
 drivers/md/dm-io.c                  |   11 -
 drivers/md/dm.c                     |   48 +--
 drivers/md/linear.c                 |    6 +-
 drivers/md/md.c                     |   42 +---
 drivers/md/raid0.c                  |    8 +-
 drivers/md/raid10.c                 |   23 +-
 drivers/target/target_core_iblock.c |    9 -
 fs/bio-integrity.c                  |   44 ---
 fs/bio.c                            |  407 ++++++++++++-----------
 fs/exofs/ore.c                      |    5 +-
 include/linux/bio.h                 |   37 ++-
 include/linux/blk_types.h           |    9 +-
 include/linux/blkdev.h              |    3 +
 include/linux/closure.h             |  614 +++++++++++++++++++++++++++++++++++
 lib/Kconfig.debug                   |    8 +
 lib/Makefile                        |    2 +-
 lib/closure.c                       |  363 +++++++++++++++++++++
 24 files changed, 1419 insertions(+), 507 deletions(-)
 create mode 100644 include/linux/closure.h
 create mode 100644 lib/closure.c

&lt;/pre&gt;</description>
    <dc:creator>koverstreet&lt; at &gt;google.com</dc:creator>
    <dc:date>2012-05-18T02:59:47</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.linux.kernel.device-mapper.devel/15783">
    <title>multipathd: 8:80 mark as failed - BUG: unable to handle kernel NULL pointer dereference at (null)</title>
    <link>http://comments.gmane.org/gmane.linux.kernel.device-mapper.devel/15783</link>
    <description>&lt;pre&gt;Hello,
I've compiled and installed on January on Opensuse 11.4 x64 from
git://git.kernel.org/pub/scm/linux/storage/multipath/hare/multipath-tools.git
the multipath-tools but previous 14 of May the module hang as described
below.
Now I've got
git-clone -b sles11-sp2
git://git.kernel.org/pub/scm/linux/storage/multipath/hare/multipath-tools.git
.
and reinstalled, but I'd like to know if this problem was already resolved.

Regards,
Roberto.

/May 14 10:39:20 nodo4 multipathd: 8:80: mark as failed
May 14 10:39:20 nodo4 multipathd: xenimages2: remaining active paths: 3
May 14 10:39:20 nodo4 kernel: [9480398.044082]  rport-3:0-1: blocked FC
remote port time out: removing target and saving binding
May 14 10:39:20 nodo4 kernel: [9480398.044146]  rport-3:0-0: blocked FC
remote port time out: removing target and saving binding
May 14 10:39:20 nodo4 kernel: [9480398.044238] sd 3:0:1:0: [sdf]
Unhandled error code
May 14 10:39:20 nodo4 kernel: [9480398.044241] sd 3:0:1:0: [sdf] 
Result: hostbyte=DID_NO_CONNECT driverbyte=DRIVER_OK
May 14 10:39:20 nodo4 kernel: [9480398.044245] sd 3:0:1:0: [sdf] CDB:
Write(10): 2a 00 00 17 a8 28 00 00 08 00
May 14 10:39:20 nodo4 kernel: [9480398.044254] end_request: I/O error,
dev sdf, sector 1550376
May 14 10:39:20 nodo4 kernel: [9480398.044267] device-mapper: multipath:
Failing path 8:80.
May 14 10:39:20 nodo4 multipathd: sdf: remove path (uevent)
May 14 10:39:20 nodo4 kernel: [9480398.076176] sd 3:0:1:0: [sdf]
Synchronizing SCSI cache
May 14 10:39:20 nodo4 kernel: [9480398.076246] sd 3:0:1:0: [sdf] 
Result: hostbyte=DID_NO_CONNECT driverbyte=DRIVER_OK
May 14 10:39:20 nodo4 kernel: [9480398.108164] sd 3:0:1:1: [sdh]
Synchronizing SCSI cache
May 14 10:39:20 nodo4 kernel: [9480398.108211] sd 3:0:1:1: [sdh] 
Result: hostbyte=DID_NO_CONNECT driverbyte=DRIVER_OK
May 14 10:39:20 nodo4 kernel: [9480398.132151] sd 3:0:0:0: [sdb]
Synchronizing SCSI cache
May 14 10:39:20 nodo4 kernel: [9480398.132192] sd 3:0:0:0: [sdb] 
Result: hostbyte=DID_NO_CONNECT driverbyte=DRIVER_OK
May 14 10:39:20 nodo4 kernel: [9480398.164158] sd 3:0:0:1: [sdd]
Synchronizing SCSI cache
May 14 10:39:20 nodo4 kernel: [9480398.164200] sd 3:0:0:1: [sdd] 
Result: hostbyte=DID_NO_CONNECT driverbyte=DRIVER_OK
May 14 10:39:20 nodo4 multipathd: xenimages2: load table [0 419430400
multipath 1 queue_if_no_path 1 rdac 2 1 round-robin 0 1 1 8:32 1
round-robin 0 2 1 8:16 1 8:96 1]
May 14 10:39:20 nodo4 multipathd: sdf: path removed from map xenimages2
May 14 10:39:20 nodo4 multipathd: sdh: remove path (uevent)
May 14 10:39:20 nodo4 kernel: [9480398.172072]  rport-4:0-0: blocked FC
remote port time out: removing target and saving binding
May 14 10:39:20 nodo4 kernel: [9480398.172111]  rport-4:0-1: blocked FC
remote port time out: removing target and saving binding
May 14 10:39:20 nodo4 kernel: [9480398.172144] sd 4:0:0:0: [sdc]
Unhandled error code
May 14 10:39:20 nodo4 kernel: [9480398.172146] sd 4:0:0:0: [sdc] 
Result: hostbyte=DID_NO_CONNECT driverbyte=DRIVER_OK
May 14 10:39:20 nodo4 kernel: [9480398.172150] sd 4:0:0:0: [sdc] CDB:
Write(10): 2a 00 00 17 a8 28 00 00 08 00
May 14 10:39:20 nodo4 kernel: [9480398.172158] end_request: I/O error,
dev sdc, sector 1550376
May 14 10:39:20 nodo4 kernel: [9480398.172166] device-mapper: multipath:
Failing path 8:32.
May 14 10:39:20 nodo4 kernel: [9480398.172685] device-mapper: multipath:
Failing path 8:32.
May 14 10:39:20 nodo4 kernel: [9480398.172752] scsi 3:0:0:0: rejecting
I/O to dead device
May 14 10:39:20 nodo4 kernel: [9480398.172758] device-mapper: multipath:
Failing path 8:16.
May 14 10:39:20 nodo4 kernel: [9480398.172818] device-mapper: multipath:
Failing path 8:96.
May 14 10:39:20 nodo4 kernel: [9480398.174732] device-mapper: multipath:
Failing path 8:32.
May 14 10:39:20 nodo4 kernel: [9480398.174789] scsi 3:0:0:0: rejecting
I/O to dead device
May 14 10:39:20 nodo4 kernel: [9480398.174793] device-mapper: multipath:
Failing path 8:16.
May 14 10:39:20 nodo4 kernel: [9480398.174816] device-mapper: multipath:
Failing path 8:96.
May 14 10:39:20 nodo4 kernel: [9480398.181204] device-mapper: multipath:
adding disabled device 8:48
May 14 10:39:20 nodo4 kernel: [9480398.181565] BUG: unable to handle
kernel NULL pointer dereference at           (null)
May 14 10:39:20 nodo4 kernel: [9480398.181582] IP: [&amp;lt;ffffffffa0843a63&amp;gt;]
dm_set_device_limits+0x23/0x140 [dm_mod]
May 14 10:39:20 nodo4 kernel: [9480398.181601] PGD 34c6f5067 PUD
34be31067 PMD 0
May 14 10:39:20 nodo4 kernel: [9480398.181608] Oops: 0000 [#1] SMP
May 14 10:39:20 nodo4 kernel: [9480398.181613] last sysfs file:
/sys/module/scsi_dh_rdac/initstate
May 14 10:39:20 nodo4 kernel: [9480398.181618] CPU 0
May 14 10:39:20 nodo4 kernel: [9480398.181620] Modules linked in:
af_packet loop 8021q garp ocfs2 ocfs2_nodemanager quota_tree
ocfs2_stack_user ocfs2_stackglue dlm configfs scsi_dh_rdac
dm_round_robin nbd usbbk netbk dm_multipath blkbk blkback_pagemap blktap
domctl scsi_dh xenbus_be gntdev evtchn bridge stp llc bonding edd ext4
jbd2 crc16 dm_mod 8250_pnp i5k_amb e1000e ses bnx2 iTCO_wdt
iTCO_vendor_support ibmpex ibmaem qla2xxx sg sr_mod 8250 enclosure
pcspkr ipmi_msghandler i5000_edac ioatdma i2c_i801 ics932s401 joydev
edac_core shpchp pci_hotplug serio_raw button serial_core reiserfs
usbhid hid uhci_hcd radeon ttm drm_kms_helper drm i2c_algo_bit ehci_hcd
usbcore i2c_core xenblk cdrom xennet fan processor ata_generic thermal
thermal_sys hwmon aacraid
May 14 10:39:20 nodo4 kernel: [9480398.181723]
May 14 10:39:20 nodo4 kernel: [9480398.181727] Pid: 3608, comm:
multipathd Not tainted 2.6.37.6-0.9-xen #1 IBM IBM System x3650
-[7979AC1]-/System Planar
May 14 10:39:20 nodo4 kernel: [9480398.181737] RIP:
e030:[&amp;lt;ffffffffa0843a63&amp;gt;]  [&amp;lt;ffffffffa0843a63&amp;gt;]
dm_set_device_limits+0x23/0x140 [dm_mod]
May 14 10:39:20 nodo4 kernel: [9480398.181748] RSP:
e02b:ffff88034cdddc78  EFLAGS: 00010296
May 14 10:39:20 nodo4 kernel: [9480398.181752] RAX: ffff88020f3b5b40
RBX: ffff88020f3b5bc0 RCX: 0000000000200000
May 14 10:39:20 nodo4 kernel: [9480398.181757] RDX: 0000000000000000
RSI: 0000000000000000 RDI: ffffc9000007d040
May 14 10:39:20 nodo4 kernel: [9480398.181761] RBP: ffffc9000007d040
R08: ffff88034cdddd58 R09: 0000000000000200
May 14 10:39:20 nodo4 kernel: [9480398.181766] R10: 0000000000000008
R11: 00003ffffffff000 R12: ffff88020f3b5c78
May 14 10:39:20 nodo4 kernel: [9480398.181771] R13: 0000000000000000
R14: ffff88034cdddd58 R15: ffff88020f3b5c40
May 14 10:39:20 nodo4 kernel: [9480398.181779] FS: 
00007fd29961d700(0000) GS:ffff8803602bf000(0000) knlGS:0000000000000000
May 14 10:39:20 nodo4 kernel: [9480398.181785] CS:  e033 DS: 0000 ES:
0000 CR0: 0000000080050033
May 14 10:39:20 nodo4 kernel: [9480398.181789] CR2: 0000000000000000
CR3: 000000034e657000 CR4: 0000000000042660
May 14 10:39:20 nodo4 kernel: [9480398.181794] DR0: 0000000000000000
DR1: 0000000000000000 DR2: 0000000000000000
May 14 10:39:20 nodo4 kernel: [9480398.181799] DR3: 0000000000000000
DR6: 00000000ffff0ff0 DR7: 0000000000000400
May 14 10:39:20 nodo4 kernel: [9480398.181804] Process multipathd (pid:
3608, threadinfo ffff88034cddc000, task ffff88034cdda780)
May 14 10:39:20 nodo4 kernel: [9480398.181809] Stack:
May 14 10:39:20 nodo4 kernel: [9480398.181811]  00000000000000d2
ffff880351c50b80 ffff88034cdddcc8 0000000000000007
May 14 10:39:20 nodo4 kernel: [9480398.181819]  ffff880351c50bf0
0000000000000001 ffff880351c50ba0 ffffffff8005e61f
May 14 10:39:20 nodo4 kernel: [9480398.181827]  ffff88034cdddce8
ffffffff8002e082 ffff88020f3b5bc0 ffffc9000007d040
May 14 10:39:20 nodo4 kernel: [9480398.181834] Call Trace:
May 14 10:39:20 nodo4 kernel: [9480398.181864]  [&amp;lt;ffffffffa09c2425&amp;gt;]
multipath_iterate_devices+0x55/0x80 [dm_multipath]
May 14 10:39:20 nodo4 kernel: [9480398.181878]  [&amp;lt;ffffffffa084482c&amp;gt;]
dm_calculate_queue_limits+0x8c/0x130 [dm_mod]
May 14 10:39:20 nodo4 kernel: [9480398.181899]  [&amp;lt;ffffffffa084273b&amp;gt;]
dm_swap_table+0x6b/0x90 [dm_mod]
May 14 10:39:20 nodo4 kernel: [9480398.181915]  [&amp;lt;ffffffffa0847048&amp;gt;]
do_resume+0x88/0x1b0 [dm_mod]
May 14 10:39:20 nodo4 kernel: [9480398.181940]  [&amp;lt;ffffffffa0847e6c&amp;gt;]
ctl_ioctl+0x1ac/0x250 [dm_mod]
May 14 10:39:20 nodo4 kernel: [9480398.181966]  [&amp;lt;ffffffffa0847f1e&amp;gt;]
dm_ctl_ioctl+0xe/0x20 [dm_mod]
May 14 10:39:20 nodo4 kernel: [9480398.181992]  [&amp;lt;ffffffff8012da89&amp;gt;]
do_vfs_ioctl+0x89/0x340
May 14 10:39:20 nodo4 kernel: [9480398.182001]  [&amp;lt;ffffffff8012ddc0&amp;gt;]
sys_ioctl+0x80/0xa0
May 14 10:39:20 nodo4 kernel: [9480398.182009]  [&amp;lt;ffffffff80007448&amp;gt;]
system_call_fastpath+0x16/0x1b
May 14 10:39:20 nodo4 kernel: [9480398.182018]  [&amp;lt;00007fd29848ed87&amp;gt;]
0x7fd29848ed87
May 14 10:39:20 nodo4 kernel: [9480398.182021] Code: fd ff ff 0f 1f 44
00 00 48 83 ec 78 48 89 6c 24 58 4c 89 64 24 60 48 89 fd 4c 89 6c 24 68
48 89 5c 24 50 49 89 d5 4c 89 74 24 70 &amp;lt;4c&amp;gt; 8b 36 4d 89 c4 49 8b 86 a0
00 00 00 48 8b 98 10 03 00 00 48
May 14 10:39:20 nodo4 kernel: [9480398.182074] RIP  [&amp;lt;ffffffffa0843a63&amp;gt;]
dm_set_device_limits+0x23/0x140 [dm_mod]
May 14 10:39:20 nodo4 kernel: [9480398.182083]  RSP &amp;lt;ffff88034cdddc78&amp;gt;
May 14 10:39:20 nodo4 kernel: [9480398.182086] CR2: 0000000000000000
May 14 10:39:20 nodo4 kernel: [9480398.182666] ---[ end trace
47ea050a3e10cad9 ]---
May 14 10:39:20 nodo4 kernel: [9480398.216228] sd 4:0:0:0: [sdc]
Synchronizing SCSI cache
May 14 10:39:20 nodo4 kernel: [9480398.216281] sd 4:0:0:0: [sdc] 
Result: hostbyte=DID_NO_CONNECT driverbyte=DRIVER_OK
May 14 10:39:21 nodo4 kernel: [9480398.244149] sd 4:0:0:1: [sde]
Synchronizing SCSI cache
May 14 10:39:21 nodo4 kernel: [9480398.244188] sd 4:0:0:1: [sde] 
Result: hostbyte=DID_NO_CONNECT driverbyte=DRIVER_OK
May 14 10:39:21 nodo4 kernel: [9480398.276178] sd 4:0:1:0: [sdg]
Synchronizing SCSI cache
May 14 10:39:21 nodo4 kernel: [9480398.276218] sd 4:0:1:0: [sdg] 
Result: hostbyte=DID_NO_CONNECT driverbyte=DRIVER_OK
May 14 10:39:21 nodo4 kernel: [9480398.312146] sd 4:0:1:1: [sdi]
Synchronizing SCSI cache
May 14 10:39:21 nodo4 kernel: [9480398.312185] sd 4:0:1:1: [sdi] 
Result: hostbyte=DID_NO_CONNECT driverbyte=DRIVER_OK
May 14 10:39:43 nodo4 kernel: [9480420.907033] scsi 3:0:0:0:
Direct-Access     IBM      1726-4xx  FAStT  0617 PQ: 0 ANSI: 5
May 14 10:39:43 nodo4 kernel: [9480420.907804] scsi 3:0:0:0: rdac: LUN 0
(unowned)
May 14 10:39:43 nodo4 kernel: [9480420.908038] sd 3:0:0:0: Attached scsi
generic sg8 type 0
May 14 10:39:43 nodo4 kernel: [9480420.908044] sd 3:0:0:0: Embedded
Enclosure Device
May 14 10:39:44 nodo4 kernel: [9480421.369100] scsi 4:0:0:0:
Direct-Access     IBM      1726-4xx  FAStT  0617 PQ: 0 ANSI: 5
May 14 10:39:44 nodo4 kernel: [9480421.369856] scsi 4:0:0:0: rdac: LUN 0
(owned)
May 14 10:39:44 nodo4 kernel: [9480421.904087] sd 3:0:0:0: Failed to get
diagnostic page 0x10000
May 14 10:39:44 nodo4 kernel: [9480421.904094] sd 3:0:0:0: Failed to
bind enclosure -19
May 14 10:39:44 nodo4 kernel: [9480421.904268] sd 4:0:0:0: Attached scsi
generic sg9 type 0
May 14 10:39:44 nodo4 kernel: [9480421.904285] sd 4:0:0:0: Embedded
Enclosure Device
May 14 10:39:44 nodo4 kernel: [9480421.911840] scsi 3:0:0:1:
Direct-Access     IBM      1726-4xx  FAStT  0617 PQ: 0 ANSI: 5
May 14 10:39:44 nodo4 kernel: [9480421.912615] scsi 3:0:0:1: rdac: LUN 1
(unowned)
May 14 10:40:12 nodo4 kernel: [9480449.864814] sd 3:0:0:0: [sdf]
419430400 512-byte logical blocks: (214 GB/200 GiB)
May 14 10:40:24 nodo4 kernel: [9480462.172112] sd 3:0:0:0: [sdf] Write
Protect is off
May 14 10:40:24 nodo4 kernel: [9480462.172126] sd 3:0:0:0: [sdf] Mode
Sense: 77 00 10 08
May 14 10:40:24 nodo4 kernel: [9480462.172262] sd 3:0:0:1: [sdk] 2097152
512-byte logical blocks: (1.07 GB/1.00 GiB)
May 14 10:40:24 nodo4 kernel: [9480462.209408] sd 3:0:0:0: [sdf] Write
cache: enabled, read cache: enabled, supports DPO and FUA
May 14 10:40:25 nodo4 kernel: [9480462.238939] sd 3:0:0:1: [sdk] Write
Protect is off
May 14 10:40:25 nodo4 kernel: [9480462.238945] sd 3:0:0:1: [sdk] Mode
Sense: 77 00 10 08
May 14 10:40:25 nodo4 kernel: [9480462.260063] sd 3:0:0:1: [sdk] Write
cache: enabled, read cache: enabled, supports DPO and FUA
May 14 10:40:25 nodo4 kernel: [9480462.282119]
ldm_validate_partition_table(): Disk read failed.
May 14 10:40:25 nodo4 kernel: [9480462.282206]  sdf: unable to read
partition table
May 14 10:40:25 nodo4 kernel: [9480462.299524]
ldm_validate_partition_table(): Disk read failed.
May 14 10:40:25 nodo4 kernel: [9480462.299608]  sdk: unable to read
partition table
May 14 10:40:25 nodo4 kernel: [9480462.334705] sd 3:0:0:0: [sdf]
Attached SCSI disk
May 14 10:40:25 nodo4 kernel: [9480462.346239] sd 3:0:0:1: [sdk]
Attached SCSI disk
May 14 10:40:42 nodo4 kernel: [9480480.156067]  rport-3:0-1: blocked FC
remote port time out: removing target and saving binding
May 14 10:40:42 nodo4 kernel: [9480480.220064]  rport-4:0-0: blocked FC
remote port time out: removing target and saving binding
May 14 10:40:42 nodo4 kernel: [9480480.220133] sd 4:0:0:0: Failed to get
diagnostic page 0x10000
May 14 10:40:42 nodo4 kernel: [9480480.220151] sd 4:0:0:0: Failed to
bind enclosure -19
May 14 10:40:42 nodo4 kernel: [9480480.220166] sd 4:0:0:0: [sdj] READ
CAPACITY(16) failed
May 14 10:40:42 nodo4 kernel: [9480480.220178] sd 4:0:0:0: [sdj] 
Result: hostbyte=DID_NO_CONNECT driverbyte=DRIVER_OK
May 14 10:40:42 nodo4 kernel: [9480480.220186] sd 4:0:0:0: [sdj] Sense
not available.
May 14 10:40:42 nodo4 kernel: [9480480.220218] sd 4:0:0:0: [sdj] READ
CAPACITY failed
May 14 10:40:42 nodo4 kernel: [9480480.220222] sd 4:0:0:0: [sdj] 
Result: hostbyte=DID_NO_CONNECT driverbyte=DRIVER_OK
May 14 10:40:42 nodo4 kernel: [9480480.220229] sd 4:0:0:0: [sdj] Sense
not available.
May 14 10:40:42 nodo4 kernel: [9480480.220263] sd 4:0:0:0: [sdj] Write
Protect is off
May 14 10:40:42 nodo4 kernel: [9480480.220269] sd 4:0:0:0: [sdj] Mode
Sense: 00 00 00 00
May 14 10:40:42 nodo4 kernel: [9480480.220284] sd 4:0:0:0: [sdj] Asking
for cache data failed
May 14 10:40:42 nodo4 kernel: [9480480.220288] sd 4:0:0:0: [sdj]
Assuming drive cache: write through
May 14 10:40:42 nodo4 kernel: [9480480.220497] sd 3:0:0:1: Attached scsi
generic sg10 type 0
May 14 10:40:42 nodo4 kernel: [9480480.220509] sd 3:0:0:1: Embedded
Enclosure Device
May 14 10:40:42 nodo4 kernel: [9480480.220623] sd 4:0:0:0: [sdj] READ
CAPACITY(16) failed
May 14 10:40:42 nodo4 kernel: [9480480.220634] sd 4:0:0:0: [sdj] 
Result: hostbyte=DID_NO_CONNECT driverbyte=DRIVER_OK
May 14 10:40:42 nodo4 kernel: [9480480.220641] sd 4:0:0:0: [sdj] Sense
not available.
May 14 10:40:42 nodo4 kernel: [9480480.220675] sd 4:0:0:0: [sdj] READ
CAPACITY failed
May 14 10:40:42 nodo4 kernel: [9480480.220679] sd 4:0:0:0: [sdj] 
Result: hostbyte=DID_NO_CONNECT driverbyte=DRIVER_OK
May 14 10:40:42 nodo4 kernel: [9480480.220685] sd 4:0:0:0: [sdj] Sense
not available.
May 14 10:40:42 nodo4 kernel: [9480480.220726] sd 4:0:0:0: [sdj] Asking
for cache data failed
May 14 10:40:42 nodo4 kernel: [9480480.220731] sd 4:0:0:0: [sdj]
Assuming drive cache: write through
May 14 10:40:42 nodo4 kernel: [9480480.220735] sd 4:0:0:0: [sdj]
Attached SCSI disk
May 14 10:40:43 nodo4 kernel: [9480480.224842] scsi 4:0:1:0:
Direct-Access     IBM      1726-4xx  FAStT  0617 PQ: 0 ANSI: 5
May 14 10:40:43 nodo4 kernel: [9480480.226028] scsi 4:0:1:0: rdac: LUN 0
(owned)
May 14 10:40:43 nodo4 kernel: [9480480.226896] sd 4:0:1:0: [sdl]
419430400 512-byte logical blocks: (214 GB/200 GiB)
May 14 10:40:43 nodo4 kernel: [9480480.228114] sd 4:0:1:0: [sdl] Write
Protect is off
May 14 10:40:43 nodo4 kernel: [9480480.228121] sd 4:0:1:0: [sdl] Mode
Sense: 77 00 10 08
May 14 10:40:43 nodo4 kernel: [9480480.228481] sd 4:0:1:0: [sdl] Write
cache: enabled, read cache: enabled, supports DPO and FUA
May 14 10:40:43 nodo4 kernel: [9480480.230883]  sdl: sdl1
May 14 10:40:43 nodo4 kernel: [9480480.234706] sd 4:0:1:0: [sdl]
Attached SCSI disk
May 14 10:40:43 nodo4 kernel: [9480480.484994] sd 3:0:0:1: FIXME driver
has no support for subenclosures (1)
May 14 10:40:43 nodo4 kernel: [9480480.485001] sd 3:0:0:1: Failed to
bind enclosure -12
May 14 10:40:43 nodo4 kernel: [9480480.485222] sd 4:0:1:0: Attached scsi
generic sg11 type 0
May 14 10:40:43 nodo4 kernel: [9480480.485228] sd 4:0:1:0: Embedded
Enclosure Device
May 14 10:40:43 nodo4 kernel: [9480480.486067] scsi 3:0:0:31:
Direct-Access     IBM      Universal Xport  0617 PQ: 0 ANSI: 5
May 14 10:40:43 nodo4 kernel: [9480480.772006] sd 4:0:1:0: FIXME driver
has no support for subenclosures (1)
May 14 10:40:43 nodo4 kernel: [9480480.772013] sd 4:0:1:0: Failed to
bind enclosure -12
May 14 10:40:43 nodo4 kernel: [9480480.772173] scsi 3:0:0:31: Attached
scsi generic sg12 type 0
May 14 10:40:43 nodo4 kernel: [9480480.772187] scsi 3:0:0:31: Embedded
Enclosure Device
May 14 10:40:43 nodo4 kernel: [9480480.772708] scsi 3:0:0:31: Failed to
get diagnostic page 0x8000002
May 14 10:40:43 nodo4 kernel: [9480480.772714] scsi 3:0:0:31: Failed to
bind enclosure -19
May 14 10:40:43 nodo4 kernel: [9480480.783457] scsi 4:0:1:1:
Direct-Access     IBM      1726-4xx  FAStT  0617 PQ: 0 ANSI: 5
May 14 10:40:43 nodo4 kernel: [9480480.802754] scsi 4:0:1:1: rdac: LUN 1
(owned)
May 14 10:40:43 nodo4 kernel: [9480480.802898] sd 4:0:1:1: Attached scsi
generic sg13 type 0
May 14 10:40:43 nodo4 kernel: [9480480.802904] sd 4:0:1:1: Embedded
Enclosure Device
May 14 10:40:43 nodo4 kernel: [9480480.803595] sd 4:0:1:1: Failed to get
diagnostic page 0x8000002
May 14 10:40:43 nodo4 kernel: [9480480.803601] sd 4:0:1:1: Failed to
bind enclosure -19
May 14 10:40:43 nodo4 kernel: [9480480.804166] sd 4:0:1:1: [sdm] 2097152
512-byte logical blocks: (1.07 GB/1.00 GiB)
May 14 10:40:43 nodo4 kernel: [9480480.804492] scsi 4:0:1:31:
Direct-Access     IBM      Universal Xport  0617 PQ: 0 ANSI: 5
May 14 10:40:43 nodo4 kernel: [9480480.804891] scsi 4:0:1:31: Attached
scsi generic sg14 type 0
May 14 10:40:43 nodo4 kernel: [9480480.804896] scsi 4:0:1:31: Embedded
Enclosure Device
May 14 10:40:43 nodo4 kernel: [9480480.805276] scsi 4:0:1:31: Failed to
get diagnostic page 0x8000002
May 14 10:40:43 nodo4 kernel: [9480480.805282] scsi 4:0:1:31: Failed to
bind enclosure -19
May 14 10:40:43 nodo4 kernel: [9480480.805602] sd 4:0:0:0: rdac: Detached
May 14 10:40:43 nodo4 kernel: [9480480.806204] sd 4:0:1:1: [sdm] Write
Protect is off
May 14 10:40:43 nodo4 kernel: [9480480.806216] sd 4:0:1:1: [sdm] Mode
Sense: 77 00 10 08
May 14 10:40:43 nodo4 kernel: [9480480.806609] sd 4:0:1:1: [sdm] Write
cache: enabled, read cache: enabled, supports DPO and FUA
May 14 10:40:43 nodo4 kernel: [9480480.808631]  sdm: sdm1
May 14 10:40:43 nodo4 kernel: [9480480.810486] sd 4:0:1:1: [sdm]
Attached SCSI disk
May 14 10:41:17 nodo4 kernel: [9480514.905354] scsi 3:0:1:0:
Direct-Access     IBM      1726-4xx  FAStT  0617 PQ: 0 ANSI: 5
May 14 10:41:17 nodo4 kernel: [9480514.906146] scsi 3:0:1:0: rdac: LUN 0
(unowned)
May 14 10:41:17 nodo4 kernel: [9480514.906376] sd 3:0:1:0: Attached scsi
generic sg9 type 0
May 14 10:41:17 nodo4 kernel: [9480514.906381] sd 3:0:1:0: Embedded
Enclosure Device
May 14 10:41:18 nodo4 kernel: [9480515.369473] scsi 4:0:0:0:
Direct-Access     IBM      1726-4xx  FAStT  0617 PQ: 0 ANSI: 5
May 14 10:41:18 nodo4 kernel: [9480515.370229] scsi 4:0:0:0: rdac: LUN 0
(unowned)
May 14 10:41:46 nodo4 kernel: [9480543.616449] sd 4:0:0:0: [sdn]
419430400 512-byte logical blocks: (214 GB/200 GiB)
May 14 10:41:46 nodo4 kernel: [9480543.616528] sd 3:0:1:0: [sdj]
419430400 512-byte logical blocks: (214 GB/200 GiB)
May 14 10:41:46 nodo4 kernel: [9480543.683122] sd 3:0:1:0: FIXME driver
has no support for subenclosures (1)
May 14 10:41:46 nodo4 kernel: [9480543.683128] sd 3:0:1:0: Failed to
bind enclosure -12
May 14 10:41:46 nodo4 kernel: [9480543.683369] sd 4:0:0:0: Attached scsi
generic sg15 type 0
May 14 10:41:46 nodo4 kernel: [9480543.683375] sd 4:0:0:0: Embedded
Enclosure Device
May 14 10:41:46 nodo4 kernel: [9480544.223913] sd 4:0:0:0: [sdn] Write
Protect is off
May 14 10:41:46 nodo4 kernel: [9480544.223920] sd 4:0:0:0: [sdn] Mode
Sense: 77 00 10 08
May 14 10:41:47 nodo4 kernel: [9480544.224710] sd 3:0:1:0: [sdj] Write
Protect is off
May 14 10:41:47 nodo4 kernel: [9480544.224716] sd 3:0:1:0: [sdj] Mode
Sense: 77 00 10 08
May 14 10:41:47 nodo4 kernel: [9480544.240556] scsi 3:0:1:1:
Direct-Access     IBM      1726-4xx  FAStT  0617 PQ: 0 ANSI: 5
May 14 10:41:47 nodo4 kernel: [9480544.259638] sd 4:0:0:0: [sdn] Write
cache: enabled, read cache: enabled, supports DPO and FUA
May 14 10:41:47 nodo4 kernel: [9480544.260276] sd 3:0:1:0: [sdj] Write
cache: enabled, read cache: enabled, supports DPO and FUA
May 14 10:41:48 nodo4 kernel: [9480546.038746] sd 4:0:0:0: FIXME driver
has no support for subenclosures (1)
May 14 10:41:48 nodo4 kernel: [9480546.038754] sd 4:0:0:0: Failed to
bind enclosure -12
May 14 10:41:48 nodo4 kernel: [9480546.039500] scsi 3:0:1:1: rdac: LUN 1
(unowned)
May 14 10:41:48 nodo4 kernel: [9480546.039678] sd 3:0:1:1: Attached scsi
generic sg16 type 0
May 14 10:41:48 nodo4 kernel: [9480546.039684] sd 3:0:1:1: Embedded
Enclosure Device
May 14 10:41:48 nodo4 kernel: [9480546.087292] scsi 4:0:0:1:
Direct-Access     IBM      1726-4xx  FAStT  0617 PQ: 0 ANSI: 5
May 14 10:41:48 nodo4 kernel: [9480546.094112]
ldm_validate_partition_table(): Disk read failed.
May 14 10:41:48 nodo4 kernel: [9480546.094271]
ldm_validate_partition_table(): Disk read failed.
May 14 10:41:48 nodo4 kernel: [9480546.094357]  sdj: unable to read
partition table
May 14 10:41:48 nodo4 kernel: [9480546.094464]  sdn: unable to read
partition table
May 14 10:41:48 nodo4 kernel: [9480546.104559] scsi 4:0:0:1: rdac: LUN 1
(unowned)
May 14 10:41:49 nodo4 kernel: [9480546.287268] sd 3:0:1:1: FIXME driver
has no support for subenclosures (1)
May 14 10:41:49 nodo4 kernel: [9480546.287274] sd 3:0:1:1: Failed to
bind enclosure -12
May 14 10:41:49 nodo4 kernel: [9480546.287434] sd 4:0:0:1: Attached scsi
generic sg17 type 0
May 14 10:41:49 nodo4 kernel: [9480546.287440] sd 4:0:0:1: Embedded
Enclosure Device
May 14 10:41:49 nodo4 kernel: [9480546.303619] sd 4:0:0:1: [sdp] 2097152
512-byte logical blocks: (1.07 GB/1.00 GiB)
May 14 10:41:49 nodo4 kernel: [9480546.304315] sd 3:0:1:1: [sdo] 2097152
512-byte logical blocks: (1.07 GB/1.00 GiB)
May 14 10:41:49 nodo4 kernel: [9480546.305037] scsi 3:0:1:31:
Direct-Access     IBM      Universal Xport  0617 PQ: 0 ANSI: 5
May 14 10:41:49 nodo4 kernel: [9480546.310818] sd 4:0:0:0: [sdn]
Attached SCSI disk
May 14 10:41:49 nodo4 kernel: [9480546.311119] sd 3:0:1:0: [sdj]
Attached SCSI disk
May 14 10:41:49 nodo4 kernel: [9480546.325288] sd 4:0:0:1: [sdp] Write
Protect is off
May 14 10:41:49 nodo4 kernel: [9480546.325295] sd 4:0:0:1: [sdp] Mode
Sense: 77 00 10 08
May 14 10:41:49 nodo4 kernel: [9480546.325684] sd 3:0:1:1: [sdo] Write
Protect is off
May 14 10:41:49 nodo4 kernel: [9480546.325689] sd 3:0:1:1: [sdo] Mode
Sense: 77 00 10 08
May 14 10:41:49 nodo4 kernel: [9480546.330743] sd 4:0:0:1: [sdp] Write
cache: enabled, read cache: enabled, supports DPO and FUA
May 14 10:41:49 nodo4 kernel: [9480546.331160] sd 3:0:1:1: [sdo] Write
cache: enabled, read cache: enabled, supports DPO and FUA
May 14 10:41:49 nodo4 kernel: [9480546.656447]
ldm_validate_partition_table(): Disk read failed.
May 14 10:41:49 nodo4 kernel: [9480546.656584]
ldm_validate_partition_table(): Disk read failed.
May 14 10:41:49 nodo4 kernel: [9480546.656668]  sdo: unable to read
partition table
May 14 10:41:49 nodo4 kernel: [9480546.656797]  sdp: unable to read
partition table
May 14 10:41:49 nodo4 kernel: [9480546.673418] sd 4:0:0:1: FIXME driver
has no support for subenclosures (1)
May 14 10:41:49 nodo4 kernel: [9480546.673431] sd 4:0:0:1: Failed to
bind enclosure -12
May 14 10:41:49 nodo4 kernel: [9480546.673645] scsi 3:0:1:31: Attached
scsi generic sg18 type 0
May 14 10:41:49 nodo4 kernel: [9480546.673653] scsi 3:0:1:31: Embedded
Enclosure Device
May 14 10:41:49 nodo4 kernel: [9480546.674071] scsi 3:0:1:31: Failed to
get diagnostic page 0x8000002
May 14 10:41:49 nodo4 kernel: [9480546.674076] scsi 3:0:1:31: Failed to
bind enclosure -19
May 14 10:41:49 nodo4 kernel: [9480546.674709] sd 3:0:1:1: [sdo]
Attached SCSI disk
May 14 10:41:49 nodo4 kernel: [9480546.675193] sd 4:0:0:1: [sdp]
Attached SCSI disk
May 14 10:41:49 nodo4 kernel: [9480546.676734] scsi 4:0:0:31:
Direct-Access     IBM      Universal Xport  0617 PQ: 0 ANSI: 5
May 14 10:41:49 nodo4 kernel: [9480546.676886] scsi 4:0:0:31: Attached
scsi generic sg19 type 0
May 14 10:41:49 nodo4 kernel: [9480546.676891] scsi 4:0:0:31: Embedded
Enclosure Device
May 14 10:41:49 nodo4 kernel: [9480546.677767] scsi 4:0:0:31: Failed to
get diagnostic page 0x8000002
May 14 10:41:49 nodo4 kernel: [9480546.677773] scsi 4:0:0:31: Failed to
bind enclosure -19
May 14 10:41:49 nodo4 udevd-work[2477]: symlink '../../sdo'
'/dev/disk/by-id/scsi-3600a0b80003696ab000014c64ef2ee5b.udev-tmp'
failed: File exists
May 14 10:42:20 nodo4 udevd[388]: worker [28740] unexpectedly returned
with status 0x0100
May 14 10:42:20 nodo4 udevd[388]: worker [28740] failed while handling
'/devices/virtual/block/dm-0'
May 14 10:44:59 nodo4 smartd[3504]: Device: /dev/sdb, open() failed: No
such device
May 14 10:44:59 nodo4 smartd[3504]: Device: /dev/sdc, open() failed: No
such device
May 14 10:44:59 nodo4 smartd[3504]: Device: /dev/sdd, open() failed: No
such device
May 14 10:44:59 nodo4 smartd[3504]: Device: /dev/sde, open() failed: No
such device
May 14 10:44:59 nodo4 smartd[3504]: Device: /dev/sdg, open() failed: No
such device
May 14 10:44:59 nodo4 smartd[3504]: Device: /dev/sdh, open() failed: No
such device
May 14 10:44:59 nodo4 smartd[3504]: Device: /dev/sdi, open() failed: No
such device






/
&lt;/pre&gt;</description>
    <dc:creator>Roberto Giordani</dc:creator>
    <dc:date>2012-05-17T09:56:46</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.linux.kernel.device-mapper.devel/15779">
    <title>[PATCH] [dm-thin] Allow userland access to metadata of alive thin provisioning pool</title>
    <link>http://comments.gmane.org/gmane.linux.kernel.device-mapper.devel/15779</link>
    <description>&lt;pre&gt;New feature.

This patch implements two new messages that can be sent to the thin
pool target allowing it to take a snapshot of the _metadata_.  This,
read-only snapshot can be accessed by userland, concurrently with the
live target.

Only one metadata snapshot can be held at a time.  The pool's status
line will give the block location for the current msnap.

The thin-provisioning-tools have been updated to v0.1.5.  The
thin_dump program can now be used to display the msnap.  eg,

    thin_dump -m &amp;lt;msnap root&amp;gt; &amp;lt;metadata dev&amp;gt;

Available here: https://github.com/jthornber/thin-provisioning-tools

Now that userland can access the metadata we can do various things
that have traditionally been kernel side tasks:

     i) Incremental backups.

     By using metadata snapshots we can work out what blocks have
     changed over time.  Combined with data snapshots we can ensure
     the data doesn't change while we back it up.

     A short proof of concept script can be found here:

     https://github.com/jthornber/thinp-test-suite/blob/master/incremental_backup_example.rb

     ii) Migration of thin devices from one pool to another.

     iii) Merging snapshots back into an external origin.

     iv) Asyncronous replication.
---
 Documentation/device-mapper/thin-provisioning.txt |   11 ++
 drivers/md/dm-thin-metadata.c                     |  128 ++++++++++++++++++++-
 drivers/md/dm-thin-metadata.h                     |   13 ++-
 drivers/md/dm-thin.c                              |   40 ++++++-
 4 files changed, 182 insertions(+), 10 deletions(-)

diff --git a/Documentation/device-mapper/thin-provisioning.txt b/Documentation/device-mapper/thin-provisioning.txt
index 3370bc4..897e66d 100644
--- a/Documentation/device-mapper/thin-provisioning.txt
+++ b/Documentation/device-mapper/thin-provisioning.txt
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -287,6 +287,17 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; iii) Messages
 the current transaction id is when you change it with this
 compare-and-swap message.
 
+    reserve_metadata_snap
+
+        Reserve a copy of the data mapping btree for use by userland.
+        This allows userland to inspect the mappings as they were when
+        this message was executed.  Use the pool's status command to
+        get the root block.
+
+    release_metadata_snap
+
+        Release a previously reserved copy of the data mapping btree.
+
 'thin' target
 -------------
 
diff --git a/drivers/md/dm-thin-metadata.c b/drivers/md/dm-thin-metadata.c
index 737d388..7e272e2 100644
--- a/drivers/md/dm-thin-metadata.c
+++ b/drivers/md/dm-thin-metadata.c
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -1082,12 +1082,82 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; int dm_pool_get_metadata_transaction_id(struct dm_pool_metadata *pmd,
 return 0;
 }
 
-static int __get_held_metadata_root(struct dm_pool_metadata *pmd,
-    dm_block_t *result)
+static int __reserve_metadata_snap(struct dm_pool_metadata *pmd)
+{
+int r, inc;
+struct thin_disk_superblock *disk_super;
+struct dm_block *copy, *sblock;
+dm_block_t held_root;
+
+/*
+ * Copy the superblock.
+ */
+dm_sm_inc_block(pmd-&amp;gt;metadata_sm, THIN_SUPERBLOCK_LOCATION);
+r = dm_tm_shadow_block(pmd-&amp;gt;tm, THIN_SUPERBLOCK_LOCATION, &amp;amp;sb_validator, &amp;amp;copy, &amp;amp;inc);
+if (r)
+return r;
+BUG_ON(!inc);
+
+held_root = dm_block_location(copy);
+disk_super = dm_block_data(copy);
+if (le64_to_cpu(disk_super-&amp;gt;held_root)) {
+DMWARN("pool already has a metadata snapshot");
+dm_tm_dec(pmd-&amp;gt;tm, held_root);
+dm_tm_unlock(pmd-&amp;gt;tm, copy);
+pmd-&amp;gt;need_commit = 1;
+return -EBUSY;
+}
+
+/*
+ * Wipe the spacemap since we're not publishing this.
+ */
+memset(&amp;amp;disk_super-&amp;gt;data_space_map_root, 0, sizeof(disk_super-&amp;gt;data_space_map_root));
+memset(&amp;amp;disk_super-&amp;gt;metadata_space_map_root, 0,
+       sizeof(disk_super-&amp;gt;metadata_space_map_root));
+
+/*
+ * Increment the data structures that need to be preserved.
+ */
+dm_tm_inc(pmd-&amp;gt;tm, le64_to_cpu(disk_super-&amp;gt;data_mapping_root));
+dm_tm_inc(pmd-&amp;gt;tm, le64_to_cpu(disk_super-&amp;gt;device_details_root));
+dm_tm_unlock(pmd-&amp;gt;tm, copy);
+
+/*
+ * Write the held root into the superblock.
+ */
+r = dm_bm_write_lock(pmd-&amp;gt;bm, THIN_SUPERBLOCK_LOCATION,
+     &amp;amp;sb_validator, &amp;amp;sblock);
+if (r) {
+dm_tm_dec(pmd-&amp;gt;tm, held_root);
+pmd-&amp;gt;need_commit = 1;
+return r;
+}
+
+disk_super = dm_block_data(sblock);
+disk_super-&amp;gt;held_root = cpu_to_le64(held_root);
+dm_tm_unlock(pmd-&amp;gt;tm, sblock);
+
+pmd-&amp;gt;need_commit = 1;
+return 0;
+}
+
+int dm_pool_reserve_metadata_snap(struct dm_pool_metadata *pmd)
+{
+int r;
+
+down_write(&amp;amp;pmd-&amp;gt;root_lock);
+r = __reserve_metadata_snap(pmd);
+up_write(&amp;amp;pmd-&amp;gt;root_lock);
+
+return r;
+}
+
+static int __release_metadata_snap(struct dm_pool_metadata *pmd)
 {
 int r;
 struct thin_disk_superblock *disk_super;
-struct dm_block *sblock;
+struct dm_block *sblock, *copy;
+dm_block_t held_root;
 
 r = dm_bm_write_lock(pmd-&amp;gt;bm, THIN_SUPERBLOCK_LOCATION,
      &amp;amp;sb_validator, &amp;amp;sblock);
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -1095,18 +1165,64 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; static int __get_held_metadata_root(struct dm_pool_metadata *pmd,
 return r;
 
 disk_super = dm_block_data(sblock);
+held_root = le64_to_cpu(disk_super-&amp;gt;held_root);
+disk_super-&amp;gt;held_root = cpu_to_le64(0);
+pmd-&amp;gt;need_commit = 1;
+
+dm_tm_unlock(pmd-&amp;gt;tm, sblock);
+
+if (!held_root) {
+DMWARN("pool has no metadata snap");
+return -EINVAL;
+}
+
+r = dm_tm_read_lock(pmd-&amp;gt;tm, held_root, &amp;amp;sb_validator, &amp;amp;copy);
+if (r)
+return r;
+
+disk_super = dm_block_data(copy);
+dm_sm_dec_block(pmd-&amp;gt;metadata_sm, le64_to_cpu(disk_super-&amp;gt;data_mapping_root));
+dm_sm_dec_block(pmd-&amp;gt;metadata_sm, le64_to_cpu(disk_super-&amp;gt;device_details_root));
+dm_sm_dec_block(pmd-&amp;gt;metadata_sm, held_root);
+return dm_tm_unlock(pmd-&amp;gt;tm, copy);
+}
+
+int dm_pool_release_metadata_snap(struct dm_pool_metadata *pmd)
+{
+int r;
+
+down_write(&amp;amp;pmd-&amp;gt;root_lock);
+r = __release_metadata_snap(pmd);
+up_write(&amp;amp;pmd-&amp;gt;root_lock);
+
+return r;
+}
+
+static int __get_metadata_snap(struct dm_pool_metadata *pmd,
+       dm_block_t *result)
+{
+int r;
+struct thin_disk_superblock *disk_super;
+struct dm_block *sblock;
+
+r = dm_bm_read_lock(pmd-&amp;gt;bm, THIN_SUPERBLOCK_LOCATION,
+    &amp;amp;sb_validator, &amp;amp;sblock);
+if (r)
+return r;
+
+disk_super = dm_block_data(sblock);
 *result = le64_to_cpu(disk_super-&amp;gt;held_root);
 
 return dm_bm_unlock(sblock);
 }
 
-int dm_pool_get_held_metadata_root(struct dm_pool_metadata *pmd,
-   dm_block_t *result)
+int dm_pool_get_metadata_snap(struct dm_pool_metadata *pmd,
+      dm_block_t *result)
 {
 int r;
 
 down_read(&amp;amp;pmd-&amp;gt;root_lock);
-r = __get_held_metadata_root(pmd, result);
+r = __get_metadata_snap(pmd, result);
 up_read(&amp;amp;pmd-&amp;gt;root_lock);
 
 return r;
diff --git a/drivers/md/dm-thin-metadata.h b/drivers/md/dm-thin-metadata.h
index ed4725e..b88918c 100644
--- a/drivers/md/dm-thin-metadata.h
+++ b/drivers/md/dm-thin-metadata.h
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -90,11 +90,18 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; int dm_pool_get_metadata_transaction_id(struct dm_pool_metadata *pmd,
 
 /*
  * Hold/get root for userspace transaction.
+ *
+ * The metadata snapshot is a copy of the current superblock (minus the
+ * space maps).  Userland can access the data structures for READ
+ * operations only.  A small performance hit is incurred by providing this
+ * copy of the metadata to userland due to extra copy-on-write operations
+ * on the metadata nodes.  Release this as soon as you finish with it.
  */
-int dm_pool_hold_metadata_root(struct dm_pool_metadata *pmd);
+int dm_pool_reserve_metadata_snap(struct dm_pool_metadata *pmd);
+int dm_pool_release_metadata_snap(struct dm_pool_metadata *pmd);
 
-int dm_pool_get_held_metadata_root(struct dm_pool_metadata *pmd,
-   dm_block_t *result);
+int dm_pool_get_metadata_snap(struct dm_pool_metadata *pmd,
+      dm_block_t *result);
 
 /*
  * Actions on a single virtual device.
diff --git a/drivers/md/dm-thin.c b/drivers/md/dm-thin.c
index 2fd87b5..1645529 100644
--- a/drivers/md/dm-thin.c
+++ b/drivers/md/dm-thin.c
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -2274,6 +2274,36 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; static int process_set_transaction_id_mesg(unsigned argc, char **argv, struct po
 return 0;
 }
 
+static int process_reserve_metadata_snap_mesg(unsigned argc, char **argv, struct pool *pool)
+{
+int r;
+
+r = check_arg_count(argc, 1);
+if (r)
+return r;
+
+r = dm_pool_reserve_metadata_snap(pool-&amp;gt;pmd);
+if (r)
+DMWARN("metadata snap request failed");
+
+return r;
+}
+
+static int process_release_metadata_snap_mesg(unsigned argc, char **argv, struct pool *pool)
+{
+int r;
+
+r = check_arg_count(argc, 1);
+if (r)
+return r;
+
+r = dm_pool_release_metadata_snap(pool-&amp;gt;pmd);
+if (r)
+DMWARN("release metadata snap request failed");
+
+return r;
+}
+
 /*
  * Messages supported:
  *   create_thin&amp;lt;dev_id&amp;gt;
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -2281,6 +2311,8 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; static int process_set_transaction_id_mesg(unsigned argc, char **argv, struct po
  *   delete&amp;lt;dev_id&amp;gt;
  *   trim&amp;lt;dev_id&amp;gt; &amp;lt;new_size_in_sectors&amp;gt;
  *   set_transaction_id &amp;lt;current_trans_id&amp;gt; &amp;lt;new_trans_id&amp;gt;
+ *   reserve_metadata_snap
+ *   release_metadata_snap
  */
 static int pool_message(struct dm_target *ti, unsigned argc, char **argv)
 {
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -2300,6 +2332,12 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; static int pool_message(struct dm_target *ti, unsigned argc, char **argv)
 else if (!strcasecmp(argv[0], "set_transaction_id"))
 r = process_set_transaction_id_mesg(argc, argv, pool);
 
+else if (!strcasecmp(argv[0], "reserve_metadata_snap"))
+r = process_reserve_metadata_snap_mesg(argc, argv, pool);
+
+else if (!strcasecmp(argv[0], "release_metadata_snap"))
+r = process_release_metadata_snap_mesg(argc, argv, pool);
+
 else
 DMWARN("Unrecognised thin pool target message received: %s", argv[0]);
 
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -2359,7 +2397,7 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; static int pool_status(struct dm_target *ti, status_type_t type,
 if (r)
 return r;
 
-r = dm_pool_get_held_metadata_root(pool-&amp;gt;pmd, &amp;amp;held_root);
+r = dm_pool_get_metadata_snap(pool-&amp;gt;pmd, &amp;amp;held_root);
 if (r)
 return r;
 
&lt;/pre&gt;</description>
    <dc:creator>Joe Thornber</dc:creator>
    <dc:date>2012-05-17T14:47:22</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.linux.kernel.device-mapper.devel/15771">
    <title>[PATCH] dm thin: commit pool's metadata on last close ofthin device</title>
    <link>http://comments.gmane.org/gmane.linux.kernel.device-mapper.devel/15771</link>
    <description>&lt;pre&gt;Reinstate dm_flush_all and dm_table_flush_all.  dm_blk_close will
now trigger the .flush method of all targets within a table on the last
close of a DM device.

In the case of the thin target, the thin_flush method will commit the
backing pool's metadata.

Doing so avoids a deadlock that has been observed with the following
sequence (as can be triggered via "dmsetup remove_all"):
- IO is issued to a thin device, thin device is closed
- pool's metadata device is suspended before the pool is
- because the pool still has outstanding IO we deadlock because the
  pool's metadata device is suspended

Signed-off-by: Mike Snitzer &amp;lt;snitzer&amp;lt; at &amp;gt;redhat.com&amp;gt;
Cc: stable&amp;lt; at &amp;gt;vger.kernel.org
---
 drivers/md/dm-table.c |    9 +++++++++
 drivers/md/dm-thin.c  |   19 +++++++++++++++++++
 drivers/md/dm.c       |   20 +++++++++++++++++++-
 drivers/md/dm.h       |    1 +
 4 files changed, 48 insertions(+), 1 deletions(-)

diff --git a/drivers/md/dm-table.c b/drivers/md/dm-table.c
index 2e227fb..077fff8 100644
--- a/drivers/md/dm-table.c
+++ b/drivers/md/dm-table.c
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -1487,6 +1487,15 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; int dm_table_resume_targets(struct dm_table *t)
 return 0;
 }
 
+void dm_table_flush_all(struct dm_table *t)
+{
+unsigned i;
+
+for (i = 0; i &amp;lt; t-&amp;gt;num_targets; i++)
+if (t-&amp;gt;targets[i].type-&amp;gt;flush)
+t-&amp;gt;targets[i].type-&amp;gt;flush(&amp;amp;t-&amp;gt;targets[i]);
+}
+
 void dm_table_add_target_callbacks(struct dm_table *t, struct dm_target_callbacks *cb)
 {
 list_add(&amp;amp;cb-&amp;gt;list, &amp;amp;t-&amp;gt;target_callbacks);
diff --git a/drivers/md/dm-thin.c b/drivers/md/dm-thin.c
index c514078..f64c7e6 100644
--- a/drivers/md/dm-thin.c
+++ b/drivers/md/dm-thin.c
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -2429,6 +2429,24 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; static void thin_io_hints(struct dm_target *ti, struct queue_limits *limits)
 set_discard_limits(pool, limits);
 }
 
+static void thin_flush(struct dm_target *ti)
+{
+int r;
+struct thin_c *tc = ti-&amp;gt;private;
+struct pool *pool = tc-&amp;gt;pool;
+
+/*
+ * A bit heavy-handed but the only existing way to batch
+ * metadata commits is to issue() a FLUSH bio -- but DM
+ * doesn't allocate bios outside the DM core.
+ */
+r = dm_pool_commit_metadata(pool-&amp;gt;pmd);
+if (r &amp;lt; 0) {
+DMERR("%s: dm_pool_commit_metadata() failed, error = %d",
+      __func__, r);
+}
+}
+
 static struct target_type thin_target = {
 .name = "thin",
 .version = {1, 1, 0},
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -2441,6 +2459,7 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; static struct target_type thin_target = {
 .status = thin_status,
 .iterate_devices = thin_iterate_devices,
 .io_hints = thin_io_hints,
+.flush = thin_flush,
 };
 
 /*----------------------------------------------------------------*/
diff --git a/drivers/md/dm.c b/drivers/md/dm.c
index 23a1a84..715ee57 100644
--- a/drivers/md/dm.c
+++ b/drivers/md/dm.c
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -487,6 +487,16 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; out:
 return md ? 0 : -ENXIO;
 }
 
+static void dm_flush_all(struct mapped_device *md)
+{
+struct dm_table *t = dm_get_live_table(md);
+
+if (t) {
+dm_table_flush_all(t);
+dm_table_put(t);
+}
+}
+
 static int dm_blk_close(struct gendisk *disk, fmode_t mode)
 {
 struct mapped_device *md = disk-&amp;gt;private_data;
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -494,10 +504,17 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; static int dm_blk_close(struct gendisk *disk, fmode_t mode)
 spin_lock(&amp;amp;_minor_lock);
 
 atomic_dec(&amp;amp;md-&amp;gt;open_count);
-dm_put(md);
 
 spin_unlock(&amp;amp;_minor_lock);
 
+/*
+ * Flush all targets on last close
+ */
+if (!dm_open_count(md))
+dm_flush_all(md);
+
+dm_put(md);
+
 return 0;
 }
 
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -2468,6 +2485,7 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; void dm_destroy_immediate(struct mapped_device *md)
 void dm_put(struct mapped_device *md)
 {
 atomic_dec(&amp;amp;md-&amp;gt;holders);
+smp_mb__after_atomic_dec();
 }
 EXPORT_SYMBOL_GPL(dm_put);
 
diff --git a/drivers/md/dm.h b/drivers/md/dm.h
index b7dacd5..82199a1 100644
--- a/drivers/md/dm.h
+++ b/drivers/md/dm.h
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -66,6 +66,7 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; bool dm_table_supports_discards(struct dm_table *t);
 int dm_table_alloc_md_mempools(struct dm_table *t);
 void dm_table_free_md_mempools(struct dm_table *t);
 struct dm_md_mempools *dm_table_get_md_mempools(struct dm_table *t);
+void dm_table_flush_all(struct dm_table *t);
 
 int dm_queue_merge_is_compulsory(struct request_queue *q);
 
&lt;/pre&gt;</description>
    <dc:creator>Mike Snitzer</dc:creator>
    <dc:date>2012-05-16T22:19:53</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.linux.kernel.device-mapper.devel/15765">
    <title>Bumping multipath-tools version</title>
    <link>http://comments.gmane.org/gmane.linux.kernel.device-mapper.devel/15765</link>
    <description>&lt;pre&gt;Given the amount of change in the tools, I was wondering if we should
bump the release version.

-Ben

&lt;/pre&gt;</description>
    <dc:creator>Benjamin Marzinski</dc:creator>
    <dc:date>2012-05-16T15:05:32</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.linux.kernel.device-mapper.devel/15747">
    <title>Multipath and LVM (lvdisplay takes 30Secs)</title>
    <link>http://comments.gmane.org/gmane.linux.kernel.device-mapper.devel/15747</link>
    <description>&lt;pre&gt;Hello List,

i am using multipath for redundance reasons. But something seems to be dodgy.

"lvdisplay" takes 30Seconds.

"multipath" -l shows nothing

multipath -l -v 2
SAN (3600a0b80001f7557000032864ce4aff3) dm-0 IBM,1722-600
size=250G features='1 queue_if_no_path' hwhandler='1 rdac' wp=rw
|-+- policy='round-robin 0' prio=-1 status=active
| `- 2:0:1:0 sdb 8:16 active undef running
|-+- policy='round-robin 0' prio=-1 status=enabled
| `- 3:0:1:0 sdd 8:48 active undef running
`-+- policy='round-robin 0' prio=-1 status=enabled
  `- 3:0:0:0 sdc 8:32 active undef running

Any idea why lvmdisplay takes so long? If i can see its trying to read
from sda, dm-1, sdb, dm-1 where the "read(3, " operations need some
time each time.

Here is some more info:

multipath -l -v 3
May 15 12:10:06 | sdb: not found in pathvec
May 15 12:10:06 | sdb: mask = 0x1
May 15 12:10:06 | sdb: dev_t = 8:16
May 15 12:10:06 | sdb: size = 524288000
May 15 12:10:06 | sdb: subsystem = scsi
May 15 12:10:06 | sdb: vendor = IBM
May 15 12:10:06 | sdb: product = 1722-600
May 15 12:10:06 | sdb: rev = 0914
May 15 12:10:06 | sdb: h:b:t:l = 2:0:1:0
May 15 12:10:06 | sdb: tgt_node_name = 0x200400a0b816fb7
May 15 12:10:06 | sda: device node name blacklisted
May 15 12:10:06 | sdd: not found in pathvec
May 15 12:10:06 | sdd: mask = 0x1
May 15 12:10:06 | sdd: dev_t = 8:48
May 15 12:10:06 | sdd: size = 524288000
May 15 12:10:06 | sdd: subsystem = scsi
May 15 12:10:06 | sdd: vendor = IBM
May 15 12:10:06 | sdd: product = 1722-600
May 15 12:10:06 | sdd: rev = 0914
May 15 12:10:06 | sdd: h:b:t:l = 3:0:1:0
May 15 12:10:06 | sdd: tgt_node_name = 0x200400a0b816fb7
May 15 12:10:06 | sdc: not found in pathvec
May 15 12:10:06 | sdc: mask = 0x1
May 15 12:10:06 | sdc: dev_t = 8:32
May 15 12:10:06 | sdc: size = 524288000
May 15 12:10:06 | sdc: subsystem = scsi
May 15 12:10:06 | sdc: vendor = IBM
May 15 12:10:06 | sdc: product = 1722-600
May 15 12:10:06 | sdc: rev = 0914
May 15 12:10:06 | sdc: h:b:t:l = 3:0:0:0
May 15 12:10:06 | sdc: tgt_node_name = 0x200400a0b816fb7
May 15 12:10:06 | dm-0: device node name blacklisted
May 15 12:10:06 | dm-1: device node name blacklisted
May 15 12:10:06 | dm-2: device node name blacklisted
May 15 12:10:06 | dm-3: device node name blacklisted
May 15 12:10:06 | loop0: device node name blacklisted
May 15 12:10:06 | loop1: device node name blacklisted
May 15 12:10:06 | loop2: device node name blacklisted
May 15 12:10:06 | loop3: device node name blacklisted
May 15 12:10:06 | loop4: device node name blacklisted
May 15 12:10:06 | loop5: device node name blacklisted
May 15 12:10:06 | loop6: device node name blacklisted
May 15 12:10:06 | loop7: device node name blacklisted
May 15 12:10:06 | dm-4: device node name blacklisted
May 15 12:10:06 | dm-5: device node name blacklisted
May 15 12:10:06 | dm-6: device node name blacklisted
===== paths list =====
uuid hcil    dev dev_t pri dm_st chk_st vend/prod/rev dev_st
     2:0:1:0 sdb 8:16  -1  undef undef  IBM,1722-600  running
     3:0:1:0 sdd 8:48  -1  undef undef  IBM,1722-600  running
     3:0:0:0 sdc 8:32  -1  undef undef  IBM,1722-600  running
May 15 12:10:06 | params = 1 queue_if_no_path 1 rdac 3 1 round-robin 0
1 1 8:16 600 round-robin 0 1 1 8:48 600 round-robin 0 1 1 8:32 100
May 15 12:10:06 | status = 2 0 1 0 3 1 A 0 1 0 8:16 A 0 E 0 1 0 8:48 A
0 E 0 1 0 8:32 A 0
SAN (3600a0b80001f7557000032864ce4aff3) dm-0 IBM,1722-600
size=250G features='1 queue_if_no_path' hwhandler='1 rdac' wp=rw
|-+- policy='round-robin 0' prio=-1 status=active
| `- 2:0:1:0 sdb 8:16 active undef running
|-+- policy='round-robin 0' prio=-1 status=enabled
| `- 3:0:1:0 sdd 8:48 active undef running
`-+- policy='round-robin 0' prio=-1 status=enabled
  `- 3:0:0:0 sdc 8:32 active undef running

Any idea whats wrong here?

Thanks a lot,
Mario

&lt;/pre&gt;</description>
    <dc:creator>ml ml</dc:creator>
    <dc:date>2012-05-15T10:15:09</dc:date>
  </item>
  <textinput rdf:about="http://search.gmane.org/?group=$group=gmane.linux.kernel.device-mapper.devel">
    <title>Search Engine</title>
    <description>Search the mailing list at Gmane</description>
    <name>query</name>
    <link>http://search.gmane.org/?group=$group=gmane.linux.kernel.device-mapper.devel</link>
  </textinput>
</rdf:RDF>

