History

Merge tag 'block-6.7-2023-11-23' of git://git.kernel.dk/linux

Pull block fixes from Jens Axboe: "A bit bigger than usual at this time, but nothing really earth shattering: - NVMe pull request via Keith: - TCP TLS fixes (Hannes) - Authentifaction fixes (Mark, Hannes) - Properly terminate target names (Christoph) - MD pull request via Song, fixing a raid5 corruption issue - Disentanglement of the dependency mess in nvme introduced with the tls additions. Now it should actually build on all configs (Arnd) - Series of bcache fixes (Coly) - Removal of a dead helper (Damien) - s390 dasd fix (Muhammad, Jan) - lockdep blk-cgroup fixes (Ming)" * tag 'block-6.7-2023-11-23' of git://git.kernel.dk/linux: (33 commits) nvme: tcp: fix compile-time checks for TLS mode nvme: target: fix Kconfig select statements nvme: target: fix nvme_keyring_id() references nvme: move nvme_stop_keep_alive() back to original position nbd: pass nbd_sock to nbd_read_reply() instead of index s390/dasd: protect device queue against concurrent access s390/dasd: resolve spelling mistake block/null_blk: Fix double blk_mq_start_request() warning nvmet-tcp: always initialize tls_handshake_tmo_work nvmet: nul-terminate the NQNs passed in the connect command nvme: blank out authentication fabrics options if not configured nvme: catch errors from nvme_configure_metadata() nvme-tcp: only evaluate 'tls' option if TLS is selected nvme-auth: set explanation code for failure2 msgs nvme-auth: unlock mutex in one place only block: Remove blk_set_runtime_active() nbd: fix null-ptr-dereference while accessing 'nbd->config' nbd: factor out a helper to get nbd_config without holding 'config_lock' nbd: fold nbd config initialization into nbd_alloc_config() bcache: avoid NULL checking to c->root in run_cache_set() ...

Linus Torvalds committed 2 years ago

Commit bc893f72 parents 0044423 0e6c4fe25 files · +210 −148Browse files

Unified · Split

25 files
  1. block/blk-cgroup.c +13 −0
  2. block/blk-cgroup.h +0 −2
  3. block/blk-pm.c +5 −28
  4. block/blk-throttle.c +2 −0
  5. drivers/block/nbd.c +75 −42
  6. drivers/block/null_blk/main.c +13 −12
  7. drivers/md/bcache/bcache.h +1 −0
  8. drivers/md/bcache/btree.c +10 −1
  9. drivers/md/bcache/super.c +3 −1
  10. drivers/md/bcache/sysfs.c +1 −1
  11. drivers/md/bcache/writeback.c +18 −6
  12. drivers/md/md.c +2 −1
  13. drivers/nvme/host/auth.c +3 −2
  14. drivers/nvme/host/core.c +14 −7
  15. drivers/nvme/host/fabrics.c +2 −0
  16. drivers/nvme/host/fc.c +8 −11
  17. drivers/nvme/host/rdma.c +1 −0
  18. drivers/nvme/host/tcp.c +15 −17
  19. drivers/nvme/target/Kconfig +2 −2
  20. drivers/nvme/target/configfs.c +1 −1
  21. drivers/nvme/target/fabrics-cmd.c +4 −0
  22. drivers/nvme/target/tcp.c +3 −1
  23. drivers/s390/block/dasd.c +13 −11
  24. drivers/s390/block/dasd_int.h +1 −1
  25. include/linux/blk-pm.h +0 −1
