From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=213.95.11.211 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1793960785; b=32NI4fEz5vsSJ9T06Mvg0kR5zmyasiKPW63cFGoNnkxRxaxQoPPFfJOiJ0SIUiywkW1L KQtSOWwvQD7RI/ATj8HZsSw/HgkFWBKzE44roeQrUihbsy00sZucGt0STlHZPY2IoA1zk x1fMaaJCFrh9YpIgw84d0vkagO/B7jqySvTtWngWBEpxZ1gMSFkqKBInBRXDhZLSIjuWd 4dArYG/7+5sC1mFWKA/18Qog5JSxBm2VA2W8cg9B2V8LnQgu2zGJ1nGVt2cnMBnzR9r3H +Xtm7YwBe71pU3JDeXHIxB1FP9au7V8SqVOLNKNJJodqWO5C8LgvndebrypAsEeUgng== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1793960785; h=DMARC-Filter:Received:Date:From:To:Cc:Subject:Message-ID:References: MIME-Version:Content-Type:Content-Disposition:In-Reply-To:User-Agent; bh=RqQSYGOZZG/aIHhMQ8HE+3EsiHhz5Y9+6eyhSvGw+c0=; b=maLzDZpyTPqz7b+7hp9SL1vE2+9g09LCaE4PyPOtbhklxojNcyncwJi7KSlBafUAb2jt mG3+evQ69ayM5pEtmi2xtGqN/feVza0vWvDqslaiWhl+SBTzS1/PuPJLQaUwNgnn0g/DB CX/7uHRHlJNnA15xvO9sKRE7ec06FVjA/ZSo4ONl3XLW0a724ZofjdAOiOQlgPMBGbO/Q kLSqTUpR2s9MM+dFjF3fW3tx8QektlufH2CDDIFHvEYvfbrndiHwH7sLag0fa4MTpjqBx YtYo2Df8TJesUi3vkqVBWhGYtKT2dwWMJoFkKqeBhYZBHqYQl8/yTZrf/oSC9sQfvCQ== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=lst.de; spf=pass smtp.mailfrom=lst.de; arc=none smtp.remote-ip=213.95.11.211 Received: from verein.lst.de (verein.lst.de [213.95.11.211]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B4C78606A329; Fri, 6 Nov 2026 10:26:23 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org B4C78606A329 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=lst.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=lst.de Received: by verein.lst.de (Postfix, from userid 2407) id 48CA668BEB; Fri, 6 Nov 2026 11:26:19 +0100 (CET) Date: Fri, 6 Nov 2026 11:26:18 +0100 From: Christoph Hellwig To: Andrey Albershteyn Cc: ebiggers@kernel.org, hch@lst.de, fsverity@lists.linux.dev, dsterba@suse.com, linux-xfs@vger.kernel.org, linux-btrfs@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net, linux-ext4@vger.kernel.org, linux-fsdevel@vger.kernel.org, brauner@kernel.org, viro@zeniv.linux.org.uk, jaegeuk@kernel.org, chao@kernel.org, tytso@mit.edu, Boris Burkov Subject: Re: [PATCH v2 1/5] fsverity: strip FS_VERITY_FL from FS_IOC_SETFLAGS Message-ID: <20261106102618.GA5319@lst.de> References: <20261105115532.613467-1-aalbersh@kernel.org> <20261105115532.613467-2-aalbersh@kernel.org> X-Mailing-List: linux-fsdevel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20261105115532.613467-2-aalbersh@kernel.org> User-Agent: Mutt/1.5.17 (2007-11-01) On Thu, Nov 05, 2026 at 12:55:26PM +0100, Andrey Albershteyn wrote: > The common use of FS_IOC_GETFLAGS/SETFLAGS is get-modify-set loop. > Filesystems could return verity status with GETFLAGS, attempting to then > pass FS_VERITY_FL to SETFLAGS is not allowed. > > The ext4 and f2fs already treat FS_VERITY_FL in the set path as no-op, > however, BTRFS returns -EOPNOTSUPP. So, the modification of other flags > doesn't work on BTRFS for fsverity inodes. > > Fix it for BTRFS and anyone else, the ext4 and f2fs masking becomes > no-op. The file_get/setattr() path is fine here as this flag is cleared > right before fileattr_set_prepare(). The future fsverity support in XFS > would also need it. > > Cc: Boris Burkov > Cc: David Sterba > Fixes: 146054090b08 ("btrfs: initial fsverity support") > Signed-off-by: Andrey Albershteyn > --- > fs/file_attr.c | 10 ++++++++++ > 1 file changed, 10 insertions(+) > > diff --git a/fs/file_attr.c b/fs/file_attr.c > index 833e03810b24..b43977d5f8e0 100644 > --- a/fs/file_attr.c > +++ b/fs/file_attr.c > @@ -199,6 +199,16 @@ static int fileattr_set_prepare(struct inode *inode, > if (err) > return err; > > + /* > + * verity is settable only via FS_IOC_ENABLE_VERITY; never through > + * fileattr Maybe spell out FS_VERITY_FL above? Starting the sentence with a lower case letter looks odd, and spelling out the flag name doens't hurt. Otherwise looks good: Reviewed-by: Christoph Hellwig From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from lists.sourceforge.net (lists.sourceforge.net [216.105.38.7]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D05C8606A329 for ; Fri, 6 Nov 2026 10:26:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key, unprotected) header.d=lists.sourceforge.net header.i=@lists.sourceforge.net header.a=rsa-sha256 header.s=beta header.b=FXSLezI6; dkim=fail reason="signature verification failed" (1024-bit key, unprotected) header.d=sourceforge.net header.i=@sourceforge.net header.a=rsa-sha256 header.s=x header.b=bTgWZVPS; dkim=fail reason="signature verification failed" (1024-bit key, unprotected) header.d=sf.net header.i=@sf.net header.a=rsa-sha256 header.s=x header.b=Se4aEu+c DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.sourceforge.net; s=beta; h=Content-Transfer-Encoding:Content-Type:Cc: List-Subscribe:List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id: Subject:In-Reply-To:MIME-Version:References:Message-ID:To:From:Date:Sender: Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender :Resent-To:Resent-Cc:Resent-Message-ID:List-Unsubscribe-Post:List-Owner; bh=60Nk/FUKjG1iIU7JxhrtQJlZ0OR8XGHelEqkeJhFJm4=; b=FXSLezI6vbRc7c/vQ+jl55r0Au NMqHLK6TCptuKFCEddE5NiqyPXgiNvHilEx1DIrmM1CviqCjy5munWzPDkWEX31uMMqVqKXD6zESv Lm5969/jYWb+ZA46FFMCUWxV3l2QB8srmpCm+32GxMg2xLXKGP7Pu8GvJ0eEnYX9S8MI=; Received: from [127.0.0.1] (helo=sfs-ml-1.v29.lw.sourceforge.com) by sfs-ml-1.v29.lw.sourceforge.com with esmtp (Exim 4.100.1) (envelope-from ) id 1xPH9m-000000006EE-27IR; Fri, 06 Nov 2026 10:26:50 +0000 Received: from [172.30.29.66] (helo=mx.sourceforge.net) by sfs-ml-1.v29.lw.sourceforge.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.100.1) (envelope-from ) id 1xPH9V-000000006DV-0Qkz for linux-f2fs-devel@lists.sourceforge.net; Fri, 06 Nov 2026 10:26:33 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sourceforge.net; s=x; 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:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Unsubscribe-Post:List-Subscribe:List-Post:List-Owner:List-Archive; bh=RqQSYGOZZG/aIHhMQ8HE+3EsiHhz5Y9+6eyhSvGw+c0=; b=bTgWZVPSLuSXXolGzRos6R+ChD r88xgFqS2mkF6JpopL0K6Tu+hilDdgG1TszGaY/HDSBtkFXTUEOBLqC+KKWVIoIwth5EEYdOQ1HK4 u0nQ6LRMgfS2l/MXhsczVme4J0lVL62IIm3SP87DBHsPGf+sGLwvpTDTnm7NcClkvrDY=; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sf.net; s=x ; 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:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Unsubscribe-Post: List-Subscribe:List-Post:List-Owner:List-Archive; bh=RqQSYGOZZG/aIHhMQ8HE+3EsiHhz5Y9+6eyhSvGw+c0=; b=Se4aEu+c3KCfhCMOxQvRoY7yXx iibZmdPN2k5+38L3NwRA9XfAf1iou/thsPC+Xz4dL/SpSDd7OKS/ZOvKXVG7EllNNEZ8+FFQjQSfe gbFP4ATSBpsqBZwTMedadH2P0GUr8Uhky6TU6MQ8GaueSIRRgxLtE9ZNGsp/EftV4d64=; Received: from verein.lst.de ([213.95.11.211]) by sfi-mx-1.v28.lw.sourceforge.com with esmtps (TLS1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.100.1) id 1xPH9Q-000000007Zc-2ZjU for linux-f2fs-devel@lists.sourceforge.net; Fri, 06 Nov 2026 10:26:30 +0000 Received: by verein.lst.de (Postfix, from userid 2407) id 48CA668BEB; Fri, 6 Nov 2026 11:26:19 +0100 (CET) Date: Fri, 6 Nov 2026 11:26:18 +0100 From: Christoph Hellwig To: Andrey Albershteyn Message-ID: <20261106102618.GA5319@lst.de> References: <20261105115532.613467-1-aalbersh@kernel.org> <20261105115532.613467-2-aalbersh@kernel.org> X-Archived-By: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20261105115532.613467-2-aalbersh@kernel.org> User-Agent: Mutt/1.5.17 (2007-11-01) X-Spam-Score: 0.0 (/) X-Headers-End: 1xPH9Q-000000007Zc-2ZjU Subject: Re: [f2fs-dev] [PATCH v2 1/5] fsverity: strip FS_VERITY_FL from FS_IOC_SETFLAGS X-BeenThere: linux-f2fs-devel@lists.sourceforge.net X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Archive: List-Post: List-Help: List-Subscribe: , Cc: fsverity@lists.linux.dev, linux-xfs@vger.kernel.org, brauner@kernel.org, tytso@mit.edu, linux-f2fs-devel@lists.sourceforge.net, ebiggers@kernel.org, linux-fsdevel@vger.kernel.org, viro@zeniv.linux.org.uk, dsterba@suse.com, jaegeuk@kernel.org, linux-ext4@vger.kernel.org, Boris Burkov , hch@lst.de, linux-btrfs@vger.kernel.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-15.4 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_PASS, SPF_PASS,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=4.0.1 X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on aws-us-west-2-korg-listserv-alma10-1 On Thu, Nov 05, 2026 at 12:55:26PM +0100, Andrey Albershteyn wrote: > The common use of FS_IOC_GETFLAGS/SETFLAGS is get-modify-set loop. > Filesystems could return verity status with GETFLAGS, attempting to then > pass FS_VERITY_FL to SETFLAGS is not allowed. > > The ext4 and f2fs already treat FS_VERITY_FL in the set path as no-op, > however, BTRFS returns -EOPNOTSUPP. So, the modification of other flags > doesn't work on BTRFS for fsverity inodes. > > Fix it for BTRFS and anyone else, the ext4 and f2fs masking becomes > no-op. The file_get/setattr() path is fine here as this flag is cleared > right before fileattr_set_prepare(). The future fsverity support in XFS > would also need it. > > Cc: Boris Burkov > Cc: David Sterba > Fixes: 146054090b08 ("btrfs: initial fsverity support") > Signed-off-by: Andrey Albershteyn > --- > fs/file_attr.c | 10 ++++++++++ > 1 file changed, 10 insertions(+) > > diff --git a/fs/file_attr.c b/fs/file_attr.c > index 833e03810b24..b43977d5f8e0 100644 > --- a/fs/file_attr.c > +++ b/fs/file_attr.c > @@ -199,6 +199,16 @@ static int fileattr_set_prepare(struct inode *inode, > if (err) > return err; > > + /* > + * verity is settable only via FS_IOC_ENABLE_VERITY; never through > + * fileattr Maybe spell out FS_VERITY_FL above? Starting the sentence with a lower case letter looks odd, and spelling out the flag name doens't hurt. Otherwise looks good: Reviewed-by: Christoph Hellwig _______________________________________________ Linux-f2fs-devel mailing list Linux-f2fs-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel