Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp714373pxv; Thu, 15 Jul 2021 14:13:56 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyAKvp8DZLTDOD9QxC32oukXgD/VH7whDWs9UwfymSno5hFfOWWka7dib/aQKHUsd6Agb+o X-Received: by 2002:a50:9d8d:: with SMTP id w13mr9872946ede.94.1626383636147; Thu, 15 Jul 2021 14:13:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626383636; cv=none; d=google.com; s=arc-20160816; b=m42h7OJppdP3brCfGQ6aZJ3Ag3DJ0Df8LN8yF8NrNwaBo16kVepY1wnTIv4ktmgQfF DQoiupD/JODf6tP6Y3XIl2fyVdz2fpUl47AY9nsnX3jZ9CFa8HHKJIz9tutA/TOiEXUt 92fSn5a3T5POSrSYjkiem2M4FdpoIEWsMaSMo+srbbs9hBVzDIEbj8HZDgr69WMJuZkj 8S+nstEi54ETeBpxyjm132HLsQlBZIGetfi0MwpvhfKsJ3763XfJCPrtWo55URTPG9/t 48ypTfut1JRAsUKKwPWacxayO1gkj1sOgn7jSas3yAGtcctGaDDdjT2+/or3ABMZ9MO7 rhQw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=BGmRoeKnP9PrlkLUiiQRhwCuDHfT0YXEUY07IbS+73o=; b=VE6lrZ3zxawf7gNjrL0TFbSgtVLtAhedLTazZMjlqr7WUlY5novLYMQNu0J7ONfngR 7OCRy3QUWOS4rBNnkKcPxNy3S6VPvqedK8bYdN1xeAFjPCM4fQ5u6Qb/L8DMvea+YIur V9Ne930bB0oip59zPsaqH1ExOPFW2qbTmePNLXJOhUAWvcXITPF72WVlosCqdGDnBuMR Amt2pCkNFVs9NKmh7acTPXqz02yqsp8VmdBYObg+PKX6aRw56Y3rZyCZpk0i6KWqzulE N8nd5yEhUhxYzwcPRtBzUZQg3UD70VMdz5yzDbIe4VXUQAF5DQrkp1erl12TdmWquSoe pMCQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id k5si8924658edx.484.2021.07.15.14.13.33; Thu, 15 Jul 2021 14:13:56 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229992AbhGOVCY (ORCPT + 99 others); Thu, 15 Jul 2021 17:02:24 -0400 Received: from mail-pf1-f182.google.com ([209.85.210.182]:39712 "EHLO mail-pf1-f182.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229459AbhGOVCX (ORCPT ); Thu, 15 Jul 2021 17:02:23 -0400 Received: by mail-pf1-f182.google.com with SMTP id b12so6704730pfv.6; Thu, 15 Jul 2021 13:59:28 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=BGmRoeKnP9PrlkLUiiQRhwCuDHfT0YXEUY07IbS+73o=; b=HFV3NG2S4yZD+LXx2weZ2dzZYAfSlMvVc646ddMXo7GMiNFyShvTVU8iUHyxyHXuUC Y+s5IrQOzBSbkFV6fL79xDh3DraGJ+i2WP1q/fHpdCBvU1NnMWJGiphWKyZQ0EkSiUbJ WKJBFAwsd8cURhNgNqNzLt6L5CmWI8QIbtOF03Uby4SeXakeCHLVmtLDWVA+gh+X00LE 2nL2mHNeforj9p4DXIcb7HuBCXPDfPPMRX/fPv8GHMaqUaJtDXVTNlNgKs6vz26blWMS UkL7uC6WkThRtUCt5PM5uY1qqVdXJHWuRKX3wEIA2t71n9zVc45FMEHWMcpXifZBQ1uE CFnQ== X-Gm-Message-State: AOAM532cCfFzSpmjjW7lhuuRbsM4Qu7kJeOmpQJR5i6ZBvPGKApKA3HG GqnXBedai9YXquG97E0rJyU= X-Received: by 2002:a65:62da:: with SMTP id m26mr6385654pgv.370.1626382768107; Thu, 15 Jul 2021 13:59:28 -0700 (PDT) Received: from localhost ([191.96.120.37]) by smtp.gmail.com with ESMTPSA id 20sm7726467pfi.170.2021.07.15.13.59.26 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 15 Jul 2021 13:59:26 -0700 (PDT) From: Luis Chamberlain To: axboe@kernel.dk Cc: hare@suse.de, bvanassche@acm.org, ming.lei@redhat.com, hch@infradead.org, jack@suse.cz, osandov@fb.com, linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, Luis Chamberlain Subject: [RFC 00/12] block: *add_disk*() driver conversions __register_blkdev() Date: Thu, 15 Jul 2021 13:59:08 -0700 Message-Id: <20210715205920.2023980-1-mcgrof@kernel.org> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This is the 4th group of driver conversion examples. This set is complete, as there are only a few drivers which use __register_blkdev(). The __register_blkdev() call uses an optional probe call, and if set will be used when blk_request_module() is called for the block device. Since these probe calls can fail, now that we added *add_disk*() error handling, take advatage of this and extend the probe call to capture the errors. There are only a few drivers which benefit from this. The meat of the work is the last patch, which includes all driver conversions. The rest of the patches are adding add_disk() error handling in the other places of the drivers. Luis Chamberlain (12): floppy: fix add_disk() assumption on exit floppy: use blk_cleanup_disk() floppy: add error handling support for add_disk() scsi/sd: use blk_cleanup_queue() insted of put_disk() scsi/sd: add error handling support for add_disk() scsi/sr: use blk_cleanup_disk() instead of put_disk() scsi/sr: add error handling support for add_disk() block/ataflop: use the blk_cleanup_disk() helper block/ataflop: add a helper for removing disks block/ataflop add error handling support for add_disk() block/brd: add error handling support for add_disk() block: make probe in blk_request_module() return an error block/genhd.c | 15 ++++++---- drivers/block/ataflop.c | 66 ++++++++++++++++++++++++----------------- drivers/block/brd.c | 17 ++++++++--- drivers/block/floppy.c | 48 ++++++++++++++---------------- drivers/block/loop.c | 6 ++-- drivers/scsi/sd.c | 11 +++++-- drivers/scsi/sr.c | 7 +++-- fs/block_dev.c | 5 +++- include/linux/genhd.h | 4 +-- 9 files changed, 105 insertions(+), 74 deletions(-) -- 2.27.0