From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-ej1-f44.google.com (mail-ej1-f44.google.com [209.85.218.44]) (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 04533466B0E for ; Fri, 21 Aug 2026 09:47:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.44 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787305647; cv=none; b=pn+ol+bSosGKgbfRY76ErZVLsAGbO79D1x3KLrIhkG0Ypp4Gsrmjuv89Cw+PUU0FJbs3yC0SZYGbVP0Vd3NFsTk8kPDC/lBEW9mF35XwXou7dB0JGMuZwpvMkciiTcKd+7G8F40LqepzYoB+vVDJgbV+lHU5+eLdSsUQYvL+OYw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787305647; c=relaxed/simple; bh=aR7WYlaxKUmBaZOojtRZDxqESOtVxTNnI9A7EVNIiWE=; h=Date:From:To:Cc:Subject:Message-ID:MIME-Version:Content-Type: Content-Disposition:In-Reply-To; b=AsQPyxiDuLWGn5FkJVIzvEyzDlIo8uKB7b6XhBVzHnO3JYvsO9Y0B79ll4+bF6BmW9+ENDGfm96faw/mCsqcR0nS+zUnToBuyR6pniBNeXkLARE64MumM/TV+TdLs2o95HhPLV64P/MHvKsZHOxGG5nh4u7PXrnsykP4JLvK4Us= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linbit.com; spf=pass smtp.mailfrom=linbit.com; dkim=pass (2048-bit key) header.d=linbit-com.20251104.gappssmtp.com header.i=@linbit-com.20251104.gappssmtp.com header.b=C1mnNMQu; arc=none smtp.client-ip=209.85.218.44 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linbit.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linbit.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linbit-com.20251104.gappssmtp.com header.i=@linbit-com.20251104.gappssmtp.com header.b="C1mnNMQu" Received: by mail-ej1-f44.google.com with SMTP id a640c23a62f3a-c2022323c37so131437466b.0 for ; Fri, 21 Aug 2026 02:47:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linbit-com.20251104.gappssmtp.com; s=20251104; t=1787305637; x=1787910437; darn=vger.kernel.org; h=in-reply-to:content-disposition:content-type:mime-version :message-id:subject:cc:to:from:date:from:to:cc:subject:date :message-id:reply-to:content-type; bh=aR7WYlaxKUmBaZOojtRZDxqESOtVxTNnI9A7EVNIiWE=; b=C1mnNMQu+vSwtzbHPfvX9slE3ngp4uaAruJWJH4WhTmLYJrRN6ANzEVRZFYQQ/nJ3j jdGG/6yonxIksgXCQlEDDZAbkrsgvv+lNDepni+mhIu/WwfHxBjoxYfO3749paJGh4kC AKrIy3itkLYSagsiM/FVofvSQe9pYPt8e0Jh3sjzl+Z4/s8JXKQMXu7Is0UtJtMj8bXD BE+7syTivOizf8/m7RdHmX4giK/JSAcb2MmUAK+0dzZ1OPRl07ZO2KNm5KI6+2UdCsQ+ fu8dN38+BV7ViE/PQnbSqY28YBbMkDelPMJ8Aup4wLsRGMHjOft/Vx1XdhQxABdyvqlN VZcQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1787305637; x=1787910437; h=in-reply-to:content-disposition:content-type:mime-version :message-id:subject:cc:to:from:date:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to:content-type; bh=aR7WYlaxKUmBaZOojtRZDxqESOtVxTNnI9A7EVNIiWE=; b=p4vMaFYPsp252D6xHAhxvzO4uuuW1U96hidJfpKX+y6tYB+mVRfkZ5qZZl6zOzZvwF /xU2/OFwlMM0l1s+DEOTnF+MeROIXe9wZDlqgvDLsFfAReAV0BpAZJ6ESGnPoUV0Cg8S 9ZpO14uoKUj58Pcu1sN8TJ7ko38Z2ZxclJzZX2+tuwAoQZrEa0Jn3omcJXZnAD9A9YiN zcIjZER4+m45YPH+iB3+IPE99jmYDt4C8A6WRMbI8W7aOVcBKs3q1l3hPPIGx7Src+bI qE0KURV+WDIXxWLSZ07dT4pmjSBVrXgHh6KGb7CCeaGqZRu2pIK5P443arA8M/lNssN9 1XDA== X-Forwarded-Encrypted: i=1; AHgh+RqCRKG/EkOHZHbt+M/zoIOrs13fPuVlaHQ7sN8r/CoQFKChtTO1yk8gXE2oYI9+Vabbt39FxKLn/KC6c20=@vger.kernel.org X-Gm-Message-State: AFuF++m4Es+v6p6bxrFeF9r15shWM9eG2sfcK87UGCub1Hv9GeLvXzWs v2t6exepM4lkTZ065SrPWN2FJvP21EggOx8fLsQhsKOAn+amyA0UjhMmlem20FxTaRKktn87LE2 sYqhy5pg= X-Gm-Gg: AR+sD126ESve1UeCUhZFwSfqykeaAII8owRjan9t7ehRFAAZcetHU02Ly2JuGG5e5K0 Nyw77nAhEOyXN6SuXgC5XCdIq9930Ct0uASPN+q2b6Nry3DIccDdel5nj4ax1fWPawXKWYdrO8w VrwSB4GPxHtyiEtSVw59f34UuxEK4HecxJFxrallj42fn6PXLjkpgYTsPG38OjZfpZ8sWa1jWVT USZ+oR7Ia/Q16BpmN0srLPl7e4lNbAa1LHW0ZS0OZiK4opYbnq9sPYHM3N+iIPT0TvA90xt3BZo i3ntbI/X9v0shUpsLo4ReN9VTYmu8eTjoZLtwOy0ooj/eZLih2bgoPjku/55pOHOpLDZ4ETrAHz mNuVQpyk305sU84xoYDFGXqyudbERQ/RKCQEJ5Ubp9rTJM6ENnotGxG6IN7NWCAOhHyha8bwApp Nra3U36dzfYo54qbFWAT58GpLevxLRPgmhmTxDqZ46nMviSBfHjdqYxeQrwMaRkSrLPl4fpaMHo 3pdhVFjDkG/k1HbicJ2aDMq7e6241rY3G8= X-Received: by 2002:a17:907:e90:b0:c20:33db:41d3 with SMTP id a640c23a62f3a-c246a5f45aamr534704466b.11.1787305637389; Fri, 21 Aug 2026 02:47:17 -0700 (PDT) Received: from grappa.linbit (62-99-137-214.static.upcbusiness.at. [62.99.137.214]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-c2459223af1sm395865166b.58.2026.08.21.02.47.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 21 Aug 2026 02:47:16 -0700 (PDT) Date: Fri, 21 Aug 2026 11:47:15 +0200 From: Lars Ellenberg To: Moritz Tanner Cc: Christian Brauner , Alexander Viro , Jan Kara , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] fs: don't return -EINVAL for successful nested thaw Message-ID: 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: <20260821085451.65206-1-moritz.tanner@linbit.com> On Fri, Aug 21, 2026 at 10:54:51AM +0200, Moritz Tanner wrote: > This breaks bdev-initiated freezing. When a filesystem is frozen with > FIFREEZE and additionally frozen via bdev_freeze() -- which nests by > design, see fs_bdev_freeze() -- the subsequent bdev_thaw() receives > -EINVAL from the holder op although its freeze reference was dropped, > and therefore keeps bd_fsfreeze_count elevated. The other thaw order is the same defect seen from userspace: while the bdev freeze is still held, fsfreeze -u returns EINVAL although it did drop its reference, and the filesystem stays frozen until the block layer holder thaws it. In-kernel holders get the spurious error as well, whenever a userspace freeze is held at the same time: xfs_scrub's xchk_fsthaw() carries the comment "This should always succeed, we have a kernel freeze", and f2fs_ioc_gc_range() hands the error to userspace. Tested-by: Lars Ellenberg Reviewed-by: Lars Ellenberg