From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id D55CAEB64D9 for ; Wed, 14 Jun 2023 14:31:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236096AbjFNObN (ORCPT ); Wed, 14 Jun 2023 10:31:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54174 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244533AbjFNObK (ORCPT ); Wed, 14 Jun 2023 10:31:10 -0400 Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3B9F62697; Wed, 14 Jun 2023 07:30:41 -0700 (PDT) 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=rB8JFk5K99YKXzStmqgYF9E3nSRDDREOo2MajlfIWQA=; b=A1wm0Nd7/eVEtnBe2ZIa4jMH/W pOQXx8yuu8fCCYzs79aZWKa8wtk2hxzNtskcpOqaKQjr00hyfa8IBg7qADOvorPOWAB+nMQ2TZVJ2 cz2gl3a59Dia4Y4Gtsa4EEqzeIdcGQ6zSaTdsQZrWFBneY7sTThUxRKNB6cAeWQvfFsfHwgf4683w +7lqAJOUv+ilZeQ9X5sQ+CfKEXI94BzcYpW25Uueuv9YTbF7E2DrOyL2DqLQEXPW8rFyR0Vrz5MDF rj1jcuR0EMxMNEAQFGH9oFzvKsGU4oXdnmmjAspc7XGOvIf8YG3RYrILJIDeehEgf9MDtRzStfW8B ClAlgXiQ==; Received: from hch by bombadil.infradead.org with local (Exim 4.96 #2 (Red Hat Linux)) id 1q9RWA-00Butb-0u; Wed, 14 Jun 2023 14:30:38 +0000 Date: Wed, 14 Jun 2023 07:30:38 -0700 From: Christoph Hellwig To: Jan Kara Cc: Christoph Hellwig , Colin Walters , Bart Van Assche , Jens Axboe , linux-block@vger.kernel.org, Dmitry Vyukov , Theodore Ts'o , yebin , linux-fsdevel@vger.kernel.org Subject: Re: [PATCH] block: Add config option to not allow writing to mounted devices Message-ID: References: <20230612161614.10302-1-jack@suse.cz> <20230612162545.frpr3oqlqydsksle@quack3> <2f629dc3-fe39-624f-a2fe-d29eee1d2b82@acm.org> <20230613113448.5txw46hvmdjvuoif@quack3> <20230614101256.kgnui242k72lmp4e@quack3> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230614101256.kgnui242k72lmp4e@quack3> X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org On Wed, Jun 14, 2023 at 12:12:56PM +0200, Jan Kara wrote: > Well, OK, I have not been precise :). Modifying a partition table (or LVM > description block) is impossible to distinguish from clobbering a > filesystem on open(2) time. Once we decide we implement arbitration of each > individual write(2), we can obviously stop writes to area covered by some > exclusively open partition. But then you are getting at the complexity > level of tracking used ranges of block devices which Darrick has suggested > and you didn't seem to like that (and neither do I). Well, we track these ranges in the block_devices hanging off the gendisk anyway, so this is a totally different league. But in the end parsing partition tables is a little easier than parsing file system metadata but not fundamentally different. So if we really want to lock down broken sideband manipulations we can't allow that either and need in-kernel support for manipulating partition tables if that is required at run time.