From patchwork Tue Nov 15 14:10:44 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yu Kuai X-Patchwork-Id: 13043735 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0EB1FC4332F for ; Tue, 15 Nov 2022 13:49:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238222AbiKONth (ORCPT ); Tue, 15 Nov 2022 08:49:37 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49676 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230207AbiKONtg (ORCPT ); Tue, 15 Nov 2022 08:49:36 -0500 Received: from dggsgout12.his.huawei.com (unknown [45.249.212.56]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 34F442497F; Tue, 15 Nov 2022 05:49:33 -0800 (PST) Received: from mail02.huawei.com (unknown [172.30.67.153]) by dggsgout12.his.huawei.com (SkyGuard) with ESMTP id 4NBSGG0jBXz4f41hZ; Tue, 15 Nov 2022 21:49:26 +0800 (CST) Received: from huaweicloud.com (unknown [10.175.127.227]) by APP4 (Coremail) with SMTP id gCh0CgBni9jnmHNjrPFIAg--.61645S4; Tue, 15 Nov 2022 21:49:29 +0800 (CST) From: Yu Kuai To: hch@lst.de, axboe@kernel.dk, agk@redhat.com, snitzer@kernel.org, dm-devel@redhat.com Cc: linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, yukuai3@huawei.com, yukuai1@huaweicloud.com, yi.zhang@huawei.com Subject: [PATCH v3 00/10] fix delayed holder tracking Date: Tue, 15 Nov 2022 22:10:44 +0800 Message-Id: <20221115141054.1051801-1-yukuai1@huaweicloud.com> X-Mailer: git-send-email 2.31.1 MIME-Version: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gr1UYxBIdaVFxhVjvjDU0xZFpf9x0J UdHUDUUUUU= X-CM-SenderInfo: 51xn3trlr6x35dzhxuhorxvhhfrp/ X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org From: Yu Kuai Hi all, this series tries to fix the delayed holder tracking that is only used by dm by moving it into dm, where we can track the lifetimes much better. v2 is from Christoph, here I send v3 with some additional fixes. Changes since v2: - add patch 5 8 and 10 to this series. - rewrite last cleanup patch from v2. Changes since v1: - don't blow away ->bd_holder_dir in del_gendisk or add_disk failure as the holder unregistration references it - add an extra cleanup patch Christoph Hellwig (6): block: clear ->slave_dir when dropping the main slave_dir reference dm: remove free_table_devices dm: cleanup open_table_device dm: cleanup close_table_device dm: track per-add_disk holder relations in DM block: remove delayed holder registration Yu Kuai (4): dm: make sure create and remove dm device won't race with open and close table block: fix use after free for bd_holder_dir block: store the holder kobject in bd_holder_disk block: don't allow a disk link holder to itself block/genhd.c | 6 +- block/holder.c | 103 +++++++++++++----------------- drivers/md/dm.c | 138 ++++++++++++++++++++++++----------------- include/linux/blkdev.h | 5 -- 4 files changed, 126 insertions(+), 126 deletions(-)