Merge tag 'dm-3.18' of git://git.kernel.org/pub/scm/linux/kernel/git/device-mapper...
authorLinus Torvalds <torvalds@linux-foundation.org>
Sat, 18 Oct 2014 19:25:30 +0000 (12:25 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Sat, 18 Oct 2014 19:25:30 +0000 (12:25 -0700)
Pull device-mapper updates from Mike Snitzer:
 "I rebased the DM tree ontop of linux-block.git's 'for-3.18/core' at
  the beginning of October because DM core now depends on the newly
  introduced bioset_create_nobvec() interface.

  Summary:

   - fix DM's long-standing excessive use of memory by leveraging the
     new bioset_create_nobvec() interface when creating the DM's bioset

   - fix a few bugs in dm-bufio and dm-log-userspace

   - add DM core support for a DM multipath use-case that requires
     loading DM tables that contain devices that have failed (by
     allowing active and inactive DM tables to share dm_devs)

   - add discard support to the DM raid target; like MD raid456 the user
     must opt-in to raid456 discard support be specifying the
     devices_handle_discard_safely=Y module param"

* tag 'dm-3.18' of git://git.kernel.org/pub/scm/linux/kernel/git/device-mapper/linux-dm:
  dm log userspace: fix memory leak in dm_ulog_tfr_init failure path
  dm bufio: when done scanning return from __scan immediately
  dm bufio: update last_accessed when relinking a buffer
  dm raid: add discard support for RAID levels 4, 5 and 6
  dm raid: add discard support for RAID levels 1 and 10
  dm: allow active and inactive tables to share dm_devs
  dm mpath: stop queueing IO when no valid paths exist
  dm: use bioset_create_nobvec()
  dm: remove nr_iovecs parameter from alloc_tio()

1  2 
drivers/md/dm-bufio.c

diff --combined drivers/md/dm-bufio.c
index 0505559f0965abb6cd5ce459034eb2ee31800d56,9ea5b6041eb2080e1d36b9320c8305669ffc6afd..825ca1f87639aae4bf1c0f60567bc163c75b338b
@@@ -465,6 -465,7 +465,7 @@@ static void __relink_lru(struct dm_buff
        c->n_buffers[dirty]++;
        b->list_mode = dirty;
        list_move(&b->lru_list, &c->lru[dirty]);
+       b->last_accessed = jiffies;
  }
  
  /*----------------------------------------------------------------
@@@ -720,6 -721,7 +721,6 @@@ static void __wait_for_free_buffer(stru
  
        io_schedule();
  
 -      set_task_state(current, TASK_RUNNING);
        remove_wait_queue(&c->free_buffer_wait, &wait);
  
        dm_bufio_lock(c);
@@@ -1471,9 -1473,9 +1472,9 @@@ static long __scan(struct dm_bufio_clie
                list_for_each_entry_safe_reverse(b, tmp, &c->lru[l], lru_list) {
                        freed += __cleanup_old_buffer(b, gfp_mask, 0);
                        if (!--nr_to_scan)
-                               break;
+                               return freed;
+                       dm_bufio_cond_resched();
                }
-               dm_bufio_cond_resched();
        }
        return freed;
  }