for-linus-20181019

-----BEGIN PGP SIGNATURE-----
 
 iQJEBAABCAAuFiEEwPw5LcreJtl1+l5K99NY+ylx4KYFAlvJ/YcQHGF4Ym9lQGtl
 cm5lbC5kawAKCRD301j7KXHgprKoD/90d8WU7lcpRDQpP8WX3s5tkLHsyBHeEV6R
 3E+bq7SWDaNKge/ROlcVi/zz9LNgJnThqrfK5wr7SU/w+0gJNterc+Zwn2XTdX/G
 2hGyLQZZbSlLvlHJxHtiiBB8+pWPX57eNT0K1Qu/9CeieQaI2ralh5glbB7rMSp2
 SOx9MQd2IoURMB/HzhCr11G8jGMuoUyeAnx7w9tJgfQ3jRgnQJmHOYW3X9BSBgPd
 ZYFohT29gEEvjROh2HqthTq9XMrSOAuWuMaNY378ZPLDWah4Vh23eMBTYjEzOO4J
 PutXYelFtRjWbdb49BebjK8YH88GECMJKb5IleblSN3AfhPFEpd3VToJM5fqdz3S
 1zay7gU4W1Qm7koBa7R905//dLdNezfbhLZ4DTBRtlnsOY6iu3Yw+VW77msC0B6D
 SCoSgGcK4sv2PraLqe/nJxMUhat8Zj3l8DdU7y5bb9G40BLnkt35552zOXLe5kBo
 qH0gB55XWzchVEVCmrDC/duR/cgvPKA5+a6avRu8/XF/A3p6E8ZujqHObzaKS8mF
 RYs3FRdcim/72P5VPWefUrN3k+Mj/1Ty4swPxi+P8PgGdH3Tb1phlvajCH4p502t
 Fhk8oJG1KPq8KYN1ZY6Gsmr4EyuW+Gjpeg0pZ8IX3+JoueYo5NsJVclVlu9oy9yZ
 4/J7bPhNpg==
 =gMe+
 -----END PGP SIGNATURE-----

Merge tag 'for-linus-20181019' of git://git.kernel.dk/linux-block

Jens writes:
  "Block fixes for 4.19-final

   Two small fixes that should go into this release."

* tag 'for-linus-20181019' of git://git.kernel.dk/linux-block:
  block: don't deal with discard limit in blkdev_issue_discard()
  nvme: remove ns sibling before clearing path
This commit is contained in:
Greg Kroah-Hartman 2018-10-19 18:51:07 +02:00
commit b2a205ff49
2 changed files with 3 additions and 27 deletions

View File

@ -29,9 +29,7 @@ int __blkdev_issue_discard(struct block_device *bdev, sector_t sector,
{
struct request_queue *q = bdev_get_queue(bdev);
struct bio *bio = *biop;
unsigned int granularity;
unsigned int op;
int alignment;
sector_t bs_mask;
if (!q)
@ -54,38 +52,16 @@ int __blkdev_issue_discard(struct block_device *bdev, sector_t sector,
if ((sector | nr_sects) & bs_mask)
return -EINVAL;
/* Zero-sector (unknown) and one-sector granularities are the same. */
granularity = max(q->limits.discard_granularity >> 9, 1U);
alignment = (bdev_discard_alignment(bdev) >> 9) % granularity;
while (nr_sects) {
unsigned int req_sects;
sector_t end_sect, tmp;
unsigned int req_sects = nr_sects;
sector_t end_sect;
/*
* Issue in chunks of the user defined max discard setting,
* ensuring that bi_size doesn't overflow
*/
req_sects = min_t(sector_t, nr_sects,
q->limits.max_discard_sectors);
if (!req_sects)
goto fail;
if (req_sects > UINT_MAX >> 9)
req_sects = UINT_MAX >> 9;
/*
* If splitting a request, and the next starting sector would be
* misaligned, stop the discard at the previous aligned sector.
*/
end_sect = sector + req_sects;
tmp = end_sect;
if (req_sects < nr_sects &&
sector_div(tmp, granularity) != alignment) {
end_sect = end_sect - alignment;
sector_div(end_sect, granularity);
end_sect = end_sect * granularity + alignment;
req_sects = end_sect - sector;
}
bio = next_bio(bio, 0, gfp_mask);
bio->bi_iter.bi_sector = sector;

View File

@ -3143,8 +3143,8 @@ static void nvme_ns_remove(struct nvme_ns *ns)
}
mutex_lock(&ns->ctrl->subsys->lock);
nvme_mpath_clear_current_path(ns);
list_del_rcu(&ns->siblings);
nvme_mpath_clear_current_path(ns);
mutex_unlock(&ns->ctrl->subsys->lock);
down_write(&ns->ctrl->namespaces_rwsem);