block/blk-cgroup.c+13−0
@@ -577,6 +577,7 @@ static void blkg_destroy_all(struct gendisk *disk) · 576 unmodified lines
577577 struct request_queue *q = disk->queue;
578578 struct blkcg_gq *blkg, *n;
579579 int count = BLKG_DESTROY_BATCH_SIZE;
580+ int i;
580581
581582 restart:
582583 spin_lock_irq(&q->queue_lock);
@@ -602,6 +603,18 @@ restart: · 19 unmodified lines
602603 }
603604 }
604605
606+ /*
607+ * Mark policy deactivated since policy offline has been done, and
608+ * the free is scheduled, so future blkcg_deactivate_policy() can
609+ * be bypassed
610+ */
611+ for (i = 0; i < BLKCG_MAX_POLS; i++) {
612+ struct blkcg_policy *pol = blkcg_policy[i];
613+
614+ if (pol)
615+ __clear_bit(pol->plid, q->blkcg_pols);
616+ }
617+
605618 q->root_blkg = NULL;
606619 spin_unlock_irq(&q->queue_lock);
607620 }
block/blk-cgroup.h+0−2
@@ -249,8 +249,6 @@ static inline struct blkcg_gq *blkg_lookup(struct blkcg *blkcg, · 248 unmodified lines
249249 {
250250 struct blkcg_gq *blkg;
251251
252− WARN_ON_ONCE(!rcu_read_lock_held());
253−
254252 if (blkcg == &blkcg_root)
255253 return q->root_blkg;
256254
block/blk-pm.c+5−28
@@ -163,38 +163,15 @@ EXPORT_SYMBOL(blk_pre_runtime_resume); · 162 unmodified lines
163163 * @q: the queue of the device
164164 *
165165 * Description:
166− * For historical reasons, this routine merely calls blk_set_runtime_active()
167− * to do the real work of restarting the queue. It does this regardless of
168− * whether the device's runtime-resume succeeded; even if it failed the
166+ * Restart the queue of a runtime suspended device. It does this regardless
167+ * of whether the device's runtime-resume succeeded; even if it failed the
169168 * driver or error handler will need to communicate with the device.
170169 *
171170 * This function should be called near the end of the device's
172− * runtime_resume callback.
171+ * runtime_resume callback to correct queue runtime PM status and re-enable
172+ * peeking requests from the queue.
173173 */
174174 void blk_post_runtime_resume(struct request_queue *q)
175−{
176− blk_set_runtime_active(q);
177−}
178−EXPORT_SYMBOL(blk_post_runtime_resume);
179−
180−/**
181− * blk_set_runtime_active - Force runtime status of the queue to be active
182− * @q: the queue of the device
183− *
184− * If the device is left runtime suspended during system suspend the resume
185− * hook typically resumes the device and corrects runtime status
186− * accordingly. However, that does not affect the queue runtime PM status
187− * which is still "suspended". This prevents processing requests from the
188− * queue.
189− *
190− * This function can be used in driver's resume hook to correct queue
191− * runtime PM status and re-enable peeking requests from the queue. It
192− * should be called before first request is added to the queue.
193− *
194− * This function is also called by blk_post_runtime_resume() for
195− * runtime resumes. It does everything necessary to restart the queue.
196− */
197−void blk_set_runtime_active(struct request_queue *q)
198175 {
199176 int old_status;
200177
@@ -211,4 +188,4 @@ void blk_set_runtime_active(struct request_queue *q) · 10 unmodified lines
211188 if (old_status != RPM_ACTIVE)
212189 blk_clear_pm_only(q);
213190 }
214−EXPORT_SYMBOL(blk_set_runtime_active);
191+EXPORT_SYMBOL(blk_post_runtime_resume);
block/blk-throttle.c+2−0
@@ -1320,6 +1320,7 @@ static void tg_conf_updated(struct throtl_grp *tg, bool global) · 1319 unmodified lines
13201320 tg_bps_limit(tg, READ), tg_bps_limit(tg, WRITE),
13211321 tg_iops_limit(tg, READ), tg_iops_limit(tg, WRITE));
13221322
1323+ rcu_read_lock();
13231324 /*
13241325 * Update has_rules[] flags for the updated tg's subtree. A tg is
13251326 * considered to have rules if either the tg itself or any of its
@@ -1347,6 +1348,7 @@ static void tg_conf_updated(struct throtl_grp *tg, bool global) · 21 unmodified lines
13471348 this_tg->latency_target = max(this_tg->latency_target,
13481349 parent_tg->latency_target);
13491350 }
1351+ rcu_read_unlock();
13501352
13511353 /*
13521354 * We're already holding queue_lock and know @tg is valid. Let's
drivers/block/nbd.c+75−42
@@ -67,6 +67,7 @@ struct nbd_sock { · 66 unmodified lines
6767 struct recv_thread_args {
6868 struct work_struct work;
6969 struct nbd_device *nbd;
70+ struct nbd_sock *nsock;
7071 int index;
7172 };
7273
@@ -395,6 +396,22 @@ static u32 req_to_nbd_cmd_type(struct request *req) · 322 unmodified lines
395396 }
396397 }
397398
399+static struct nbd_config *nbd_get_config_unlocked(struct nbd_device *nbd)
400+{
401+ if (refcount_inc_not_zero(&nbd->config_refs)) {
402+ /*
403+ * Add smp_mb__after_atomic to ensure that reading nbd->config_refs
404+ * and reading nbd->config is ordered. The pair is the barrier in
405+ * nbd_alloc_and_init_config(), avoid nbd->config_refs is set
406+ * before nbd->config.
407+ */
408+ smp_mb__after_atomic();
409+ return nbd->config;
410+ }
411+
412+ return NULL;
413+}
414+
398415 static enum blk_eh_timer_return nbd_xmit_timeout(struct request *req)
399416 {
400417 struct nbd_cmd *cmd = blk_mq_rq_to_pdu(req);
@@ -409,13 +426,13 @@ static enum blk_eh_timer_return nbd_xmit_timeout(struct request *req) · 8 unmodified lines
409426 return BLK_EH_DONE;
410427 }
411428
412− if (!refcount_inc_not_zero(&nbd->config_refs)) {
429+ config = nbd_get_config_unlocked(nbd);
430+ if (!config) {
413431 cmd->status = BLK_STS_TIMEOUT;
414432 __clear_bit(NBD_CMD_INFLIGHT, &cmd->flags);
415433 mutex_unlock(&cmd->lock);
416434 goto done;
417435 }
418− config = nbd->config;
419436
420437 if (config->num_connections > 1 ||
421438 (config->num_connections == 1 && nbd->tag_set.timeout)) {
@@ -489,15 +506,9 @@ done: · 67 unmodified lines
489506 return BLK_EH_DONE;
490507 }
491508
492−/*
493− * Send or receive packet. Return a positive value on success and
494− * negtive value on failue, and never return 0.
495− */
496−static int sock_xmit(struct nbd_device *nbd, int index, int send,
497− struct iov_iter *iter, int msg_flags, int *sent)
509+static int __sock_xmit(struct nbd_device *nbd, struct socket *sock, int send,
510+ struct iov_iter *iter, int msg_flags, int *sent)
498511 {
499− struct nbd_config *config = nbd->config;
500− struct socket *sock = config->socks[index]->sock;
501512 int result;
502513 struct msghdr msg;
503514 unsigned int noreclaim_flag;
@@ -540,6 +551,19 @@ static int sock_xmit(struct nbd_device *nbd, int index, int send, · 36 unmodified lines
540551 return result;
541552 }
542553
554+/*
555+ * Send or receive packet. Return a positive value on success and
556+ * negtive value on failure, and never return 0.
557+ */
558+static int sock_xmit(struct nbd_device *nbd, int index, int send,
559+ struct iov_iter *iter, int msg_flags, int *sent)
560+{
561+ struct nbd_config *config = nbd->config;
562+ struct socket *sock = config->socks[index]->sock;
563+
564+ return __sock_xmit(nbd, sock, send, iter, msg_flags, sent);
565+}
566+
543567 /*
544568 * Different settings for sk->sk_sndtimeo can result in different return values
545569 * if there is a signal pending when we enter sendmsg, because reasons?
@@ -696,7 +720,7 @@ out: · 150 unmodified lines
696720 return 0;
697721 }
698722
699−static int nbd_read_reply(struct nbd_device *nbd, int index,
723+static int nbd_read_reply(struct nbd_device *nbd, struct socket *sock,
700724 struct nbd_reply *reply)
701725 {
702726 struct kvec iov = {.iov_base = reply, .iov_len = sizeof(*reply)};
@@ -705,7 +729,7 @@ static int nbd_read_reply(struct nbd_device *nbd, int index, · 2 unmodified lines
705729
706730 reply->magic = 0;
707731 iov_iter_kvec(&to, ITER_DEST, &iov, 1, sizeof(*reply));
708− result = sock_xmit(nbd, index, 0, &to, MSG_WAITALL, NULL);
732+ result = __sock_xmit(nbd, sock, 0, &to, MSG_WAITALL, NULL);
709733 if (result < 0) {
710734 if (!nbd_disconnected(nbd->config))
711735 dev_err(disk_to_dev(nbd->disk),
@@ -829,14 +853,14 @@ static void recv_work(struct work_struct *work) · 117 unmodified lines
829853 struct nbd_device *nbd = args->nbd;
830854 struct nbd_config *config = nbd->config;
831855 struct request_queue *q = nbd->disk->queue;
832− struct nbd_sock *nsock;
856+ struct nbd_sock *nsock = args->nsock;
833857 struct nbd_cmd *cmd;
834858 struct request *rq;
835859
836860 while (1) {
837861 struct nbd_reply reply;
838862
839− if (nbd_read_reply(nbd, args->index, &reply))
863+ if (nbd_read_reply(nbd, nsock->sock, &reply))
840864 break;
841865
842866 /*
@@ -871,7 +895,6 @@ static void recv_work(struct work_struct *work) · 28 unmodified lines
871895 percpu_ref_put(&q->q_usage_counter);
872896 }
873897
874− nsock = config->socks[args->index];
875898 mutex_lock(&nsock->tx_lock);
876899 nbd_mark_nsock_dead(nbd, nsock, 1);
877900 mutex_unlock(&nsock->tx_lock);
@@ -977,12 +1000,12 @@ static int nbd_handle_cmd(struct nbd_cmd *cmd, int index) · 99 unmodified lines
9771000 struct nbd_sock *nsock;
9781001 int ret;
9791002
980− if (!refcount_inc_not_zero(&nbd->config_refs)) {
1003+ config = nbd_get_config_unlocked(nbd);
1004+ if (!config) {
9811005 dev_err_ratelimited(disk_to_dev(nbd->disk),
9821006 "Socks array is empty\n");
9831007 return -EINVAL;
9841008 }
985− config = nbd->config;
9861009
9871010 if (index >= config->num_connections) {
9881011 dev_err_ratelimited(disk_to_dev(nbd->disk),
@@ -1215,6 +1238,7 @@ static int nbd_reconnect_socket(struct nbd_device *nbd, unsigned long arg) · 226 unmodified lines
12151238 INIT_WORK(&args->work, recv_work);
12161239 args->index = i;
12171240 args->nbd = nbd;
1241+ args->nsock = nsock;
12181242 nsock->cookie++;
12191243 mutex_unlock(&nsock->tx_lock);
12201244 sockfd_put(old);
@@ -1397,6 +1421,7 @@ static int nbd_start_device(struct nbd_device *nbd) · 176 unmodified lines
13971421 refcount_inc(&nbd->config_refs);
13981422 INIT_WORK(&args->work, recv_work);
13991423 args->nbd = nbd;
1424+ args->nsock = config->socks[i];
14001425 args->index = i;
14011426 queue_work(nbd->recv_workq, &args->work);
14021427 }
@@ -1530,17 +1555,20 @@ static int nbd_ioctl(struct block_device *bdev, blk_mode_t mode, · 127 unmodified lines
15301555 return error;
15311556 }
15321557
1533−static struct nbd_config *nbd_alloc_config(void)
1558+static int nbd_alloc_and_init_config(struct nbd_device *nbd)
15341559 {
15351560 struct nbd_config *config;
15361561
1562+ if (WARN_ON(nbd->config))
1563+ return -EINVAL;
1564+
15371565 if (!try_module_get(THIS_MODULE))
1538− return ERR_PTR(-ENODEV);
1566+ return -ENODEV;
15391567
15401568 config = kzalloc(sizeof(struct nbd_config), GFP_NOFS);
15411569 if (!config) {
15421570 module_put(THIS_MODULE);
1543− return ERR_PTR(-ENOMEM);
1571+ return -ENOMEM;
15441572 }
15451573
15461574 atomic_set(&config->recv_threads, 0);
@@ -1548,12 +1576,24 @@ static struct nbd_config *nbd_alloc_config(void) · 1 unmodified line
15481576 init_waitqueue_head(&config->conn_wait);
15491577 config->blksize_bits = NBD_DEF_BLKSIZE_BITS;
15501578 atomic_set(&config->live_connections, 0);
1551− return config;
1579+
1580+ nbd->config = config;
1581+ /*
1582+ * Order refcount_set(&nbd->config_refs, 1) and nbd->config assignment,
1583+ * its pair is the barrier in nbd_get_config_unlocked().
1584+ * So nbd_get_config_unlocked() won't see nbd->config as null after
1585+ * refcount_inc_not_zero() succeed.
1586+ */
1587+ smp_mb__before_atomic();
1588+ refcount_set(&nbd->config_refs, 1);
1589+
1590+ return 0;
15521591 }
15531592
15541593 static int nbd_open(struct gendisk *disk, blk_mode_t mode)
15551594 {
15561595 struct nbd_device *nbd;
1596+ struct nbd_config *config;
15571597 int ret = 0;
15581598
15591599 mutex_lock(&nbd_index_mutex);
@@ -1566,27 +1606,25 @@ static int nbd_open(struct gendisk *disk, blk_mode_t mode) · 6 unmodified lines
15661606 ret = -ENXIO;
15671607 goto out;
15681608 }
1569− if (!refcount_inc_not_zero(&nbd->config_refs)) {
1570− struct nbd_config *config;
15711609
1610+ config = nbd_get_config_unlocked(nbd);
1611+ if (!config) {
15721612 mutex_lock(&nbd->config_lock);
15731613 if (refcount_inc_not_zero(&nbd->config_refs)) {
15741614 mutex_unlock(&nbd->config_lock);
15751615 goto out;
15761616 }
1577− config = nbd_alloc_config();
1578− if (IS_ERR(config)) {
1579− ret = PTR_ERR(config);
1617+ ret = nbd_alloc_and_init_config(nbd);
1618+ if (ret) {
15801619 mutex_unlock(&nbd->config_lock);
15811620 goto out;
15821621 }
1583− nbd->config = config;
1584− refcount_set(&nbd->config_refs, 1);
1622+
15851623 refcount_inc(&nbd->refs);
15861624 mutex_unlock(&nbd->config_lock);
15871625 if (max_part)
15881626 set_bit(GD_NEED_PART_SCAN, &disk->state);
1589− } else if (nbd_disconnected(nbd->config)) {
1627+ } else if (nbd_disconnected(config)) {
15901628 if (max_part)
15911629 set_bit(GD_NEED_PART_SCAN, &disk->state);
15921630 }
@@ -1990,22 +2028,17 @@ again: · 397 unmodified lines
19902028 pr_err("nbd%d already in use\n", index);
19912029 return -EBUSY;
19922030 }
1993− if (WARN_ON(nbd->config)) {
1994− mutex_unlock(&nbd->config_lock);
1995− nbd_put(nbd);
1996− return -EINVAL;
1997− }
1998− config = nbd_alloc_config();
1999− if (IS_ERR(config)) {
2031+
2032+ ret = nbd_alloc_and_init_config(nbd);
2033+ if (ret) {
20002034 mutex_unlock(&nbd->config_lock);
20012035 nbd_put(nbd);
20022036 pr_err("couldn't allocate config\n");
2003− return PTR_ERR(config);
2037+ return ret;
20042038 }
2005− nbd->config = config;
2006− refcount_set(&nbd->config_refs, 1);
2007− set_bit(NBD_RT_BOUND, &config->runtime_flags);
20082039
2040+ config = nbd->config;
2041+ set_bit(NBD_RT_BOUND, &config->runtime_flags);
20092042 ret = nbd_genl_size_set(info, nbd);
20102043 if (ret)
20112044 goto out;
@@ -2208,7 +2241,8 @@ static int nbd_genl_reconfigure(struct sk_buff *skb, struct genl_info *info) · 196 unmodified lines
22082241 }
22092242 mutex_unlock(&nbd_index_mutex);
22102243
2211− if (!refcount_inc_not_zero(&nbd->config_refs)) {
2244+ config = nbd_get_config_unlocked(nbd);
2245+ if (!config) {
22122246 dev_err(nbd_to_dev(nbd),
22132247 "not configured, cannot reconfigure\n");
22142248 nbd_put(nbd);
@@ -2216,7 +2250,6 @@ static int nbd_genl_reconfigure(struct sk_buff *skb, struct genl_info *info) · 1 unmodified line
22162250 }
22172251
22182252 mutex_lock(&nbd->config_lock);
2219− config = nbd->config;
22202253 if (!test_bit(NBD_RT_BOUND, &config->runtime_flags) ||
22212254 !nbd->pid) {
22222255 dev_err(nbd_to_dev(nbd),
drivers/block/null_blk/main.c+13−12
@@ -1464,19 +1464,13 @@ blk_status_t null_process_cmd(struct nullb_cmd *cmd, enum req_op op, · 1463 unmodified lines
14641464 return BLK_STS_OK;
14651465 }
14661466
1467−static blk_status_t null_handle_cmd(struct nullb_cmd *cmd, sector_t sector,
1468− sector_t nr_sectors, enum req_op op)
1467+static void null_handle_cmd(struct nullb_cmd *cmd, sector_t sector,
1468+ sector_t nr_sectors, enum req_op op)
14691469 {
14701470 struct nullb_device *dev = cmd->nq->dev;
14711471 struct nullb *nullb = dev->nullb;
14721472 blk_status_t sts;
14731473
1474− if (test_bit(NULLB_DEV_FL_THROTTLED, &dev->flags)) {
1475− sts = null_handle_throttled(cmd);
1476− if (sts != BLK_STS_OK)
1477− return sts;
1478− }
1479−
14801474 if (op == REQ_OP_FLUSH) {
14811475 cmd->error = errno_to_blk_status(null_handle_flush(nullb));
14821476 goto out;
@@ -1493,7 +1487,6 @@ static blk_status_t null_handle_cmd(struct nullb_cmd *cmd, sector_t sector, · 10 unmodified lines
14931487
14941488 out:
14951489 nullb_complete_cmd(cmd);
1496− return BLK_STS_OK;
14971490 }
14981491
14991492 static enum hrtimer_restart nullb_bwtimer_fn(struct hrtimer *timer)
@@ -1724,8 +1717,6 @@ static blk_status_t null_queue_rq(struct blk_mq_hw_ctx *hctx, · 224 unmodified lines
17241717 cmd->fake_timeout = should_timeout_request(rq) ||
17251718 blk_should_fake_timeout(rq->q);
17261719
1727− blk_mq_start_request(rq);
1728−
17291720 if (should_requeue_request(rq)) {
17301721 /*
17311722 * Alternate between hitting the core BUSY path, and the
@@ -1738,6 +1729,15 @@ static blk_status_t null_queue_rq(struct blk_mq_hw_ctx *hctx, · 6 unmodified lines
17381729 return BLK_STS_OK;
17391730 }
17401731
1732+ if (test_bit(NULLB_DEV_FL_THROTTLED, &nq->dev->flags)) {
1733+ blk_status_t sts = null_handle_throttled(cmd);
1734+
1735+ if (sts != BLK_STS_OK)
1736+ return sts;
1737+ }
1738+
1739+ blk_mq_start_request(rq);
1740+
17411741 if (is_poll) {
17421742 spin_lock(&nq->poll_lock);
17431743 list_add_tail(&rq->queuelist, &nq->poll_list);
@@ -1747,7 +1747,8 @@ static blk_status_t null_queue_rq(struct blk_mq_hw_ctx *hctx, · 3 unmodified lines
17471747 if (cmd->fake_timeout)
17481748 return BLK_STS_OK;
17491749
1750− return null_handle_cmd(cmd, sector, nr_sectors, req_op(rq));
1750+ null_handle_cmd(cmd, sector, nr_sectors, req_op(rq));
1751+ return BLK_STS_OK;
17511752 }
17521753
17531754 static void null_queue_rqs(struct request **rqlist)
drivers/md/bcache/bcache.h+1−0
@@ -265,6 +265,7 @@ struct bcache_device { · 264 unmodified lines
265265 #define BCACHE_DEV_WB_RUNNING 3
266266 #define BCACHE_DEV_RATE_DW_RUNNING 4
267267 int nr_stripes;
268+#define BCH_MIN_STRIPE_SZ ((4 << 20) >> SECTOR_SHIFT)
268269 unsigned int stripe_size;
269270 atomic_t *stripe_sectors_dirty;
270271 unsigned long *full_dirty_stripes;
drivers/md/bcache/btree.c+10−1
@@ -1000,6 +1000,9 @@ err: · 999 unmodified lines
10001000 *
10011001 * The btree node will have either a read or a write lock held, depending on
10021002 * level and op->lock.
1003+ *
1004+ * Note: Only error code or btree pointer will be returned, it is unncessary
1005+ * for callers to check NULL pointer.
10031006 */
10041007 struct btree *bch_btree_node_get(struct cache_set *c, struct btree_op *op,
10051008 struct bkey *k, int level, bool write,
@@ -1111,6 +1114,10 @@ retry: · 105 unmodified lines
11111114 mutex_unlock(&b->c->bucket_lock);
11121115 }
11131116
1117+/*
1118+ * Only error code or btree pointer will be returned, it is unncessary for
1119+ * callers to check NULL pointer.
1120+ */
11141121 struct btree *__bch_btree_node_alloc(struct cache_set *c, struct btree_op *op,
11151122 int level, bool wait,
11161123 struct btree *parent)
@@ -1368,7 +1375,7 @@ static int btree_gc_coalesce(struct btree *b, struct btree_op *op, · 251 unmodified lines
13681375 memset(new_nodes, 0, sizeof(new_nodes));
13691376 closure_init_stack(&cl);
13701377
1371− while (nodes < GC_MERGE_NODES && !IS_ERR(r[nodes].b))
1378+ while (nodes < GC_MERGE_NODES && !IS_ERR_OR_NULL(r[nodes].b))
13721379 keys += r[nodes++].keys;
13731380
13741381 blocks = btree_default_blocks(b->c) * 2 / 3;
@@ -1532,6 +1539,8 @@ static int btree_gc_rewrite_node(struct btree *b, struct btree_op *op, · 157 unmodified lines
15321539 return 0;
15331540
15341541 n = btree_node_alloc_replacement(replace, NULL);
1542+ if (IS_ERR(n))
1543+ return 0;
15351544
15361545 /* recheck reserve after allocating replacement node */
15371546 if (btree_check_reserve(b, NULL)) {
drivers/md/bcache/super.c+3−1
@@ -905,6 +905,8 @@ static int bcache_device_init(struct bcache_device *d, unsigned int block_size, · 904 unmodified lines
905905
906906 if (!d->stripe_size)
907907 d->stripe_size = 1 << 31;
908+ else if (d->stripe_size < BCH_MIN_STRIPE_SZ)
909+ d->stripe_size = roundup(BCH_MIN_STRIPE_SZ, d->stripe_size);
908910
909911 n = DIV_ROUND_UP_ULL(sectors, d->stripe_size);
910912 if (!n || n > max_stripes) {
@@ -2016,7 +2018,7 @@ static int run_cache_set(struct cache_set *c) · 1105 unmodified lines
20162018 c->root = bch_btree_node_get(c, NULL, k,
20172019 j->btree_level,
20182020 true, NULL);
2019− if (IS_ERR_OR_NULL(c->root))
2021+ if (IS_ERR(c->root))
20202022 goto err;
20212023
20222024 list_del_init(&c->root->list);
drivers/md/bcache/sysfs.c+1−1
@@ -1104,7 +1104,7 @@ SHOW(__bch_cache) · 1103 unmodified lines
11041104 sum += INITIAL_PRIO - cached[i];
11051105
11061106 if (n)
1107− do_div(sum, n);
1107+ sum = div64_u64(sum, n);
11081108
11091109 for (i = 0; i < ARRAY_SIZE(q); i++)
11101110 q[i] = INITIAL_PRIO - cached[n * (i + 1) /
drivers/md/bcache/writeback.c+18−6
@@ -913,7 +913,7 @@ static int bch_dirty_init_thread(void *arg) · 912 unmodified lines
913913 int cur_idx, prev_idx, skip_nr;
914914
915915 k = p = NULL;
916− cur_idx = prev_idx = 0;
916+ prev_idx = 0;
917917
918918 bch_btree_iter_init(&c->root->keys, &iter, NULL);
919919 k = bch_btree_iter_next_filter(&iter, &c->root->keys, bch_ptr_bad);
@@ -977,24 +977,35 @@ static int bch_btre_dirty_init_thread_nr(void) · 57 unmodified lines
977977 void bch_sectors_dirty_init(struct bcache_device *d)
978978 {
979979 int i;
980+ struct btree *b = NULL;
980981 struct bkey *k = NULL;
981982 struct btree_iter iter;
982983 struct sectors_dirty_init op;
983984 struct cache_set *c = d->c;
984985 struct bch_dirty_init_state state;
985986
987+retry_lock:
988+ b = c->root;
989+ rw_lock(0, b, b->level);
990+ if (b != c->root) {
991+ rw_unlock(0, b);
992+ goto retry_lock;
993+ }
994+
986995 /* Just count root keys if no leaf node */
987− rw_lock(0, c->root, c->root->level);
988996 if (c->root->level == 0) {
989997 bch_btree_op_init(&op.op, -1);
990998 op.inode = d->id;
991999 op.count = 0;
9921000
9931001 for_each_key_filter(&c->root->keys,
994− k, &iter, bch_ptr_invalid)
1002+ k, &iter, bch_ptr_invalid) {
1003+ if (KEY_INODE(k) != op.inode)
1004+ continue;
9951005 sectors_dirty_init_fn(&op.op, c->root, k);
1006+ }
9961007
997− rw_unlock(0, c->root);
1008+ rw_unlock(0, b);
9981009 return;
9991010 }
10001011
@@ -1014,23 +1025,24 @@ void bch_sectors_dirty_init(struct bcache_device *d) · 13 unmodified lines
10141025 if (atomic_read(&state.enough))
10151026 break;
10161027
1028+ atomic_inc(&state.started);
10171029 state.infos[i].state = &state;
10181030 state.infos[i].thread =
10191031 kthread_run(bch_dirty_init_thread, &state.infos[i],
10201032 "bch_dirtcnt[%d]", i);
10211033 if (IS_ERR(state.infos[i].thread)) {
10221034 pr_err("fails to run thread bch_dirty_init[%d]\n", i);
1035+ atomic_dec(&state.started);
10231036 for (--i; i >= 0; i--)
10241037 kthread_stop(state.infos[i].thread);
10251038 goto out;
10261039 }
1027− atomic_inc(&state.started);
10281040 }
10291041
10301042 out:
10311043 /* Must wait for all threads to stop. */
10321044 wait_event(state.wait, atomic_read(&state.started) == 0);
1033− rw_unlock(0, c->root);
1045+ rw_unlock(0, b);
10341046 }
10351047
10361048 void bch_cached_dev_writeback_init(struct cached_dev *dc)
drivers/md/md.c+2−1
@@ -8666,7 +8666,8 @@ static void md_end_clone_io(struct bio *bio) · 8665 unmodified lines
86668666 struct bio *orig_bio = md_io_clone->orig_bio;
86678667 struct mddev *mddev = md_io_clone->mddev;
86688668
8669− orig_bio->bi_status = bio->bi_status;
8669+ if (bio->bi_status && !orig_bio->bi_status)
8670+ orig_bio->bi_status = bio->bi_status;
86708671
86718672 if (md_io_clone->start_time)
86728673 bio_end_io_acct(orig_bio, md_io_clone->start_time);
drivers/nvme/host/auth.c+3−2
@@ -757,12 +757,11 @@ static void nvme_queue_auth_work(struct work_struct *work) · 756 unmodified lines
757757 __func__, chap->qid);
758758 mutex_lock(&ctrl->dhchap_auth_mutex);
759759 ret = nvme_auth_dhchap_setup_host_response(ctrl, chap);
760+ mutex_unlock(&ctrl->dhchap_auth_mutex);
760761 if (ret) {
761− mutex_unlock(&ctrl->dhchap_auth_mutex);
762762 chap->error = ret;
763763 goto fail2;
764764 }
765− mutex_unlock(&ctrl->dhchap_auth_mutex);
766765
767766 /* DH-HMAC-CHAP Step 3: send reply */
768767 dev_dbg(ctrl->device, "%s: qid %d send reply\n",
@@ -839,6 +838,8 @@ static void nvme_queue_auth_work(struct work_struct *work) · 70 unmodified lines
839838 }
840839
841840 fail2:
841+ if (chap->status == 0)
842+ chap->status = NVME_AUTH_DHCHAP_FAILURE_FAILED;
842843 dev_dbg(ctrl->device, "%s: qid %d send failure2, status %x\n",
843844 __func__, chap->qid, chap->status);
844845 tl = nvme_auth_set_dhchap_failure2_data(ctrl, chap);
drivers/nvme/host/core.c+14−7
@@ -482,7 +482,6 @@ EXPORT_SYMBOL_GPL(nvme_cancel_tagset); · 481 unmodified lines
482482
483483 void nvme_cancel_admin_tagset(struct nvme_ctrl *ctrl)
484484 {
485− nvme_stop_keep_alive(ctrl);
486485 if (ctrl->admin_tagset) {
487486 blk_mq_tagset_busy_iter(ctrl->admin_tagset,
488487 nvme_cancel_request, ctrl);
@@ -1814,16 +1813,18 @@ set_pi: · 1325 unmodified lines
18141813 return ret;
18151814 }
18161815
1817−static void nvme_configure_metadata(struct nvme_ns *ns, struct nvme_id_ns *id)
1816+static int nvme_configure_metadata(struct nvme_ns *ns, struct nvme_id_ns *id)
18181817 {
18191818 struct nvme_ctrl *ctrl = ns->ctrl;
1819+ int ret;
18201820
1821− if (nvme_init_ms(ns, id))
1822− return;
1821+ ret = nvme_init_ms(ns, id);
1822+ if (ret)
1823+ return ret;
18231824
18241825 ns->features &= ~(NVME_NS_METADATA_SUPPORTED | NVME_NS_EXT_LBAS);
18251826 if (!ns->ms || !(ctrl->ops->flags & NVME_F_METADATA_SUPPORTED))
1826− return;
1827+ return 0;
18271828
18281829 if (ctrl->ops->flags & NVME_F_FABRICS) {
18291830 /*
@@ -1832,7 +1833,7 @@ static void nvme_configure_metadata(struct nvme_ns *ns, struct nvme_id_ns *id) · 2 unmodified lines
18321833 * remap the separate metadata buffer from the block layer.
18331834 */
18341835 if (WARN_ON_ONCE(!(id->flbas & NVME_NS_FLBAS_META_EXT)))
1835− return;
1836+ return 0;
18361837
18371838 ns->features |= NVME_NS_EXT_LBAS;
18381839
@@ -1859,6 +1860,7 @@ static void nvme_configure_metadata(struct nvme_ns *ns, struct nvme_id_ns *id) · 20 unmodified lines
18591860 else
18601861 ns->features |= NVME_NS_METADATA_SUPPORTED;
18611862 }
1863+ return 0;
18621864 }
18631865
18641866 static void nvme_set_queue_limits(struct nvme_ctrl *ctrl,
@@ -2032,7 +2034,11 @@ static int nvme_update_ns_info_block(struct nvme_ns *ns, · 167 unmodified lines
20322034 ns->lba_shift = id->lbaf[lbaf].ds;
20332035 nvme_set_queue_limits(ns->ctrl, ns->queue);
20342036
2035− nvme_configure_metadata(ns, id);
2037+ ret = nvme_configure_metadata(ns, id);
2038+ if (ret < 0) {
2039+ blk_mq_unfreeze_queue(ns->disk->queue);
2040+ goto out;
2041+ }
20362042 nvme_set_chunk_sectors(ns, id);
20372043 nvme_update_disk_info(ns->disk, ns, id);
20382044
@@ -4348,6 +4354,7 @@ void nvme_stop_ctrl(struct nvme_ctrl *ctrl) · 2309 unmodified lines
43484354 {
43494355 nvme_mpath_stop(ctrl);
43504356 nvme_auth_stop(ctrl);
4357+ nvme_stop_keep_alive(ctrl);
43514358 nvme_stop_failfast_work(ctrl);
43524359 flush_work(&ctrl->async_event_work);
43534360 cancel_work_sync(&ctrl->fw_act_work);
drivers/nvme/host/fabrics.c+2−0
@@ -667,8 +667,10 @@ static const match_table_t opt_tokens = { · 666 unmodified lines
667667 #endif
668668 { NVMF_OPT_FAIL_FAST_TMO, "fast_io_fail_tmo=%d" },
669669 { NVMF_OPT_DISCOVERY, "discovery" },
670+#ifdef CONFIG_NVME_HOST_AUTH
670671 { NVMF_OPT_DHCHAP_SECRET, "dhchap_secret=%s" },
671672 { NVMF_OPT_DHCHAP_CTRL_SECRET, "dhchap_ctrl_secret=%s" },
673+#endif
672674 #ifdef CONFIG_NVME_TCP_TLS
673675 { NVMF_OPT_TLS, "tls" },
674676 #endif
drivers/nvme/host/fc.c+8−11
@@ -2530,12 +2530,6 @@ __nvme_fc_abort_outstanding_ios(struct nvme_fc_ctrl *ctrl, bool start_queues) · 2529 unmodified lines
25302530 * clean up the admin queue. Same thing as above.
25312531 */
25322532 nvme_quiesce_admin_queue(&ctrl->ctrl);
2533−
2534− /*
2535− * Open-coding nvme_cancel_admin_tagset() as fc
2536− * is not using nvme_cancel_request().
2537− */
2538− nvme_stop_keep_alive(&ctrl->ctrl);
25392533 blk_sync_queue(ctrl->ctrl.admin_q);
25402534 blk_mq_tagset_busy_iter(&ctrl->admin_tag_set,
25412535 nvme_fc_terminate_exchange, &ctrl->ctrl);
@@ -3138,11 +3132,12 @@ nvme_fc_create_association(struct nvme_fc_ctrl *ctrl) · 596 unmodified lines
31383132 nvme_unquiesce_admin_queue(&ctrl->ctrl);
31393133
31403134 ret = nvme_init_ctrl_finish(&ctrl->ctrl, false);
3141− if (!ret && test_bit(ASSOC_FAILED, &ctrl->flags))
3142− ret = -EIO;
31433135 if (ret)
31443136 goto out_disconnect_admin_queue;
3145−
3137+ if (test_bit(ASSOC_FAILED, &ctrl->flags)) {
3138+ ret = -EIO;
3139+ goto out_stop_keep_alive;
3140+ }
31463141 /* sanity checks */
31473142
31483143 /* FC-NVME does not have other data in the capsule */
@@ -3150,7 +3145,7 @@ nvme_fc_create_association(struct nvme_fc_ctrl *ctrl) · 1 unmodified line
31503145 dev_err(ctrl->ctrl.device, "icdoff %d is not supported!\n",
31513146 ctrl->ctrl.icdoff);
31523147 ret = NVME_SC_INVALID_FIELD | NVME_SC_DNR;
3153− goto out_disconnect_admin_queue;
3148+ goto out_stop_keep_alive;
31543149 }
31553150
31563151 /* FC-NVME supports normal SGL Data Block Descriptors */
@@ -3158,7 +3153,7 @@ nvme_fc_create_association(struct nvme_fc_ctrl *ctrl) · 1 unmodified line
31583153 dev_err(ctrl->ctrl.device,
31593154 "Mandatory sgls are not supported!\n");
31603155 ret = NVME_SC_INVALID_FIELD | NVME_SC_DNR;
3161− goto out_disconnect_admin_queue;
3156+ goto out_stop_keep_alive;
31623157 }
31633158
31643159 if (opts->queue_size > ctrl->ctrl.maxcmd) {
@@ -3205,6 +3200,8 @@ nvme_fc_create_association(struct nvme_fc_ctrl *ctrl) · 40 unmodified lines
32053200
32063201 out_term_aen_ops:
32073202 nvme_fc_term_aen_ops(ctrl);
3203+out_stop_keep_alive:
3204+ nvme_stop_keep_alive(&ctrl->ctrl);
32083205 out_disconnect_admin_queue:
32093206 dev_warn(ctrl->ctrl.device,
32103207 "NVME-FC{%d}: create_assoc failed, assoc_id %llx ret %d\n",
drivers/nvme/host/rdma.c+1−0
@@ -1080,6 +1080,7 @@ destroy_io: · 1079 unmodified lines
10801080 nvme_rdma_free_io_queues(ctrl);
10811081 }
10821082 destroy_admin:
1083+ nvme_stop_keep_alive(&ctrl->ctrl);
10831084 nvme_quiesce_admin_queue(&ctrl->ctrl);
10841085 blk_sync_queue(ctrl->ctrl.admin_q);
10851086 nvme_rdma_stop_queue(&ctrl->queues[0]);
drivers/nvme/host/tcp.c+15−17
@@ -36,11 +36,11 @@ static int so_priority; · 35 unmodified lines
3636 module_param(so_priority, int, 0644);
3737 MODULE_PARM_DESC(so_priority, "nvme tcp socket optimize priority");
3838
39−#ifdef CONFIG_NVME_TCP_TLS
4039 /*
4140 * TLS handshake timeout
4241 */
4342 static int tls_handshake_timeout = 10;
43+#ifdef CONFIG_NVME_TCP_TLS
4444 module_param(tls_handshake_timeout, int, 0644);
4545 MODULE_PARM_DESC(tls_handshake_timeout,
4646 "nvme TLS handshake timeout in seconds (default 10)");
@@ -161,10 +161,8 @@ struct nvme_tcp_queue { · 114 unmodified lines
161161 struct ahash_request *snd_hash;
162162 __le32 exp_ddgst;
163163 __le32 recv_ddgst;
164−#ifdef CONFIG_NVME_TCP_TLS
165164 struct completion tls_complete;
166165 int tls_err;
167−#endif
168166 struct page_frag_cache pf_cache;
169167
170168 void (*state_change)(struct sock *);
@@ -207,6 +205,14 @@ static inline int nvme_tcp_queue_id(struct nvme_tcp_queue *queue) · 36 unmodified lines
207205 return queue - queue->ctrl->queues;
208206 }
209207
208+static inline bool nvme_tcp_tls(struct nvme_ctrl *ctrl)
209+{
210+ if (!IS_ENABLED(CONFIG_NVME_TCP_TLS))
211+ return 0;
212+
213+ return ctrl->opts->tls;
214+}
215+
210216 static inline struct blk_mq_tags *nvme_tcp_tagset(struct nvme_tcp_queue *queue)
211217 {
212218 u32 queue_idx = nvme_tcp_queue_id(queue);
@@ -1412,7 +1418,7 @@ static int nvme_tcp_init_connection(struct nvme_tcp_queue *queue) · 1199 unmodified lines
14121418 memset(&msg, 0, sizeof(msg));
14131419 iov.iov_base = icresp;
14141420 iov.iov_len = sizeof(*icresp);
1415− if (queue->ctrl->ctrl.opts->tls) {
1421+ if (nvme_tcp_tls(&queue->ctrl->ctrl)) {
14161422 msg.msg_control = cbuf;
14171423 msg.msg_controllen = sizeof(cbuf);
14181424 }
@@ -1424,7 +1430,7 @@ static int nvme_tcp_init_connection(struct nvme_tcp_queue *queue) · 5 unmodified lines
14241430 goto free_icresp;
14251431 }
14261432 ret = -ENOTCONN;
1427− if (queue->ctrl->ctrl.opts->tls) {
1433+ if (nvme_tcp_tls(&queue->ctrl->ctrl)) {
14281434 ctype = tls_get_record_type(queue->sock->sk,
14291435 (struct cmsghdr *)cbuf);
14301436 if (ctype != TLS_RECORD_TYPE_DATA) {
@@ -1548,7 +1554,6 @@ static void nvme_tcp_set_queue_io_cpu(struct nvme_tcp_queue *queue) · 117 unmodified lines
15481554 queue->io_cpu = cpumask_next_wrap(n - 1, cpu_online_mask, -1, false);
15491555 }
15501556
1551−#ifdef CONFIG_NVME_TCP_TLS
15521557 static void nvme_tcp_tls_done(void *data, int status, key_serial_t pskid)
15531558 {
15541559 struct nvme_tcp_queue *queue = data;
@@ -1625,14 +1630,6 @@ static int nvme_tcp_start_tls(struct nvme_ctrl *nctrl, · 70 unmodified lines
16251630 }
16261631 return ret;
16271632 }
1628−#else
1629−static int nvme_tcp_start_tls(struct nvme_ctrl *nctrl,
1630− struct nvme_tcp_queue *queue,
1631− key_serial_t pskid)
1632−{
1633− return -EPROTONOSUPPORT;
1634−}
1635−#endif
16361633
16371634 static int nvme_tcp_alloc_queue(struct nvme_ctrl *nctrl, int qid,
16381635 key_serial_t pskid)
@@ -1759,7 +1756,7 @@ static int nvme_tcp_alloc_queue(struct nvme_ctrl *nctrl, int qid, · 120 unmodified lines
17591756 }
17601757
17611758 /* If PSKs are configured try to start TLS */
1762− if (pskid) {
1759+ if (IS_ENABLED(CONFIG_NVME_TCP_TLS) && pskid) {
17631760 ret = nvme_tcp_start_tls(nctrl, queue, pskid);
17641761 if (ret)
17651762 goto err_init_connect;
@@ -1916,7 +1913,7 @@ static int nvme_tcp_alloc_admin_queue(struct nvme_ctrl *ctrl) · 150 unmodified lines
19161913 int ret;
19171914 key_serial_t pskid = 0;
19181915
1919− if (ctrl->opts->tls) {
1916+ if (nvme_tcp_tls(ctrl)) {
19201917 if (ctrl->opts->tls_key)
19211918 pskid = key_serial(ctrl->opts->tls_key);
19221919 else
@@ -1949,7 +1946,7 @@ static int __nvme_tcp_alloc_io_queues(struct nvme_ctrl *ctrl) · 26 unmodified lines
19491946 {
19501947 int i, ret;
19511948
1952− if (ctrl->opts->tls && !ctrl->tls_key) {
1949+ if (nvme_tcp_tls(ctrl) && !ctrl->tls_key) {
19531950 dev_err(ctrl->device, "no PSK negotiated\n");
19541951 return -ENOKEY;
19551952 }
@@ -2237,6 +2234,7 @@ destroy_io: · 281 unmodified lines
22372234 nvme_tcp_destroy_io_queues(ctrl, new);
22382235 }
22392236 destroy_admin:
2237+ nvme_stop_keep_alive(ctrl);
22402238 nvme_tcp_teardown_admin_queue(ctrl, false);
22412239 return ret;
22422240 }
drivers/nvme/target/Kconfig+2−2
@@ -4,6 +4,8 @@ config NVME_TARGET · 3 unmodified lines
44 tristate "NVMe Target support"
55 depends on BLOCK
66 depends on CONFIGFS_FS
7+ select NVME_KEYRING if NVME_TARGET_TCP_TLS
8+ select KEYS if NVME_TARGET_TCP_TLS
79 select BLK_DEV_INTEGRITY_T10 if BLK_DEV_INTEGRITY
810 select SGL_ALLOC
911 help
@@ -87,9 +89,7 @@ config NVME_TARGET_TCP · 77 unmodified lines
8789 config NVME_TARGET_TCP_TLS
8890 bool "NVMe over Fabrics TCP target TLS encryption support"
8991 depends on NVME_TARGET_TCP
90− select NVME_KEYRING
9192 select NET_HANDSHAKE
92− select KEYS
9393 help
9494 Enables TLS encryption for the NVMe TCP target using the netlink handshake API.
9595
drivers/nvme/target/configfs.c+1−1
@@ -1893,7 +1893,7 @@ static struct config_group *nvmet_ports_make(struct config_group *group, · 1892 unmodified lines
18931893 return ERR_PTR(-ENOMEM);
18941894 }
18951895
1896− if (nvme_keyring_id()) {
1896+ if (IS_ENABLED(CONFIG_NVME_TARGET_TCP_TLS) && nvme_keyring_id()) {
18971897 port->keyring = key_lookup(nvme_keyring_id());
18981898 if (IS_ERR(port->keyring)) {
18991899 pr_warn("NVMe keyring not available, disabling TLS\n");
drivers/nvme/target/fabrics-cmd.c+4−0
@@ -244,6 +244,8 @@ static void nvmet_execute_admin_connect(struct nvmet_req *req) · 243 unmodified lines
244244 goto out;
245245 }
246246
247+ d->subsysnqn[NVMF_NQN_FIELD_LEN - 1] = '\0';
248+ d->hostnqn[NVMF_NQN_FIELD_LEN - 1] = '\0';
247249 status = nvmet_alloc_ctrl(d->subsysnqn, d->hostnqn, req,
248250 le32_to_cpu(c->kato), &ctrl);
249251 if (status)
@@ -313,6 +315,8 @@ static void nvmet_execute_io_connect(struct nvmet_req *req) · 63 unmodified lines
313315 goto out;
314316 }
315317
318+ d->subsysnqn[NVMF_NQN_FIELD_LEN - 1] = '\0';
319+ d->hostnqn[NVMF_NQN_FIELD_LEN - 1] = '\0';
316320 ctrl = nvmet_ctrl_find_get(d->subsysnqn, d->hostnqn,
317321 le16_to_cpu(d->cntlid), req);
318322 if (!ctrl) {
drivers/nvme/target/tcp.c+3−1
@@ -1854,6 +1854,8 @@ static int nvmet_tcp_tls_handshake(struct nvmet_tcp_queue *queue) · 1853 unmodified lines
18541854 }
18551855 return ret;
18561856 }
1857+#else
1858+static void nvmet_tcp_tls_handshake_timeout(struct work_struct *w) {}
18571859 #endif
18581860
18591861 static void nvmet_tcp_alloc_queue(struct nvmet_tcp_port *port,
@@ -1911,9 +1913,9 @@ static void nvmet_tcp_alloc_queue(struct nvmet_tcp_port *port, · 51 unmodified lines
19111913 list_add_tail(&queue->queue_list, &nvmet_tcp_queue_list);
19121914 mutex_unlock(&nvmet_tcp_queue_mutex);
19131915
1914−#ifdef CONFIG_NVME_TARGET_TCP_TLS
19151916 INIT_DELAYED_WORK(&queue->tls_handshake_tmo_work,
19161917 nvmet_tcp_tls_handshake_timeout);
1918+#ifdef CONFIG_NVME_TARGET_TCP_TLS
19171919 if (queue->state == NVMET_TCP_Q_TLS_HANDSHAKE) {
19181920 struct sock *sk = queue->sock->sk;
19191921
drivers/s390/block/dasd.c+13−11
@@ -676,18 +676,20 @@ static void dasd_profile_start(struct dasd_block *block, · 675 unmodified lines
676676 * we count each request only once.
677677 */
678678 device = cqr->startdev;
679− if (device->profile.data) {
680− counter = 1; /* request is not yet queued on the start device */
681− list_for_each(l, &device->ccw_queue)
682− if (++counter >= 31)
683− break;
684− }
679+ if (!device->profile.data)
680+ return;
681+
682+ spin_lock(get_ccwdev_lock(device->cdev));
683+ counter = 1; /* request is not yet queued on the start device */
684+ list_for_each(l, &device->ccw_queue)
685+ if (++counter >= 31)
686+ break;
687+ spin_unlock(get_ccwdev_lock(device->cdev));
688+
685689 spin_lock(&device->profile.lock);
686− if (device->profile.data) {
687− device->profile.data->dasd_io_nr_req[counter]++;
688− if (rq_data_dir(req) == READ)
689− device->profile.data->dasd_read_nr_req[counter]++;
690− }
690+ device->profile.data->dasd_io_nr_req[counter]++;
691+ if (rq_data_dir(req) == READ)
692+ device->profile.data->dasd_read_nr_req[counter]++;
691693 spin_unlock(&device->profile.lock);
692694 }
693695
drivers/s390/block/dasd_int.h+1−1
@@ -283,7 +283,7 @@ struct dasd_pprc_dev_info { · 282 unmodified lines
283283 __u8 secondary; /* 7 Secondary device address */
284284 __u16 pprc_id; /* 8-9 Peer-to-Peer Remote Copy ID */
285285 __u8 reserved2[12]; /* 10-21 reserved */
286− __u16 prim_cu_ssid; /* 22-23 Pimary Control Unit SSID */
286+ __u16 prim_cu_ssid; /* 22-23 Primary Control Unit SSID */
287287 __u8 reserved3[12]; /* 24-35 reserved */
288288 __u16 sec_cu_ssid; /* 36-37 Secondary Control Unit SSID */
289289 __u8 reserved4[90]; /* 38-127 reserved */
include/linux/blk-pm.h+0−1
@@ -15,7 +15,6 @@ extern int blk_pre_runtime_suspend(struct request_queue *q); · 14 unmodified lines
1515 extern void blk_post_runtime_suspend(struct request_queue *q, int err);
1616 extern void blk_pre_runtime_resume(struct request_queue *q);
1717 extern void blk_post_runtime_resume(struct request_queue *q);
18−extern void blk_set_runtime_active(struct request_queue *q);
1918 #else
2019 static inline void blk_pm_runtime_init(struct request_queue *q,
2120 struct device *dev) {}

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t