From: Mike Snitzer <snitzer@redhat.com>
To: dm-devel@redhat.com
Cc: Ming Lei <ming.lei@redhat.com>
Subject: Re: [PATCH v2 2/9] dm: eliminate 'split_discard_bios' flag from DM target interface
Date: Wed, 20 Feb 2019 23:36:26 -0500 [thread overview]
Message-ID: <20190221043626.GC31000@redhat.com> (raw)
In-Reply-To: <20190220214436.38476-3-snitzer@redhat.com>
On Wed, Feb 20 2019 at 4:44pm -0500,
Mike Snitzer <snitzer@redhat.com> wrote:
> There is no need to have DM core split discards on behalf of a DM target
> now that blk_queue_split() handles splitting discards based on the
> queue_limits. A DM target just needs to set max_discard_sectors,
> discard_granularity, etc, in queue_limits.
>
> Signed-off-by: Mike Snitzer <snitzer@redhat.com>
> ---
> drivers/md/dm-cache-target.c | 1 -
> drivers/md/dm-raid.c | 14 +++++++++-----
> drivers/md/dm-thin.c | 1 -
> drivers/md/dm-zoned-target.c | 1 -
> drivers/md/dm.c | 28 ++++++----------------------
> include/linux/device-mapper.h | 6 ------
> include/uapi/linux/dm-ioctl.h | 4 ++--
> 7 files changed, 17 insertions(+), 38 deletions(-)
>
...
> diff --git a/drivers/md/dm.c b/drivers/md/dm.c
> index 7a774fcd0194..b988e178a523 100644
> --- a/drivers/md/dm.c
> +++ b/drivers/md/dm.c
> @@ -1478,17 +1478,10 @@ static unsigned get_num_write_zeroes_bios(struct dm_target *ti)
> return ti->num_write_zeroes_bios;
> }
>
> -typedef bool (*is_split_required_fn)(struct dm_target *ti);
> -
> -static bool is_split_required_for_discard(struct dm_target *ti)
> -{
> - return ti->split_discard_bios;
> -}
> -
> static int __send_changing_extent_only(struct clone_info *ci, struct dm_target *ti,
> - unsigned num_bios, bool is_split_required)
> + unsigned num_bios)
> {
> - unsigned len;
> + unsigned len = ci->sector_count;
>
> /*
> * Even though the device advertised support for this type of
> @@ -1499,38 +1492,29 @@ static int __send_changing_extent_only(struct clone_info *ci, struct dm_target *
> if (!num_bios)
> return -EOPNOTSUPP;
>
> - if (!is_split_required)
> - len = min((sector_t)ci->sector_count, max_io_len_target_boundary(ci->sector, ti));
> - else
> - len = min((sector_t)ci->sector_count, max_io_len(ci->sector, ti));
> -
> __send_duplicate_bios(ci, ti, num_bios, &len);
>
> - ci->sector += len;
> - ci->sector_count -= len;
> -
> return 0;
> }
The above was bogus, ci->sector and ci->sector_count must be updated.
Reintroducing adjustments based on 'len' fixed a discard crash Ming
reported.
Now fixed in linux-next.
Mike
next prev parent reply other threads:[~2019-02-21 4:36 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-02-20 21:44 [PATCH v2 0/9] dm: changes staged in linux-next for 5.1 so far Mike Snitzer
2019-02-20 21:44 ` [PATCH v2 1/9] dm: update dm_process_bio() to split bio if in ->make_request_fn() Mike Snitzer
2019-02-20 21:44 ` [PATCH v2 2/9] dm: eliminate 'split_discard_bios' flag from DM target interface Mike Snitzer
2019-02-21 4:36 ` Mike Snitzer [this message]
2019-02-20 21:44 ` [PATCH v2 3/9] dm: refactor start_io_acct and end_io_acct Mike Snitzer
2019-02-20 21:44 ` [PATCH v2 4/9] dm: implement noclone optimization for bio-based Mike Snitzer
2019-02-20 21:44 ` [PATCH v2 5/9] dm: improve noclone bio support Mike Snitzer
2019-02-22 10:59 ` Mikulas Patocka
2019-02-22 15:22 ` Mike Snitzer
2019-02-22 16:56 ` Mike Snitzer
2019-02-20 21:44 ` [PATCH v2 6/9] dm: add per-bio-data support to noclone bio Mike Snitzer
2019-02-20 21:44 ` [PATCH v2 7/9] dm: improve noclone_endio() to support multipath target Mike Snitzer
2019-02-20 21:44 ` [PATCH v2 8/9] dm mpath: enable noclone support for bio-based Mike Snitzer
2019-02-20 21:44 ` [PATCH v2 9/9] dm: remove unused _rq_tio_cache and _rq_cache Mike Snitzer
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190221043626.GC31000@redhat.com \
--to=snitzer@redhat.com \
--cc=dm-devel@redhat.com \
--cc=ming.lei@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.