Received: by 2002:a05:6a10:eb17:0:0:0:0 with SMTP id hx23csp2565945pxb; Sun, 5 Sep 2021 23:33:57 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz99inqFtkc9BZ05/Ns5oJasQaH+f+clLhVxtCVzClgMZb7Pvrt35UwVvW3vSniRkFxvzte X-Received: by 2002:a05:6e02:964:: with SMTP id q4mr7573136ilt.229.1630910037656; Sun, 05 Sep 2021 23:33:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1630910037; cv=none; d=google.com; s=arc-20160816; b=YgAsCOFpzrP5ilD8YoIYLQA/FqsKV4I8fadW7qbtW3coZ2RqLNp3ws4fwFmjhDKL94 DRLCqFC9ZYjAYQ54JMVuRv2FIUtcki/+gSBnuzkn46rUM2HImCb6yZ3swe7xW/TO5Jre /y/d6XIiDtBnJAJ9wgneVt1Y9dvi4BxvT2gHclM4AksrLYMs0o3u2lDU6fYuOBa/tH3E iMF3AbLZ2RgvlLJFYd9vOOOMrkDyVu1GmBr7zICp3o1RxQQBnSQxm5Iby0Xj+dsoGmqH nmtOvb1r7Z0pP2pjBWf64mRHY2CJtO635SeT9j/pcYvl9d5QLAwdh7tPk6ydOCbBXNRP ecPQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:dkim-signature:dkim-signature; bh=P4Gr5gu+/Hse23+X+v7ckIdKYFVr0+SFB6GIXh/7mKA=; b=o6TUBEEiVvMDjiMDzSVj6zMQpooIe/51RWYAz7DLHCozTdxtQPJJJ6fVQaxtTns6z+ iMSAioA+Izeek6yqzOD1kIrqHBwrUUrAk5nyQ3B+t/E1DAxDJhMx0Hq6a1td3yZB6IUA QgQVpKZ0g6hv4QYUMJIOHAg6i63OXaED7CNwXwY3T12Wh+g0yfJ5rdQuhsqnqDgSg85x xeDUUVQI+b5yfL15qKFGRPvstnQcvlMB73QOM3KpG2DHkYrr7gn+TOPg2gRtqdLIsYk/ hZxRqHmz8Co2Gv3CqPlrUf6o0roBTOH5iXofTkonXxRjRuZZq4XxsnSLl1A70BGHW0S3 DFWA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=1AQ4JXfp; dkim=neutral (no key) header.i=@suse.de; 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=suse.de Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id i1si7764138iow.3.2021.09.05.23.33.46; Sun, 05 Sep 2021 23:33:57 -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; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=1AQ4JXfp; dkim=neutral (no key) header.i=@suse.de; 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=suse.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239431AbhIFGUG (ORCPT + 99 others); Mon, 6 Sep 2021 02:20:06 -0400 Received: from smtp-out2.suse.de ([195.135.220.29]:52442 "EHLO smtp-out2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229792AbhIFGUF (ORCPT ); Mon, 6 Sep 2021 02:20:05 -0400 Received: from imap1.suse-dmz.suse.de (imap1.suse-dmz.suse.de [192.168.254.73]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 4976A20082; Mon, 6 Sep 2021 06:19:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1630909140; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=P4Gr5gu+/Hse23+X+v7ckIdKYFVr0+SFB6GIXh/7mKA=; b=1AQ4JXfpJTOydyUnkkWeEWJ1L0c1SKUxn74xKexN3zLxC76NDAbcdoViZvXVAE3LnrZlE3 GEIgr8FCCBi7iV+Xk7muCIFVaq0uOJHcJysEKY0S4xdZX9flCLOT+H7xwBN5bKL00xrZF4 53AXpKPe4VpfEKwAEHwFvLbnP3QgQIA= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1630909140; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=P4Gr5gu+/Hse23+X+v7ckIdKYFVr0+SFB6GIXh/7mKA=; b=OsfXzNCeSbKV+bfZcJsxsoRyih/kOMopVWOIq4Pvdob1ZD7+RFgFvkYZ9rh05kyr2wiRVU whZEdVtyvoqcAjDQ== Received: from imap1.suse-dmz.suse.de (imap1.suse-dmz.suse.de [192.168.254.73]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap1.suse-dmz.suse.de (Postfix) with ESMTPS id C5FF213299; Mon, 6 Sep 2021 06:18:58 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap1.suse-dmz.suse.de with ESMTPSA id lmSWLtKyNWGeTwAAGKfGzw (envelope-from ); Mon, 06 Sep 2021 06:18:58 +0000 Subject: Re: [PATCH v3 6/8] dm: add add_disk() error handling To: Luis Chamberlain , axboe@kernel.dk, martin.petersen@oracle.com, jejb@linux.ibm.com, kbusch@kernel.org, sagi@grimberg.me, adrian.hunter@intel.com, beanhuo@micron.com, ulf.hansson@linaro.org, avri.altman@wdc.com, swboyd@chromium.org, agk@redhat.com, snitzer@redhat.com, josef@toxicpanda.com Cc: hch@infradead.org, bvanassche@acm.org, ming.lei@redhat.com, linux-scsi@vger.kernel.org, linux-nvme@lists.infradead.org, linux-mmc@vger.kernel.org, dm-devel@redhat.com, nbd@other.debian.org, linux-block@vger.kernel.org, linux-kernel@vger.kernel.org References: <20210830212538.148729-1-mcgrof@kernel.org> <20210830212538.148729-7-mcgrof@kernel.org> From: Hannes Reinecke Message-ID: <067651b9-f530-2613-a419-6b8c3b11ef88@suse.de> Date: Mon, 6 Sep 2021 08:19:02 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.12.0 MIME-Version: 1.0 In-Reply-To: <20210830212538.148729-7-mcgrof@kernel.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 8/30/21 11:25 PM, Luis Chamberlain wrote: > We never checked for errors on add_disk() as this function > returned void. Now that this is fixed, use the shiny new > error handling. > > There are two calls to dm_setup_md_queue() which can fail then, > one on dm_early_create() and we can easily see that the error path > there calls dm_destroy in the error path. The other use case is on > the ioctl table_load case. If that fails userspace needs to call > the DM_DEV_REMOVE_CMD to cleanup the state - similar to any other > failure. > > Signed-off-by: Luis Chamberlain > --- > drivers/md/dm.c | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) > Reviewed-by: Hannes Reinecke Cheers, Hannes -- Dr. Hannes Reinecke Kernel Storage Architect hare@suse.de +49 911 74053 688 SUSE Software Solutions GmbH, Maxfeldstr. 5, 90409 Nürnberg HRB 36809 (AG Nürnberg), Geschäftsführer: Felix Imendörffer