]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
Merge branch 'for-linus' of git://git.kernel.dk/linux-block
authorLinus Torvalds <torvalds@linux-foundation.org>
Fri, 15 Apr 2016 22:44:10 +0000 (15:44 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Fri, 15 Apr 2016 22:44:10 +0000 (15:44 -0700)
Pull block fixes from Jens Axboe:
 "A few fixes for the current series. This contains:

   - Two fixes for NVMe:

     One fixes a reset race that can be triggered by repeated
     insert/removal of the module.

     The other fixes an issue on some platforms, where we get probe
     timeouts since legacy interrupts isn't working.  This used not to
     be a problem since we had the worker thread poll for completions,
     but since that was killed off, it means those poor souls can't
     successfully probe their NVMe device.  Use a proper IRQ check and
     probe (msi-x -> msi ->legacy), like most other drivers to work
     around this.  Both from Keith.

   - A loop corruption issue with offset in iters, from Ming Lei.

   - A fix for not having the partition stat per cpu ref count
     initialized before sending out the KOBJ_ADD, which could cause user
     space to access the counter prior to initialization.  Also from
     Ming Lei.

   - A fix for using the wrong congestion state, from Kaixu Xia"

* 'for-linus' of git://git.kernel.dk/linux-block:
  block: loop: fix filesystem corruption in case of aio/dio
  NVMe: Always use MSI/MSI-x interrupts
  NVMe: Fix reset/remove race
  writeback: fix the wrong congested state variable definition
  block: partition: initialize percpuref before sending out KOBJ_ADD

1  2 
block/partition-generic.c

index 2c6ae2aed2c4711072386643d4260a808cb8d17b,84c53f04777a7536d7d0ed9ee519034afa4c74b3..d7eb77e1e3a8f4be13f6016ed0e7f7ab7c051da8
@@@ -361,15 -361,20 +361,20 @@@ struct hd_struct *add_partition(struct 
                        goto out_del;
        }
  
+       err = hd_ref_init(p);
+       if (err) {
+               if (flags & ADDPART_FLAG_WHOLEDISK)
+                       goto out_remove_file;
+               goto out_del;
+       }
        /* everything is up and running, commence */
        rcu_assign_pointer(ptbl->part[partno], p);
  
        /* suppress uevent if the disk suppresses it */
        if (!dev_get_uevent_suppress(ddev))
                kobject_uevent(&pdev->kobj, KOBJ_ADD);
-       if (!hd_ref_init(p))
-               return p;
+       return p;
  
  out_free_info:
        free_part_info(p);
@@@ -378,6 -383,8 +383,8 @@@ out_free_stats
  out_free:
        kfree(p);
        return ERR_PTR(err);
+ out_remove_file:
+       device_remove_file(pdev, &dev_attr_whole_disk);
  out_del:
        kobject_put(p->holder_dir);
        device_del(pdev);
@@@ -566,8 -573,8 +573,8 @@@ static struct page *read_pagecache_sect
  {
        struct address_space *mapping = bdev->bd_inode->i_mapping;
  
 -      return read_mapping_page(mapping, (pgoff_t)(n >> (PAGE_CACHE_SHIFT-9)),
 -                      NULL);
 +      return read_mapping_page(mapping, (pgoff_t)(n >> (PAGE_SHIFT-9)),
 +                               NULL);
  }
  
  unsigned char *read_dev_sector(struct block_device *bdev, sector_t n, Sector *p)
                if (PageError(page))
                        goto fail;
                p->v = page;
 -              return (unsigned char *)page_address(page) +  ((n & ((1 << (PAGE_CACHE_SHIFT - 9)) - 1)) << 9);
 +              return (unsigned char *)page_address(page) +  ((n & ((1 << (PAGE_SHIFT - 9)) - 1)) << 9);
  fail:
 -              page_cache_release(page);
 +              put_page(page);
        }
        p->v = NULL;
        return NULL;