From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-oa1-f48.google.com (mail-oa1-f48.google.com [209.85.160.48]) (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 CE3942EDD6B for ; Wed, 15 Jul 2026 22:34:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.160.48 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784154879; cv=none; b=qZj9TyTiMapY+6YyNUqTUbAA0Snn7qgdVVwNoW8WGQmdKNh5aTYoUvZr1uY0EhVCG5dRF9q9N3fZ4XRJY+fnz1BHaa1Za8TKf4eRS9D/7Rpr73IiHda1NB0RJmZ1ckwNFrfokbAJhr3AUoi/hhEDBQVSu7GrIHQbLTc79QRDFnw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784154879; c=relaxed/simple; bh=GIdlQuIjDuIzsJqtcE3kFuAvSVLoG9tPGeZwKd7I/wQ=; h=From:To:Cc:In-Reply-To:References:Subject:Message-Id:Date: MIME-Version:Content-Type; b=sagPqWiIdzvSAgkwIKlu8Yxfek8JXphQsl0X21C506yRUoUnw0Xu8F7oWiIiMjPIdQgSuTARt8J6i84yisTpkXGvjZJBqj4/dPQjcuHF37gaKc7vo3EQIUnJEx9K+2Rq/njLs1G5eMGSjJmmbRLxyTUMzLmkX7e3LCGZWDVtNEI= 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.20251104.gappssmtp.com header.i=@kernel-dk.20251104.gappssmtp.com header.b=0roWetlT; arc=none smtp.client-ip=209.85.160.48 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel-dk.20251104.gappssmtp.com header.i=@kernel-dk.20251104.gappssmtp.com header.b="0roWetlT" Received: by mail-oa1-f48.google.com with SMTP id 586e51a60fabf-448479e0eb6so1721063fac.2 for ; Wed, 15 Jul 2026 15:34:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel-dk.20251104.gappssmtp.com; s=20251104; t=1784154877; x=1784759677; darn=vger.kernel.org; h=content-transfer-encoding:content-type:mime-version:date:message-id :subject:references:in-reply-to:cc:to:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=6XggqMlUurXEr1KQCtY04ORi5k4fbc/Vyu3AcdPcPDs=; b=0roWetlTJ6EipKRfJISFaLjbWTkKGqMjqR6GR7UKoZxG+MVrSzMq9jjQgMPedkNlIp 4iAHKuRZmduwR0jvx+8zVpgkkeAY1RPMvIzmFcKRcitNmX4ooYVMxhTU8yN/ymNHuytp z4exdlJotnQoT7hM+6PF+58x80kN8DvDKtJ2GeodK62B8+NINgIZqj3jyc43yWOfxfLT COL4XImIpdlDSx7gbsq8mvQb1CsJ+jYIHHEpNoOg5u+Xi3vIhfG8KQkGI5tlNLCJ/943 XRNe5clshOHbhKs7H/XHwCBSGWF2KCD7MpHO0ASYIJHxlbybEZGmKwrrEzf2tbFI/bKW tLgA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1784154877; x=1784759677; h=content-transfer-encoding:content-type:mime-version:date:message-id :subject:references:in-reply-to:cc:to:from:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=6XggqMlUurXEr1KQCtY04ORi5k4fbc/Vyu3AcdPcPDs=; b=KgDRYqhU2Jte1IInWzM1DY0FLOvv6loABSfi3f3s65KhAxr7AWfJWbJuhxUx7MFwfR 41JagX4UbF0dD7NwZ5NiJ8m1HU4XMijsWQNO10OSWrM0YN8BMWn9RhkV+SsufsDIcZlj BCs7L/HKUFK7u2OJmEYqczSOnGW3IvIkHWjN8EY74PZexAUOnbvZtdFhoRrqWynIHf2k 9OgksZQXz4HpX6YHZnlkJCg2cZJFsJ3jzlbXKPAbxpLp3kfvk93fFd5ThSoNYikKJ6H8 z+3/I5cT5lqKp9803j+GfFIYpnSmm9LZz5xQEUU1PjLOCGlw4SZJM9nbSouWCqPnQ++0 FNyw== X-Forwarded-Encrypted: i=1; AHgh+Rp4ZcHAfh57+NezFtv08cLDLmpVE2DK6GpyT2yDRsrsdknuSN7Yj/7AUBSqZaHpyzCPYjcywtPXB9WO0bs=@vger.kernel.org X-Gm-Message-State: AOJu0YyYZUO+PZBs/d248ZADW8CZmPL+Ta6ySczLyVoiw/0A+V0TXOoR Se/zJGp4njbIx6lom4J5Ki0dNHn5oPCEsx2Xj4yUpEufNHhgTYWj1tURAb9p0XJLIjU= X-Gm-Gg: AfdE7clSgeUC2b4OKvhJMWO33qr03bleNxAnwnUKEDirAsY5JryKqwTeD/mz2lLTeva IZpKMWlF74q4leqHVbnz9/PQh+kPY421zk9jYDnai+mvIri7gfl4QZzx9l3uUL4W/PIXen2x3nd unW3fjiinlmt0i3nB1jjTCmRW0OsbLSQETPAhFfRMRbxUZCIDThymEPHQtxW3p79ktSBG5gbljJ jRnc3YOTeQ4LknjuFqmfGIoR870vza/kbZgxHsWWtWt4my+oqmFaJ1Outc6jaR79Al3L5fru2pA rH/9AxrgcsH3uHIOhzbtIfuCNgRszSoAQ0L8Ro8Su/O+mUWQdrCZQ6ywcH6F7iL9iKH54em/fqv nISGtkdWX9Qxvl/maySN0e3LXyPq0kzwyYhJQ/Z1aTS40R2pIjHwJUvQvXS9TCasXrGApg8WV1+ x5fffa5hedG8Upwmp0V3CVZKuuF1ODbRppVbJUS8VbmWxW31WXmiYzkpk= X-Received: by 2002:a05:6871:8788:b0:448:c6ce:9617 with SMTP id 586e51a60fabf-451f0fc79fdmr10720122fac.5.1784154876738; Wed, 15 Jul 2026 15:34:36 -0700 (PDT) Received: from [127.0.0.1] ([198.8.77.157]) by smtp.gmail.com with ESMTPSA id 586e51a60fabf-45200b7b4c5sm14362722fac.10.2026.07.15.15.34.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 Jul 2026 15:34:36 -0700 (PDT) From: Jens Axboe To: Daan De Meyer , Christian Brauner , Daan De Meyer Cc: linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, kernel test robot In-Reply-To: <20260715-b4-loop-partition-cleanup-v1-1-b9f59910cd1e@amutable.com> References: <20260715-b4-loop-partition-cleanup-v1-1-b9f59910cd1e@amutable.com> Subject: Re: [PATCH] loop: remove manually added partitions on detach Message-Id: <178415487567.159585.4815884092425440929.b4-ty@b4> Date: Wed, 15 Jul 2026 16:34:35 -0600 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="utf-8" Content-Transfer-Encoding: 7bit X-Mailer: b4 0.15.2 On Wed, 15 Jul 2026 21:39:57 +0200, Daan De Meyer wrote: > Commit 267ec4d7223a ("loop: fix partition scan race between udev and > loop_reread_partitions()") stopped disk_force_media_change() from > setting GD_NEED_PART_SCAN because loop devices with LO_FLAGS_PARTSCAN > rescan partitions explicitly. However, partitions can also be added > manually with BLKPG while LO_FLAGS_PARTSCAN is clear. > > When such a loop device is detached, __loop_clr_fd() skips > bdev_disk_changed(). Without GD_NEED_PART_SCAN, reopening the unbound > device no longer performs the previous lazy cleanup, leaving dead > partition devices behind. A subsequent LOOP_CONFIGURE can then fail its > partition scan with -EBUSY, as seen in blktests loop/009 after loop/008. > > [...] Applied, thanks! [1/1] loop: remove manually added partitions on detach commit: c4f4c0fc551cbcdccbbbc2d874d7d6440c7b4983 Best regards, -- Jens Axboe