Received: by 2002:a05:7412:ba23:b0:fa:4c10:6cad with SMTP id jp35csp27032rdb; Wed, 17 Jan 2024 16:00:13 -0800 (PST) X-Google-Smtp-Source: AGHT+IFpDPtpl4NECyP7U5ww6GhjinU/G1C8TE1SLF7cRRpOh6zfoeDfTFpIBbqbxUkgixGVszZY X-Received: by 2002:a05:6214:411c:b0:67f:179c:e1a2 with SMTP id kc28-20020a056214411c00b0067f179ce1a2mr13106887qvb.22.1705536013061; Wed, 17 Jan 2024 16:00:13 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1705536013; cv=pass; d=google.com; s=arc-20160816; b=jzElVytkE9qmm8Bqt/SoSrrcLi7NDE9madCGz3Ve3PBytJT/InR7P7jQub59SsIpiR pCk3lqO+UhBGaJz35oGVEfHq+J+ldlTF+1IU4GaPwrlGbe8orXgRlQRdIT3e3M/7nO4C EXLfpom8Xt0cUZHIozfS07B1jvhtKDkmtZTDJDYRalXlx/DufuMzgXqQqN+JQ7Qcv48+ 0ktCFU7TxeNKvEQJrZBXBFKBcXseqOLbq5g7N6cDyonEjZKM/eQTzMXusBz2w89oy8P1 GceApiJ5kkzPrNTInuLmlWST09P/MIvU1mpkl2pIepmpZyj0tJeH1FIbZ6kjGoLbV0FL Z7mg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=8KbCl+cL1HIU08ekeQETRW2iziUj3AHaE3YLzLQgqic=; fh=yIz5+dQTMzzAvFfHz3X4Gmiiu3hCS8gmi12jt/FmLGM=; b=c5+CgeosPEH7JlJzwAVXDyIzowynpD3HgE9qTUOHrth8FFlljQ+NjtmpsdKReVN3Ap 92rEj39n2+9uln3TRZaBUoq9LgUlIR5BF+r2B6YpATBqFsF6C7OWzrW6kyMd0OLpeiuY ZblfrcIXI53jQkFrea8uzNYFsbnG4t12q+13WWuhekkyOaCE/neBPuY+92f25shiCULx f9hgaloCZmT7RmGi2j02rG/0pcpM+htBzx9f7y83P4K/0jrGTQzTAsGMQ2rnmMm6mIZZ nGV9ttPUKIoE+Nl1UoiNGtOlowjBiaHxNgKOgkGP2msDIQ9qkyY54OMDccEI8q05DAPK OWNg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b=DJ79lgBv; arc=pass (i=1 dkim=pass dkdomain=infradead.org); spf=pass (google.com: domain of linux-kernel+bounces-29321-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-29321-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id r16-20020a0ccc10000000b0068171e9ed95si3580419qvk.536.2024.01.17.16.00.12 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 17 Jan 2024 16:00:13 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-29321-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b=DJ79lgBv; arc=pass (i=1 dkim=pass dkdomain=infradead.org); spf=pass (google.com: domain of linux-kernel+bounces-29321-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-29321-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 1252C1C2113C for ; Wed, 17 Jan 2024 18:35:04 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id B1C6923750; Wed, 17 Jan 2024 18:34:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="DJ79lgBv" Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7AE6C22EE3; Wed, 17 Jan 2024 18:34:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.137.202.133 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705516493; cv=none; b=OPE0iitIk069So3VMrQBudTyVtMr6/SvdHG9Ex9fambx6iN0c5d6cSuu7d70q8DFToAPbXhxFal0ErZzrGRPJLv1q4mA0V3QjJctsRM9c75SsNzHZEpZ/iwyIghocSAf57lo9zdzP5t11xes+tOPKc216DJkBiGf08lR/UKnIiY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705516493; c=relaxed/simple; bh=w3ye9Lfs6lrVI9jf34MaHaq4xU4WMPmUMPs/Ih6w3xc=; h=DKIM-Signature:Received:Date:From:To:Cc:Subject:Message-ID: References:MIME-Version:Content-Type:Content-Disposition: In-Reply-To:X-SRS-Rewrite; b=HoxtXtUftPD9cG/+V5kDHlCsSrTlJdfQMWPUdny06k83XgndinTXZwh9Zg/FWRhWcVW8QLPGM3H1KFasmDW1m7rRf6A/umViCO7tCuz0PZwLmzSC+zLPo5qqYmHUYT7Aj47nvPXNdiYvOXxI6yKR/qd0AOA0QVk0scYzXI2EMLc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org; spf=none smtp.mailfrom=bombadil.srs.infradead.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b=DJ79lgBv; arc=none smtp.client-ip=198.137.202.133 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=bombadil.srs.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=8KbCl+cL1HIU08ekeQETRW2iziUj3AHaE3YLzLQgqic=; b=DJ79lgBv5cumSm/F1s2Z3E82Ho Bl5IkMYk0+bzxewYn5KQAgmsZPzzPoGtFrKfWudCfngrpPrqjoZYfvkeoZaLdis0r6mdO/mQoqEeN JwmapxkwdaFT4tIo//q9v2ftvMRASdsFhvrpclJkVMMtRlKO/ugDaJvzJ1LatK+vzBiWHOVDPUq8t VKgkRa46n1QHVIS6fQHflO3YBqtMvACCTPX7oVQgJffjKMIvPIpsE7QYEyP35f3kPgf2NmQk491hu uP4hEWPRVHchr7OopCJWIcYNmW6C90ta/vv4N1IQ9DHitklALTeKA+HeAQDHTo7Fq2G7hhD1kKzz0 1bcM5Ulg==; Received: from hch by bombadil.infradead.org with local (Exim 4.96 #2 (Red Hat Linux)) id 1rQAkP-000Ngy-2k; Wed, 17 Jan 2024 18:34:45 +0000 Date: Wed, 17 Jan 2024 10:34:45 -0800 From: Christoph Hellwig To: Yu Kuai Cc: Christoph Hellwig , Allison Karlitskaya , linux-kernel@vger.kernel.org, linux-block@vger.kernel.org, Jens Axboe , "yukuai (C)" Subject: Re: PROBLEM: BLKPG_DEL_PARTITION with GENHD_FL_NO_PART used to return ENXIO, now returns EINVAL Message-ID: References: <210deda9-5439-244a-0ce2-af9dc8e5d7fe@huaweicloud.com> <592625f7-36d7-02e0-2ee6-8211334aa0f9@huaweicloud.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <592625f7-36d7-02e0-2ee6-8211334aa0f9@huaweicloud.com> X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html On Tue, Jan 16, 2024 at 09:46:21PM +0800, Yu Kuai wrote: > Please ignore the patch from last email. Sorry for the noise... > bdev_resize_partition() will also return -ENXIO if partition does't > exist. So the right patch should be following: Yes, this looks good. I've also verified that historically adding a partition always returned -EINVAL when beyond the maximum number of partitions (which would have been 0 in this case).