From: Jeffle Xu <jefflexu@linux.alibaba.com>
To: gregkh@linuxfoundation.org, sashal@kernel.org
Cc: stable@vger.kernel.org, jefflexu@linux.alibaba.com, snitzer@redhat.com
Subject: [PATCH 5.4.y 2/4] dm table: fix partial completion iterate_devices based device capability checks
Date: Fri, 5 Mar 2021 14:57:20 +0800 [thread overview]
Message-ID: <20210305065722.73504-3-jefflexu@linux.alibaba.com> (raw)
In-Reply-To: <20210305065722.73504-1-jefflexu@linux.alibaba.com>
Similar to commit a4c8dd9c2d09 ("dm table: fix iterate_devices based
device capability checks"), fix partial completion capability check and
invert logic of the corresponding iterate_devices_callout_fn so that all
devices' partial completion capabilities are properly checked.
Signed-off-by: Jeffle Xu <jefflexu@linux.alibaba.com>
Fixes: 22c11858e800 ("dm: introduce DM_TYPE_NVME_BIO_BASED")
---
drivers/md/dm-table.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/md/dm-table.c b/drivers/md/dm-table.c
index bf704d238662..c470e174e686 100644
--- a/drivers/md/dm-table.c
+++ b/drivers/md/dm-table.c
@@ -1748,18 +1748,18 @@ static int device_is_not_random(struct dm_target *ti, struct dm_dev *dev,
return q && !blk_queue_add_random(q);
}
-static int device_no_partial_completion(struct dm_target *ti, struct dm_dev *dev,
+static int device_is_partial_completion(struct dm_target *ti, struct dm_dev *dev,
sector_t start, sector_t len, void *data)
{
char b[BDEVNAME_SIZE];
/* For now, NVMe devices are the only devices of this class */
- return (strncmp(bdevname(dev->bdev, b), "nvme", 4) == 0);
+ return (strncmp(bdevname(dev->bdev, b), "nvme", 4) != 0);
}
static bool dm_table_does_not_support_partial_completion(struct dm_table *t)
{
- return dm_table_all_devices_attribute(t, device_no_partial_completion);
+ return !dm_table_any_dev_attr(t, device_is_partial_completion);
}
static int device_not_write_same_capable(struct dm_target *ti, struct dm_dev *dev,
--
2.27.0
next prev parent reply other threads:[~2021-03-05 6:57 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-03-01 13:44 FAILED: patch "[PATCH] dm table: fix iterate_devices based device capability checks" failed to apply to 5.4-stable tree gregkh
2021-03-05 6:57 ` [PATCH 5.4.y 0/4] dm: device capability check fixes Jeffle Xu
2021-03-05 6:57 ` [PATCH 5.4.y 1/4] dm table: fix iterate_devices based device capability checks Jeffle Xu
2021-03-07 15:11 ` Greg KH
2021-03-05 6:57 ` Jeffle Xu [this message]
2021-03-05 8:44 ` [PATCH 5.4.y 2/4] dm table: fix partial completion " Greg KH
2021-03-05 8:57 ` JeffleXu
2021-03-05 6:57 ` [PATCH 5.4.y 3/4] dm table: fix DAX " Jeffle Xu
2021-03-07 15:06 ` Greg KH
2021-03-08 2:05 ` JeffleXu
2021-03-05 6:57 ` [PATCH 5.4.y 4/4] dm table: fix zoned " Jeffle Xu
2021-03-05 8:49 ` [PATCH 5.4.y 0/4] dm: device capability check fixes Greg KH
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=20210305065722.73504-3-jefflexu@linux.alibaba.com \
--to=jefflexu@linux.alibaba.com \
--cc=gregkh@linuxfoundation.org \
--cc=sashal@kernel.org \
--cc=snitzer@redhat.com \
--cc=stable@vger.kernel.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox