mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 03:27:44 -04:00
for-linus-20180309
-----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAABCAAGBQJao2pFAAoJEPfTWPspceCmo7wQAJb9B2FR0BnT0FeXyn+K14sB rsldkfXlMuA6zgNdDZjyrk5x1tAUpwE1md636V00clz/jFuBd9Wh6FhPRsvyWfsT IRcYh4d1Ojewyn/XsphBEgsruxe2gUGDaJKaeETH5Fzq/lo+zk+XESYuS6BD0dCl pLUMdVgsPl1FTlYjG8Oo7tPZcfrWtyOJ8Ri503PadEOretKIbjo5LbpNrKDsQCBT BmVrZJEDRXow9TaNgUgF6cYmJm2YVjKLnmovpNxVF2kto0oOfzEKoiQk/4kA7U5r kwIT9kXZO81GZ8JiG7ccNDrbQ+ExCaNMUSyhyDqrVs89/9xCA8ffTGj1bZWW4zd5 qw85McjcWGfZIzsVKpUr9xhZAVB9y1AwZ5en6bcSi5RVhltyxouBzFROq1iJEGis /OIz5XcOXAWMZWSa4PRh7PXSRXtmPh7mj4bE0GfnuWfIA9yPYk5sCe0Lq/XNFvC8 NVw8TL//SyMQnMUTCzFbRx7DXzZ1CRVSvV/28k96Clmymy8ZAEWhsvYb5bpMHM4C rAL71OEjDda+Msl0WKF7IWXYiuu5CWHk8Gp7k10IdVsVAorBzLRLXJvd+J7/SETk sO5QYW3DIxHwwS7389g91c1zq9KevDJUnV9AqkwcX260kgYjyPAdQB1eOLPTSHx9 aa20gUIfEEds35dWCZLK =1Ukr -----END PGP SIGNATURE----- Merge tag 'for-linus-20180309' of git://git.kernel.dk/linux-block Pull block fixes from Jens Axboe: - a xen-blkfront fix from Bhavesh with a multiqueue fix when detaching/re-attaching - a few important NVMe fixes, including a revert for a sysfs fix that caused some user space confusion - two bcache fixes by way of Michael Lyle - a loop regression fix, fixing an issue with lost writes on DAX. * tag 'for-linus-20180309' of git://git.kernel.dk/linux-block: loop: Fix lost writes caused by missing flag nvme_fc: rework sqsize handling nvme-fabrics: Ignore nr_io_queues option for discovery controllers xen-blkfront: move negotiate_mq to cover all cases of new VBDs Revert "nvme: create 'slaves' and 'holders' entries for hidden controllers" bcache: don't attach backing with duplicate UUID bcache: fix crashes in duplicate cache device register nvme: pci: pass max vectors as num_possible_cpus() to pci_alloc_irq_vectors nvme-pci: Fix EEH failure on ppc
This commit is contained in:
commit
91a262096e
9 changed files with 60 additions and 73 deletions
|
|
@ -963,6 +963,7 @@ int bch_cached_dev_attach(struct cached_dev *dc, struct cache_set *c,
|
|||
uint32_t rtime = cpu_to_le32(get_seconds());
|
||||
struct uuid_entry *u;
|
||||
char buf[BDEVNAME_SIZE];
|
||||
struct cached_dev *exist_dc, *t;
|
||||
|
||||
bdevname(dc->bdev, buf);
|
||||
|
||||
|
|
@ -987,6 +988,16 @@ int bch_cached_dev_attach(struct cached_dev *dc, struct cache_set *c,
|
|||
return -EINVAL;
|
||||
}
|
||||
|
||||
/* Check whether already attached */
|
||||
list_for_each_entry_safe(exist_dc, t, &c->cached_devs, list) {
|
||||
if (!memcmp(dc->sb.uuid, exist_dc->sb.uuid, 16)) {
|
||||
pr_err("Tried to attach %s but duplicate UUID already attached",
|
||||
buf);
|
||||
|
||||
return -EINVAL;
|
||||
}
|
||||
}
|
||||
|
||||
u = uuid_find(c, dc->sb.uuid);
|
||||
|
||||
if (u &&
|
||||
|
|
@ -1204,7 +1215,7 @@ static void register_bdev(struct cache_sb *sb, struct page *sb_page,
|
|||
|
||||
return;
|
||||
err:
|
||||
pr_notice("error opening %s: %s", bdevname(bdev, name), err);
|
||||
pr_notice("error %s: %s", bdevname(bdev, name), err);
|
||||
bcache_device_stop(&dc->disk);
|
||||
}
|
||||
|
||||
|
|
@ -1883,6 +1894,8 @@ static int register_cache(struct cache_sb *sb, struct page *sb_page,
|
|||
const char *err = NULL; /* must be set for any error case */
|
||||
int ret = 0;
|
||||
|
||||
bdevname(bdev, name);
|
||||
|
||||
memcpy(&ca->sb, sb, sizeof(struct cache_sb));
|
||||
ca->bdev = bdev;
|
||||
ca->bdev->bd_holder = ca;
|
||||
|
|
@ -1891,11 +1904,12 @@ static int register_cache(struct cache_sb *sb, struct page *sb_page,
|
|||
bio_first_bvec_all(&ca->sb_bio)->bv_page = sb_page;
|
||||
get_page(sb_page);
|
||||
|
||||
if (blk_queue_discard(bdev_get_queue(ca->bdev)))
|
||||
if (blk_queue_discard(bdev_get_queue(bdev)))
|
||||
ca->discard = CACHE_DISCARD(&ca->sb);
|
||||
|
||||
ret = cache_alloc(ca);
|
||||
if (ret != 0) {
|
||||
blkdev_put(bdev, FMODE_READ|FMODE_WRITE|FMODE_EXCL);
|
||||
if (ret == -ENOMEM)
|
||||
err = "cache_alloc(): -ENOMEM";
|
||||
else
|
||||
|
|
@ -1918,14 +1932,14 @@ static int register_cache(struct cache_sb *sb, struct page *sb_page,
|
|||
goto out;
|
||||
}
|
||||
|
||||
pr_info("registered cache device %s", bdevname(bdev, name));
|
||||
pr_info("registered cache device %s", name);
|
||||
|
||||
out:
|
||||
kobject_put(&ca->kobj);
|
||||
|
||||
err:
|
||||
if (err)
|
||||
pr_notice("error opening %s: %s", bdevname(bdev, name), err);
|
||||
pr_notice("error %s: %s", name, err);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
|
@ -2014,6 +2028,7 @@ static ssize_t register_bcache(struct kobject *k, struct kobj_attribute *attr,
|
|||
if (err)
|
||||
goto err_close;
|
||||
|
||||
err = "failed to register device";
|
||||
if (SB_IS_BDEV(sb)) {
|
||||
struct cached_dev *dc = kzalloc(sizeof(*dc), GFP_KERNEL);
|
||||
if (!dc)
|
||||
|
|
@ -2028,7 +2043,7 @@ static ssize_t register_bcache(struct kobject *k, struct kobj_attribute *attr,
|
|||
goto err_close;
|
||||
|
||||
if (register_cache(sb, sb_page, bdev, ca) != 0)
|
||||
goto err_close;
|
||||
goto err;
|
||||
}
|
||||
out:
|
||||
if (sb_page)
|
||||
|
|
@ -2041,7 +2056,7 @@ out:
|
|||
err_close:
|
||||
blkdev_put(bdev, FMODE_READ|FMODE_WRITE|FMODE_EXCL);
|
||||
err:
|
||||
pr_info("error opening %s: %s", path, err);
|
||||
pr_info("error %s: %s", path, err);
|
||||
ret = -EINVAL;
|
||||
goto out;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue