From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 3AFF612DDAE; Tue, 16 Apr 2024 14:44:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713278699; cv=none; b=VICOpnNeJGMctGrfrAfUAw7zn1Zhr+ws5Csd4kdb3HsE9jI8gkMra8q/MlPqAtAfQAKfq4RF0Dy6vmAEdgSVKfzbNBbvaaYsltwe9h/Q01BDDN5F5gLCr4jRSk9Ug6ZZVzfjyOrxF88oeyMGluBGnXiZvY+/Yz7LAuxyV+BNgTQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713278699; c=relaxed/simple; bh=RsDtzCi/AC/WSg7s2RwFMDLB7cfQ+Jn7MP8sUhas0/s=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=A4L+A9MScEqRSIQKlKDv3TZjk3v4vWi7+flrfNIXn5vt+w68qMbx/3QXRzvCahGapf7ErhkC8UGuA0/NjcW1wtSjaNDrTdu+4eKSyjbv5fNm8JXbSQ9bphCpaN2y6UH9YodB4cD0gjS0RrtEj7TsmIvOD8GT07uECzHannFDsnE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=dsMLJDN7; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="dsMLJDN7" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 515E5C113CE; Tue, 16 Apr 2024 14:44:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1713278698; bh=RsDtzCi/AC/WSg7s2RwFMDLB7cfQ+Jn7MP8sUhas0/s=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=dsMLJDN7maRAxcb09mjajne7GLFzZEMR7vrx8x6Ba3SC23G8CuNg3qVDsmGfAcJdq Ou/Tf+uCqkBveUDsaf+0s81sEJNMZKvLVqzAn4UiVI2b+Iy53V4uHOq+1lpSBciuhd R6IFI98ogEHxf8bYS6xrdQR+CWah8hja17628/4rZT9tDmEujDm/w1XjTliqeyYmzn yIaTl5QHtKOIULhyFgETY/9tHp9WzR/Qew6aUGQgCJiOD5r3yU0legUw8TCrzkas70 J8jlJLkSUVNVGiKbzHs/pomYtn98llYwdOO5D/m9QQUp5bfZJUzRPTRx+rE/whm/SQ iPK6AD3TLzTQg== Date: Tue, 16 Apr 2024 08:44:55 -0600 From: Keith Busch To: Lennart Poettering Cc: Christoph Hellwig , Linux regressions mailing list , linux-block@vger.kernel.org, LKML , Jens Axboe Subject: Re: API break, sysfs "capability" file Message-ID: References: <54e3c969-3ee8-40d8-91d9-9b9402001d27@leemhuis.info> <20240409141531.GB21514@lst.de> Precedence: bulk X-Mailing-List: linux-block@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: On Tue, Apr 16, 2024 at 04:23:43PM +0200, Lennart Poettering wrote: > On Di, 09.04.24 16:15, Christoph Hellwig (hch@lst.de) wrote: > 11;rgb:1717/1414/2121 > > On Tue, Apr 09, 2024 at 10:19:09AM +0200, Lennart Poettering wrote: > > > All I am looking for is a very simple test that returns me a boolean: > > > is there kernel-level partition scanning enabled on this device or > > > not. > > > > And we can add a trivial sysfs attribute for that. > > > > > At this point it's not clear to me if I can write this at all in > > > a way that works reasonably correctly on any kernel since let's say > > > 4.15 (which is systemd's "recommended baseline" right now). > > > > > > I am really not sure how to salvage this mess at all. AFAICS there's > > > currently no way to write such a test correctly. > > > > You can't. Maybe that's a lesson to not depend on undocumented internal > > flags exposed by accident by a weirdo interface. Just talk to > > people. > > Undocumented? Internal? > > It's was actually one of the *best* documented kernel *public* APIs I > ever came across: > > https://www.kernel.org/doc/html/v5.16/block/capability.html > > So much detail, I love it! > > I mean, you did good work here, documented it, with all flags in all > details. I think that's great work! You should take pride in this, not > try to deny its existance! The patch that introduced this was submitted not because the API was stable; it was committed to encourage developers to update it as it changed because it is *not* stable. That's not the kind of interface you want exported for users to rely on, but no one should have to search commit logs to understand why the doc exists, so I think exporting it was just a mistake on the kernel side. To say this doc is "good" misunderstands what it was trying to accomplish, and what it ultimately created instead: technical debt. The block interfaces documented in Documetation/ABI/stable/ are reliably stable, though.