Merge tag 'dm-3.18-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/device...
authorLinus Torvalds <torvalds@linux-foundation.org>
Thu, 13 Nov 2014 17:19:20 +0000 (09:19 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Thu, 13 Nov 2014 17:19:20 +0000 (09:19 -0800)
Pull device mapper fixes from Mike Snitzer:

 - stable fix for dm-thin that avoids normal IO racing with discard

 - stable fix for a dm-cache related bug in dm-btree walking code that
   results from using very large fast device (eg 4T) with a very small
   cache blocksize (eg 32K) -- this is a very uncommon configuration

 - a couple fixes for dm-raid (one for stable and the other addresses a
   crash in 3.18-rc1 code)

 - stable fix for dm-thinp that addresses a very rare dm-bufio bug
   having to do with memory reclaimation (via shrinker) when using
   dm-thinp ontop of loopback devices

 - fix a leak in dm-stripe target constructor's error path

* tag 'dm-3.18-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/device-mapper/linux-dm:
  dm btree: fix a recursion depth bug in btree walking code
  dm thin: grab a virtual cell before looking up the mapping
  dm raid: fix inaccessible superblocks causing oops in configure_discard_support
  dm raid: ensure superblock's size matches device's logical block size
  dm bufio: change __GFP_IO to __GFP_FS in shrinker callbacks
  dm stripe: fix potential for leak in stripe_ctr error path

1  2 
drivers/md/dm-bufio.c

diff --combined drivers/md/dm-bufio.c
index 825ca1f87639aae4bf1c0f60567bc163c75b338b,0be200b6dbf236e1f6fd4cdf8ae33921766250e9..afe79719ea329e72e0d8e8433222f75fe4a9ac0a
@@@ -721,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);
@@@ -1434,9 -1435,9 +1434,9 @@@ static void drop_buffers(struct dm_bufi
  
  /*
   * Test if the buffer is unused and too old, and commit it.
-  * At if noio is set, we must not do any I/O because we hold
-  * dm_bufio_clients_lock and we would risk deadlock if the I/O gets rerouted to
-  * different bufio client.
+  * And if GFP_NOFS is used, we must not do any I/O because we hold
+  * dm_bufio_clients_lock and we would risk deadlock if the I/O gets
+  * rerouted to different bufio client.
   */
  static int __cleanup_old_buffer(struct dm_buffer *b, gfp_t gfp,
                                unsigned long max_jiffies)
        if (jiffies - b->last_accessed < max_jiffies)
                return 0;
  
-       if (!(gfp & __GFP_IO)) {
+       if (!(gfp & __GFP_FS)) {
                if (test_bit(B_READING, &b->state) ||
                    test_bit(B_WRITING, &b->state) ||
                    test_bit(B_DIRTY, &b->state))
@@@ -1486,7 -1487,7 +1486,7 @@@ dm_bufio_shrink_scan(struct shrinker *s
        unsigned long freed;
  
        c = container_of(shrink, struct dm_bufio_client, shrinker);
-       if (sc->gfp_mask & __GFP_IO)
+       if (sc->gfp_mask & __GFP_FS)
                dm_bufio_lock(c);
        else if (!dm_bufio_trylock(c))
                return SHRINK_STOP;
@@@ -1503,7 -1504,7 +1503,7 @@@ dm_bufio_shrink_count(struct shrinker *
        unsigned long count;
  
        c = container_of(shrink, struct dm_bufio_client, shrinker);
-       if (sc->gfp_mask & __GFP_IO)
+       if (sc->gfp_mask & __GFP_FS)
                dm_bufio_lock(c);
        else if (!dm_bufio_trylock(c))
                return 0;