Received: by 2002:a05:7412:ba23:b0:fa:4c10:6cad with SMTP id jp35csp5483rdb; Wed, 17 Jan 2024 15:05:35 -0800 (PST) X-Google-Smtp-Source: AGHT+IHHvBZkptYx18+3E2WscOVIUC+iNRp7b3hw8pyUBVK1FsDbzhHxClA4xInrY4/kN1V9iOvL X-Received: by 2002:a17:902:b682:b0:1d6:ec26:ea86 with SMTP id c2-20020a170902b68200b001d6ec26ea86mr13939pls.68.1705532735041; Wed, 17 Jan 2024 15:05:35 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1705532735; cv=pass; d=google.com; s=arc-20160816; b=bdUnHKG8XG3rbIWjANQJpcDZqP2A/FzaBoT/GFKVZTmbRK6ZZzxC6ot7+eZvTzHqAl +5qqf7JubBiMu+2PjsVkkyyrcdDAIVxNOtPJyAek7IPBsQzGt+9CFSvpMCSOCwhH+Oaf EgUdhfPxsJfVXVqvS0LFIgOWKC3NCfNfQRY1NIJD0D+wd/nxQ3AlN/on3sYUBIx3tFRa P0/es6KkobtptCHUOS8I5hsj8F0szkvkIc0xkjjb5KGSinlM0bQfx9uE857e2OrXDdhZ 0T0/6d4USjgpPlZzzc/YpLmLpGZ7ZkSR9OtD6hKzmloW4JhKvW3k+D4+9ni05cG1ilpt 357g== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:dkim-signature; bh=RZimxNNYUhQiGc9CSi8XOIRdijUq2WzHdtfDAUowK1o=; fh=FqQdaH7RFyqInA6QOJ8b7y8bwjW5WpRFqGJ1guXWkug=; b=r/LZ1dEaZ59bV67al8wsw5Lunr59alnc+FmukszhswaK9UXqLjOLhqcv7Sbqyyv5Cj AVyVlKWnIJwk/QFFEutpZU0djpLMYWFKhBgZE+Jo5UtvmhAvVoxIiHVJ/S48PeUgHomo w3wa+V5x31zW6tpi1p95FSw/KB+wh9J/wvNgUe5ZPVWOkjH7fe8aPla1+RBi8RV11h1h h8bOE/lv5W7uSgt/a8wvjATV3qDnUGzY6Umu3WVxXCuxMfsvhp/yTO5skGLizNhWWjRi PrniGHnJWhaQVl/J8GIkdmwpmUpu4ahkABn0QboG/u7ZJaBBL4ETtUQu+08Gr53kOZxx RfPQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel-dk.20230601.gappssmtp.com header.s=20230601 header.b=inIwrTMr; arc=pass (i=1 spf=pass spfdomain=kernel.dk dkim=pass dkdomain=kernel-dk.20230601.gappssmtp.com); spf=pass (google.com: domain of linux-kernel+bounces-29533-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-29533-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id h10-20020a170902f7ca00b001d381d2ea62si340922plw.516.2024.01.17.15.05.34 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 17 Jan 2024 15:05:35 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-29533-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel-dk.20230601.gappssmtp.com header.s=20230601 header.b=inIwrTMr; arc=pass (i=1 spf=pass spfdomain=kernel.dk dkim=pass dkdomain=kernel-dk.20230601.gappssmtp.com); spf=pass (google.com: domain of linux-kernel+bounces-29533-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-29533-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 ABCC52815FF for ; Wed, 17 Jan 2024 23:05:34 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id BF4B228DB3; Wed, 17 Jan 2024 23:05:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel-dk.20230601.gappssmtp.com header.i=@kernel-dk.20230601.gappssmtp.com header.b="inIwrTMr" Received: from mail-io1-f43.google.com (mail-io1-f43.google.com [209.85.166.43]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id BE52328DA1 for ; Wed, 17 Jan 2024 23:05:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.166.43 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705532727; cv=none; b=n47aNyPaegvyWD+mbb2koDb3DS2B/G5V2+LqLXKMDgbccNP3FWxXrnOkWfhqRQMXsMMcob8OZj6B4UuHmbYO/CfNLMQOHdtAPWOXYvExeCYnlNWflh3fNqPDoofxZnRrqfOlJVT076t/dc+4VMujqPXL73wQFuZTRNVoxJXcQcg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705532727; c=relaxed/simple; bh=kvRMcs2AJiiR5G0vH3bSAe9+o9cJGPIsxUiD+6tp9po=; h=Received:DKIM-Signature:X-Google-DKIM-Signature: X-Gm-Message-State:X-Google-Smtp-Source:X-Received:Received: Message-ID:Date:MIME-Version:User-Agent:Subject:Content-Language: To:Cc:References:From:In-Reply-To:Content-Type: Content-Transfer-Encoding; b=e2rYsJ4Xl36wF+Z95OcjY4b0vLMuc+vovMJ45an3tNnbAfy3Al76+30jurpZ059g7o+TRC2vibCJRq2vXDyy4j/NMuXsoo8Q4nJZXQYv+9TPK0wzcWRyaMcdVAgNINiUPSqgw3P+YHnpXz8xLmxg9E1kLNbUTN46Mro4iRY/35o= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=kernel.dk; spf=pass smtp.mailfrom=kernel.dk; dkim=pass (2048-bit key) header.d=kernel-dk.20230601.gappssmtp.com header.i=@kernel-dk.20230601.gappssmtp.com header.b=inIwrTMr; arc=none smtp.client-ip=209.85.166.43 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=kernel.dk Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=kernel.dk Received: by mail-io1-f43.google.com with SMTP id ca18e2360f4ac-7bb5be6742fso111879839f.1 for ; Wed, 17 Jan 2024 15:05:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel-dk.20230601.gappssmtp.com; s=20230601; t=1705532724; x=1706137524; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=RZimxNNYUhQiGc9CSi8XOIRdijUq2WzHdtfDAUowK1o=; b=inIwrTMrllL8TPNROGPZwgFajAwytZTfbx8BOWkcTeocaum8CuBzu62uaVYU3xfMbj vNtyxVF2cPMB0e1bPD5IBhX2skJttV629bOG61ik9eOsqriHdegtSd1pKNloPo2Yv8Ge /e2lyR0vLwmMovy/S9H4SpeCiG5zCewR5A23EtPaXIDmCuoK9ihItdlw9xleK9NV2Qoe RSkTPpMCEdbmYjsYRcqJAGGT3Z9mBQ41PmfXhbua97KOxbRJXrEsi0OG3YJsUB6pe20D qajkMAxB+Nw8w4PbhdVYdVyXbpFuhWKABzsh8dW8YbU06uRrie3+eaZttThWAK4QaYJ4 p0lw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1705532724; x=1706137524; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=RZimxNNYUhQiGc9CSi8XOIRdijUq2WzHdtfDAUowK1o=; b=B70JK5vUny63lU1ITNDwb7GEmYQnuFPtnTrLo4UerAH1N26UuSXAzjXMfYShLf3idD xAhVwgFmqM6gvUqn5R+0k7WFKt824WIMi1aKgceJ25hOfQbOy/exyY52eEfQpNnKhgs2 1ylV5V+JyXfimFTVTtLNsMo12F76uzuK3gTe0k5OUWr7KGRalmiqsvkB5TWbcGU4hr/H TdjIoDnwESBGbfwWFCzb48L3TLOUg2NlF+wUSHhZPRHcIM22Px2RQP1KMZ/h+Z12+iO5 NRM0dcUrtVs9WbImuRUrWzy/f7NbdqrHZOTUGToCyRzn7MKobxs7l0ZtRtWCPlmgYrRW pZSQ== X-Gm-Message-State: AOJu0YxM6UxOOMJd4vHKcjWhvneBExLUKe0jZdtvciANsXxlZE1fJtNF Y/XqLL1OBmWbJkBmwhu1dc5yJUYnAamM5fVtfBwZ21bS/mFClSJYyOljda/VwZw= X-Received: by 2002:a5d:97d7:0:b0:7bf:356b:7a96 with SMTP id k23-20020a5d97d7000000b007bf356b7a96mr77714ios.2.1705532723830; Wed, 17 Jan 2024 15:05:23 -0800 (PST) Received: from [192.168.1.116] ([96.43.243.2]) by smtp.gmail.com with ESMTPSA id s11-20020a056638258b00b0046dda6b83c1sm670895jat.25.2024.01.17.15.05.22 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 17 Jan 2024 15:05:23 -0800 (PST) Message-ID: <9677a5bc-b867-4350-9848-6a726dc9d573@kernel.dk> Date: Wed, 17 Jan 2024 16:05:22 -0700 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: PROBLEM: BLKPG_DEL_PARTITION with GENHD_FL_NO_PART used to return ENXIO, now returns EINVAL Content-Language: en-US To: Yu Kuai , Christoph Hellwig , Allison Karlitskaya Cc: linux-kernel@vger.kernel.org, linux-block@vger.kernel.org, "yukuai (C)" References: <210deda9-5439-244a-0ce2-af9dc8e5d7fe@huaweicloud.com> <592625f7-36d7-02e0-2ee6-8211334aa0f9@huaweicloud.com> From: Jens Axboe In-Reply-To: <592625f7-36d7-02e0-2ee6-8211334aa0f9@huaweicloud.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On 1/16/24 6:46 AM, Yu Kuai wrote: > Hi, > > ? 2024/01/16 21:23, Yu Kuai ??: >> Hi, Christoph >> >> ? 2024/01/16 18:47, Christoph Hellwig ??: >>> 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; >> >> I think this might not be a proper fix, the reason if that before this >> condition is added, -ENXIO is returned from bdev_del_partition(). And >> there are also some other error number like -EACCES,-EFAULT following, >> so this change will still make changes for user in other cases. > > 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: Can you send this out as a proper patch? -- Jens Axboe