Skip to content

Commit b2a205f

Browse files
committed
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
2 parents 91b1561 + 744889b commit b2a205f

File tree

2 files changed

+3
-27
lines changed

2 files changed

+3
-27
lines changed

block/blk-lib.c

Lines changed: 2 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,7 @@ int __blkdev_issue_discard(struct block_device *bdev, sector_t sector,
2929
{
3030
struct request_queue *q = bdev_get_queue(bdev);
3131
struct bio *bio = *biop;
32-
unsigned int granularity;
3332
unsigned int op;
34-
int alignment;
3533
sector_t bs_mask;
3634

3735
if (!q)
@@ -54,38 +52,16 @@ int __blkdev_issue_discard(struct block_device *bdev, sector_t sector,
5452
if ((sector | nr_sects) & bs_mask)
5553
return -EINVAL;
5654

57-
/* Zero-sector (unknown) and one-sector granularities are the same. */
58-
granularity = max(q->limits.discard_granularity >> 9, 1U);
59-
alignment = (bdev_discard_alignment(bdev) >> 9) % granularity;
60-
6155
while (nr_sects) {
62-
unsigned int req_sects;
63-
sector_t end_sect, tmp;
56+
unsigned int req_sects = nr_sects;
57+
sector_t end_sect;
6458

65-
/*
66-
* Issue in chunks of the user defined max discard setting,
67-
* ensuring that bi_size doesn't overflow
68-
*/
69-
req_sects = min_t(sector_t, nr_sects,
70-
q->limits.max_discard_sectors);
7159
if (!req_sects)
7260
goto fail;
7361
if (req_sects > UINT_MAX >> 9)
7462
req_sects = UINT_MAX >> 9;
7563

76-
/*
77-
* If splitting a request, and the next starting sector would be
78-
* misaligned, stop the discard at the previous aligned sector.
79-
*/
8064
end_sect = sector + req_sects;
81-
tmp = end_sect;
82-
if (req_sects < nr_sects &&
83-
sector_div(tmp, granularity) != alignment) {
84-
end_sect = end_sect - alignment;
85-
sector_div(end_sect, granularity);
86-
end_sect = end_sect * granularity + alignment;
87-
req_sects = end_sect - sector;
88-
}
8965

9066
bio = next_bio(bio, 0, gfp_mask);
9167
bio->bi_iter.bi_sector = sector;

drivers/nvme/host/core.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3143,8 +3143,8 @@ static void nvme_ns_remove(struct nvme_ns *ns)
31433143
}
31443144

31453145
mutex_lock(&ns->ctrl->subsys->lock);
3146-
nvme_mpath_clear_current_path(ns);
31473146
list_del_rcu(&ns->siblings);
3147+
nvme_mpath_clear_current_path(ns);
31483148
mutex_unlock(&ns->ctrl->subsys->lock);
31493149

31503150
down_write(&ns->ctrl->namespaces_rwsem);

0 commit comments

Comments
 (0)