stable.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sasha Levin <sashal@kernel.org>
To: linux-kernel@vger.kernel.org, stable@vger.kernel.org
Cc: Guoqing Jiang <guoqing.jiang@linux.dev>,
	Christoph Hellwig <hch@lst.de>,
	Chaitanya Kulkarni <kch@nvidia.com>, Jens Axboe <axboe@kernel.dk>,
	Sasha Levin <sashal@kernel.org>,
	haris.iqbal@ionos.com, jinpu.wang@ionos.com,
	linux-block@vger.kernel.org
Subject: [PATCH AUTOSEL 6.3 18/18] block/rnbd: replace REQ_OP_FLUSH with REQ_OP_WRITE
Date: Sat, 20 May 2023 14:17:50 -0400	[thread overview]
Message-ID: <20230520181750.823365-18-sashal@kernel.org> (raw)
In-Reply-To: <20230520181750.823365-1-sashal@kernel.org>

From: Guoqing Jiang <guoqing.jiang@linux.dev>

[ Upstream commit 5e6e08087a4acb4ee3574cea32dbff0f63c7f608 ]

Since flush bios are implemented as writes with no data and
the preflush flag per Christoph's comment [1].

And we need to change it in rnbd accordingly. Otherwise, I
got splatting when create fs from rnbd client.

[  464.028545] ------------[ cut here ]------------
[  464.028553] WARNING: CPU: 0 PID: 65 at block/blk-core.c:751 submit_bio_noacct+0x32c/0x5d0
[ ... ]
[  464.028668] CPU: 0 PID: 65 Comm: kworker/0:1H Tainted: G           OE      6.4.0-rc1 #9
[  464.028671] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS rel-1.15.0-0-g2dd4b9b-rebuilt.opensuse.org 04/01/2014
[  464.028673] Workqueue: ib-comp-wq ib_cq_poll_work [ib_core]
[  464.028717] RIP: 0010:submit_bio_noacct+0x32c/0x5d0
[  464.028720] Code: 03 0f 85 51 fe ff ff 48 8b 43 18 8b 88 04 03 00 00 85 c9 0f 85 3f fe ff ff e9 be fd ff ff 0f b6 d0 3c 0d 74 26 83 fa 01 74 21 <0f> 0b b8 0a 00 00 00 e9 56 fd ff ff 4c 89 e7 e8 70 a1 03 00 84 c0
[  464.028722] RSP: 0018:ffffaf3680b57c68 EFLAGS: 00010202
[  464.028724] RAX: 0000000000060802 RBX: ffffa09dcc18bf00 RCX: 0000000000000000
[  464.028726] RDX: 0000000000000002 RSI: 0000000000000000 RDI: ffffa09dde081d00
[  464.028727] RBP: ffffaf3680b57c98 R08: ffffa09dde081d00 R09: ffffa09e38327200
[  464.028729] R10: 0000000000000000 R11: 0000000000000000 R12: ffffa09dde081d00
[  464.028730] R13: ffffa09dcb06e1e8 R14: 0000000000000000 R15: 0000000000200000
[  464.028733] FS:  0000000000000000(0000) GS:ffffa09e3bc00000(0000) knlGS:0000000000000000
[  464.028735] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[  464.028736] CR2: 000055a4e8206c40 CR3: 0000000119f06000 CR4: 00000000003506f0
[  464.028738] Call Trace:
[  464.028740]  <TASK>
[  464.028746]  submit_bio+0x1b/0x80
[  464.028748]  rnbd_srv_rdma_ev+0x50d/0x10c0 [rnbd_server]
[  464.028754]  ? percpu_ref_get_many.constprop.0+0x55/0x140 [rtrs_server]
[  464.028760]  ? __this_cpu_preempt_check+0x13/0x20
[  464.028769]  process_io_req+0x1dc/0x450 [rtrs_server]
[  464.028775]  rtrs_srv_inv_rkey_done+0x67/0xb0 [rtrs_server]
[  464.028780]  __ib_process_cq+0xbc/0x1f0 [ib_core]
[  464.028793]  ib_cq_poll_work+0x2b/0xa0 [ib_core]
[  464.028804]  process_one_work+0x2a9/0x580

[1]. https://lore.kernel.org/all/ZFHgefWofVt24tRl@infradead.org/

