Received: by 2002:a05:7412:8d09:b0:fa:4c10:6cad with SMTP id bj9csp364184rdb; Tue, 16 Jan 2024 02:47:28 -0800 (PST) X-Google-Smtp-Source: AGHT+IGvR/FUAaD3N4m4+hBcdNRxXEyD50lrRke0hpCxli/4YEYjmLe5GaDqfTGfjLX5NOJguqZL X-Received: by 2002:a05:6871:29b:b0:203:ecee:90a0 with SMTP id i27-20020a056871029b00b00203ecee90a0mr9997772oae.16.1705402047990; Tue, 16 Jan 2024 02:47:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1705402047; cv=none; d=google.com; s=arc-20160816; b=wBcgfVv2bxiGcgjMNeH/AO91kVblVThiXOE0vY+SjIXFeMLSEtEFbiw0cyS/ycahMr QUBYdeldiEAiVXMLGkOjCIMl+lj5mPbaouweBN6wZ1cnxCmAA7jHGf/NFfXhZAlgQutc jUzKsT9RK++RThiFGLIxdNdY8cyDR5Vc4P0+OylBVaK0IpV5x6V/ONS4PIUC8+SvcW0C TBpd5Ubj9SYSpqJ473z03zLugEOhnPpkU1ugc2nSMPFMcYmM4YQaGyQwnDSE9e5oOtfI s9VviQgU2MW89AruHGNVv6YcWczbEB3ikMkI45fy5fuOjXbx9z20C7jc4MfnS8hae0kv MUXg== ARC-Message-Signature: i=1; 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=219PFu8SLZjkc7zCE0Stfq7JLlZFWgwGmWkDPkxlVv4=; fh=9A4GhE0Hw9CBehxBgis8Fe/jWC4DAkw1W4c29GQPPyc=; b=O0/gwxtqYuo4jp9UE+ujwqJEw1jp9FcIlzn9M0uZk5TD4QKEgU8nkaXtV8YEj9JzDu qU4ukmhCBkr+PxiRID/KcVH3yYLj6dlhWPTPUZT5PMuhSse6OEXSra+yF6fxQTq1gPXb ndwbqEDOLdg0wAnbFCNCatseUv973P5EhpswVzu8xg5ww9e7r0bxGbQEvlwq8qeP2qqY AcGZkjT2jgLgIxvIonxOicq1NMQx+zQ/kxToJJHt5iRaRTr/UYOc8UR4skj8BBBuxZr6 Ya4ULaE4pSJSB8S5Gg30RUvLrTK2TzIK30nrswiprDri6Oasso3tsR0jfVI/TPs8kQOa 0O6g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b=GXR7ZO6T; spf=pass (google.com: domain of linux-kernel+bounces-27269-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-27269-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id v13-20020a65568d000000b005c66d14ab63si10747014pgs.407.2024.01.16.02.47.27 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 16 Jan 2024 02:47:27 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-27269-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b=GXR7ZO6T; spf=pass (google.com: domain of linux-kernel+bounces-27269-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-27269-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 sv.mirrors.kernel.org (Postfix) with ESMTPS id A3C5E2855FF for ; Tue, 16 Jan 2024 10:47:27 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 10EBD18E35; Tue, 16 Jan 2024 10:47:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="GXR7ZO6T" 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 DAB12175A0; Tue, 16 Jan 2024 10:47:14 +0000 (UTC) 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=219PFu8SLZjkc7zCE0Stfq7JLlZFWgwGmWkDPkxlVv4=; b=GXR7ZO6TXEibvdGSHrIn6gJlEQ aDYRjew4d7OFIKelW0IrtB3OG0XOlgsBzOi3JK35nuY60APmFj7dDM6+M+yCj4PUbpImrcgwiNbpL yYqAPYKXdWn7yjNX8b9+7rb3WKFNbUesiHBP96GFazLp4BziL0/8ckM4OAhlKG7gqcPRQeCS/FUKA ZBJPhdZ/715MTyjmZrWtELl/CYNB1a5oXiAU/YeH4fOAzIdJq1e0QrfH0sp5VQMxwqAjP0JQqbxWh dQEbU06K0zocS8Tcxrfx4BOo1+Yki9CGSWWxU2VIo23FYqcJ2xg2eIK4E65o4iblCk+vLjjq2i1Sc I2+rP0+g==; Received: from hch by bombadil.infradead.org with local (Exim 4.96 #2 (Red Hat Linux)) id 1rPgyQ-00Bi1r-0Q; Tue, 16 Jan 2024 10:47:14 +0000 Date: Tue, 16 Jan 2024 02:47:14 -0800 From: Christoph Hellwig To: Allison Karlitskaya Cc: linux-kernel@vger.kernel.org, linux-block@vger.kernel.org, Jens Axboe Subject: Re: PROBLEM: BLKPG_DEL_PARTITION with GENHD_FL_NO_PART used to return ENXIO, now returns EINVAL Message-ID: References: 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: X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html Hi Allison, please try this minimal fix. I need to double check if we historically returned ENXIO or EINVAL for adding / resizing partitions, which would make things more complicated. Or maybe you already have data for that at hand? diff --git a/block/ioctl.c b/block/ioctl.c index 9c73a763ef8838..f2028e39767821 100644 --- a/block/ioctl.c +++ b/block/ioctl.c @@ -21,7 +21,7 @@ static int blkpg_do_ioctl(struct block_device *bdev, sector_t start, length; if (disk->flags & GENHD_FL_NO_PART) - return -EINVAL; + return -ENXIO; if (!capable(CAP_SYS_ADMIN)) return -EACCES; if (copy_from_user(&p, upart, sizeof(struct blkpg_partition)))