From: Yu Kuai <yukuai1@huaweicloud.com> To: Greg KH <gregkh@linuxfoundation.org>, Christoph Hellwig <hch@lst.de> Cc: Yu Kuai <yukuai1@huaweicloud.com>, stable@vger.kernel.org, axboe@kernel.dk, snitzer@redhat.com, dm-devel@redhat.com, linux-block@vger.kernel.org, yi.zhang@huawei.com, "yukuai (C)" <yukuai3@huawei.com> Subject: Re: [PATCH stable 5.10 1/3] block: look up holders by bdev Date: Mon, 8 Aug 2022 11:31:32 +0800 [thread overview] Message-ID: <b06f4667-d70e-54ee-6c6f-b68865ca61a4@huaweicloud.com> (raw) In-Reply-To: <Yuix/CcmdKsSD+za@kroah.com> Hi, Christoph 在 2022/08/02 13:11, Greg KH 写道: > On Mon, Aug 01, 2022 at 08:04:58PM +0200, Christoph Hellwig wrote: >> On Mon, Aug 01, 2022 at 01:19:09PM +0200, Greg KH wrote: >>> This is very different from the upstream version, and forces the change >>> onto everyone, not just those who had CONFIG_BLOCK_HOLDER_DEPRECATED >>> enabled like was done in the main kernel tree. >>> >>> Why force this on all and not just use the same option? >> >> I'm really worried about backports that are significantly different >> from the original commit. To the point where if they are so different >> and we don't have a grave security or data integrity bug I'm really not >> very much in favor of backporting them at all. >> I do understand that backporting these patches is not good, thanks for taking time on this patchset. I decided to push following patch in our version: diff --git a/drivers/md/dm.c b/drivers/md/dm.c index 588e8b43efab..c047d5fcb325 100644 --- a/drivers/md/dm.c +++ b/drivers/md/dm.c @@ -2149,12 +2149,16 @@ int dm_setup_md_queue(struct mapped_device *md, struct dm_table *t) switch (type) { case DM_TYPE_REQUEST_BASED: - md->disk->fops = &dm_rq_blk_dops; r = dm_mq_init_request_queue(md, t); if (r) { DMERR("Cannot initialize queue for request-based dm mapped device"); return r; } + /* + * Change the fops after queue is initialized, so that bio won't + * issued by rq-based path until that. + */ + md->disk->fops = &dm_rq_blk_dops; break; case DM_TYPE_BIO_BASED: case DM_TYPE_DAX_BIO_BASED: This way only modify dm, and the problem can be fixed. If you guys think this is OK, I can send a patch for LTS. Otherwise, if you guys still think the null-ptr-def problem is uncommon and doesn't worth to fix, please ignore this mail. Thanks, Kuai > > I agree, I'll drop this from my review queue now, thanks. > > greg k-h > . >
WARNING: multiple messages have this Message-ID (diff)
From: Yu Kuai <yukuai1@huaweicloud.com> To: Greg KH <gregkh@linuxfoundation.org>, Christoph Hellwig <hch@lst.de> Cc: axboe@kernel.dk, snitzer@redhat.com, yi.zhang@huawei.com, stable@vger.kernel.org, linux-block@vger.kernel.org, Yu Kuai <yukuai1@huaweicloud.com>, dm-devel@redhat.com, "yukuai \(C\)" <yukuai3@huawei.com> Subject: Re: [dm-devel] [PATCH stable 5.10 1/3] block: look up holders by bdev Date: Mon, 8 Aug 2022 11:31:32 +0800 [thread overview] Message-ID: <b06f4667-d70e-54ee-6c6f-b68865ca61a4@huaweicloud.com> (raw) In-Reply-To: <Yuix/CcmdKsSD+za@kroah.com> Hi, Christoph 在 2022/08/02 13:11, Greg KH 写道: > On Mon, Aug 01, 2022 at 08:04:58PM +0200, Christoph Hellwig wrote: >> On Mon, Aug 01, 2022 at 01:19:09PM +0200, Greg KH wrote: >>> This is very different from the upstream version, and forces the change >>> onto everyone, not just those who had CONFIG_BLOCK_HOLDER_DEPRECATED >>> enabled like was done in the main kernel tree. >>> >>> Why force this on all and not just use the same option? >> >> I'm really worried about backports that are significantly different >> from the original commit. To the point where if they are so different >> and we don't have a grave security or data integrity bug I'm really not >> very much in favor of backporting them at all. >> I do understand that backporting these patches is not good, thanks for taking time on this patchset. I decided to push following patch in our version: diff --git a/drivers/md/dm.c b/drivers/md/dm.c index 588e8b43efab..c047d5fcb325 100644 --- a/drivers/md/dm.c +++ b/drivers/md/dm.c @@ -2149,12 +2149,16 @@ int dm_setup_md_queue(struct mapped_device *md, struct dm_table *t) switch (type) { case DM_TYPE_REQUEST_BASED: - md->disk->fops = &dm_rq_blk_dops; r = dm_mq_init_request_queue(md, t); if (r) { DMERR("Cannot initialize queue for request-based dm mapped device"); return r; } + /* + * Change the fops after queue is initialized, so that bio won't + * issued by rq-based path until that. + */ + md->disk->fops = &dm_rq_blk_dops; break; case DM_TYPE_BIO_BASED: case DM_TYPE_DAX_BIO_BASED: This way only modify dm, and the problem can be fixed. If you guys think this is OK, I can send a patch for LTS. Otherwise, if you guys still think the null-ptr-def problem is uncommon and doesn't worth to fix, please ignore this mail. Thanks, Kuai > > I agree, I'll drop this from my review queue now, thanks. > > greg k-h > . > -- dm-devel mailing list dm-devel@redhat.com https://listman.redhat.com/mailman/listinfo/dm-devel
next prev parent reply other threads:[~2022-08-08 3:32 UTC|newest] Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top 2022-07-29 6:23 [PATCH stable 5.10 0/3] dm: fix nullptr crash Yu Kuai 2022-07-29 6:23 ` [dm-devel] " Yu Kuai 2022-07-29 6:23 ` [PATCH stable 5.10 1/3] block: look up holders by bdev Yu Kuai 2022-07-29 6:23 ` [dm-devel] " Yu Kuai 2022-08-01 11:19 ` Greg KH 2022-08-01 11:19 ` [dm-devel] " Greg KH 2022-08-01 12:25 ` Yu Kuai 2022-08-01 12:25 ` Yu Kuai 2022-08-01 13:17 ` Greg KH 2022-08-01 13:17 ` [dm-devel] " Greg KH 2022-08-01 13:39 ` Yu Kuai 2022-08-01 13:39 ` [dm-devel] " Yu Kuai 2022-08-01 13:43 ` Greg KH 2022-08-01 13:43 ` [dm-devel] " Greg KH 2022-08-01 18:04 ` Christoph Hellwig 2022-08-01 18:04 ` [dm-devel] " Christoph Hellwig 2022-08-02 5:11 ` Greg KH 2022-08-02 5:11 ` [dm-devel] " Greg KH 2022-08-08 3:31 ` Yu Kuai [this message] 2022-08-08 3:31 ` Yu Kuai 2022-07-29 6:23 ` [PATCH stable 5.10 2/3] block: support delayed holder registration Yu Kuai 2022-07-29 6:23 ` [dm-devel] " Yu Kuai 2022-07-29 6:23 ` [PATCH stable 5.10 3/3] dm: delay registering the gendisk Yu Kuai 2022-07-29 6:23 ` [dm-devel] " Yu Kuai
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=b06f4667-d70e-54ee-6c6f-b68865ca61a4@huaweicloud.com \ --to=yukuai1@huaweicloud.com \ --cc=axboe@kernel.dk \ --cc=dm-devel@redhat.com \ --cc=gregkh@linuxfoundation.org \ --cc=hch@lst.de \ --cc=linux-block@vger.kernel.org \ --cc=snitzer@redhat.com \ --cc=stable@vger.kernel.org \ --cc=yi.zhang@huawei.com \ --cc=yukuai3@huawei.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: linkBe 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.