Signed-off-by: Guoqing Jiang <guoqing.jiang@linux.dev>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Chaitanya Kulkarni <kch@nvidia.com>
Link: https://lore.kernel.org/r/20230512034631.28686-1-guoqing.jiang@linux.dev
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/block/rnbd/rnbd-proto.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/block/rnbd/rnbd-proto.h b/drivers/block/rnbd/rnbd-proto.h
index ea7ac8bca63cf..da1d0542d7e2c 100644
--- a/drivers/block/rnbd/rnbd-proto.h
+++ b/drivers/block/rnbd/rnbd-proto.h
@@ -241,7 +241,7 @@ static inline blk_opf_t rnbd_to_bio_flags(u32 rnbd_opf)
 		bio_opf = REQ_OP_WRITE;
 		break;
 	case RNBD_OP_FLUSH:
-		bio_opf = REQ_OP_FLUSH | REQ_PREFLUSH;
+		bio_opf = REQ_OP_WRITE | REQ_PREFLUSH;
 		break;
 	case RNBD_OP_DISCARD:
 		bio_opf = REQ_OP_DISCARD;
-- 
2.39.2


      parent reply	other threads:[~2023-05-20 18:21 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-20 18:17 [PATCH AUTOSEL 6.3 01/18] drm/ast: Fix ARM compatibility Sasha Levin
2023-05-20 18:17 ` [PATCH AUTOSEL 6.3 02/18] btrfs: abort transaction when sibling keys check fails for leaves Sasha Levin
2023-05-20 18:17 ` [PATCH AUTOSEL 6.3 03/18] ARM: 9295/1: unwind:fix unwind abort for uleb128 case Sasha Levin
2023-05-20 18:17 ` [PATCH AUTOSEL 6.3 04/18] perf/x86/intel/ds: Flush PEBS DS when changing PEBS_DATA_CFG Sasha Levin
2023-05-20 18:17 ` [PATCH AUTOSEL 6.3 05/18] hwmon: (k10temp) Add PCI ID for family 19, model 78h Sasha Levin
2023-05-20 18:17 ` [PATCH AUTOSEL 6.3 06/18] media: rcar-vin: Gen3 can not scale NV12 Sasha Levin
2023-05-20 18:17 ` [PATCH AUTOSEL 6.3 07/18] media: rcar-vin: Fix NV12 size alignment Sasha Levin
2023-05-20 18:17 ` [PATCH AUTOSEL 6.3 08/18] media: rcar-vin: Select correct interrupt mode for V4L2_FIELD_ALTERNATE Sasha Levin
2023-05-20 18:17 ` [PATCH AUTOSEL 6.3 09/18] platform/x86: intel_scu_pcidrv: Add back PCI ID for Medfield Sasha Levin
2023-05-20 18:17 ` [PATCH AUTOSEL 6.3 10/18] platform/mellanox: fix potential race in mlxbf-tmfifo driver Sasha Levin
2023-05-20 18:17 ` [PATCH AUTOSEL 6.3 11/18] gfs2: Don't deref jdesc in evict Sasha Levin
2023-05-20 18:17 ` [PATCH AUTOSEL 6.3 12/18] drm/amdgpu/nv: update VCN 3 max HEVC encoding resolution Sasha Levin
2023-05-20 18:17 ` [PATCH AUTOSEL 6.3 13/18] drm/amdgpu: set gfx9 onwards APU atomics support to be true Sasha Levin
2023-05-20 18:17 ` [PATCH AUTOSEL 6.3 14/18] fbdev: imsttfb: Fix use after free bug in imsttfb_probe Sasha Levin
2023-05-20 18:17 ` [PATCH AUTOSEL 6.3 15/18] fbdev: modedb: Add 1920x1080 at 60 Hz video mode Sasha Levin
2023-05-20 18:17 ` [PATCH AUTOSEL 6.3 16/18] fbdev: stifb: Fix info entry in sti_struct on error path Sasha Levin
2023-05-20 18:17 ` [PATCH AUTOSEL 6.3 17/18] nbd: Fix debugfs_create_dir error checking Sasha Levin
2023-05-20 18:17 ` Sasha Levin [this message]

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=20230520181750.823365-18-sashal@kernel.org \
    --to=sashal@kernel.org \
    --cc=axboe@kernel.dk \
    --cc=guoqing.jiang@linux.dev \
    --cc=haris.iqbal@ionos.com \
    --cc=hch@lst.de \
    --cc=jinpu.wang@ionos.com \
    --cc=kch@nvidia.com \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --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;
as well as URLs for NNTP newsgroup(s).