Received: by 2002:a05:7412:3784:b0:e2:908c:2ebd with SMTP id jk4csp1376553rdb; Mon, 2 Oct 2023 07:49:08 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFk9NxlaKNG1pjqIbIgvbDwJYGbieB0RAdLjSh+XFNb83jFvzDX8qBhpCToEcFHITomijEr X-Received: by 2002:a17:902:f7c6:b0:1c3:a4f2:7c92 with SMTP id h6-20020a170902f7c600b001c3a4f27c92mr8339483plw.65.1696258148334; Mon, 02 Oct 2023 07:49:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696258148; cv=none; d=google.com; s=arc-20160816; b=gz8RbEhaL78DB4FpekEI4NLj+LAs9vY5NorNU7C/7SUuzG6hgKJeQuslNJ6TCwUAIs Iba+CjQ4niw8NVDs0CaRT+SV0SQdl+ffscExy9Y/hu88F67d/NS6Nf0pgAO0beEbG7aJ veD4XcO/his3+jy2937gr7naYQZHPQ51MNz6ar2bQlnVbV05FxqUe5+/c8tgV6zJhspF DJg83Q9VC8mTcC+cYNr5UR/hANWVNBxIvKJE6B3XjWC9vav3w+YnZCNgz26AhEBtbtbw stLxTB0vej9Gm6pfLpXQfQow7xRXz1rl/kZEg0diBLUn1A9p2HvGByebKWPKvjtnCA9P pv8Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature :dkim-signature; bh=j+NdBRB608UMGwx19cp+azxH113d9HD7eQvWbnS3E3c=; fh=Qrh9yQzF2wyGmSe2LtqTCm6WUWGPv8YnX0FBZQkiDjg=; b=aqIU14rQxRgM2w6yMwXk/ja2uwiP6QE/O0xjr2cncnMzY9w7hkOHO2LduunencylWp 5fQALTR0hndfVCe3SW9D2raiXAFfdmFwfyrLlhyifC60RsG3kTx9PnNcgiRgCUIJT9Vp 2nJBwuXPcRySxhh2gPDlyCd1afIsbngd9DkPNnFBbAfCn41L/zyV3wu2EPxefqU8ggMb HH5hlpMjGcpfM9eG9zxvljDwY3zPZT17VjmC8Dsm+uYOmtdE+7FksNZQQNWMm60RQ1Ag erVIFAmM2pSJFqwKjb5gRo1VKQ6AKQUAVHdXdHqkD2lMXAnfYmQm3Ot6l5n7BbROZ1zy LNvQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=E+VgZxU2; dkim=neutral (no key) header.i=@suse.cz header.s=susede2_ed25519; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from howler.vger.email (howler.vger.email. [23.128.96.34]) by mx.google.com with ESMTPS id m1-20020a170902db0100b001c61923a58esi19338003plx.137.2023.10.02.07.49.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 02 Oct 2023 07:49:08 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) client-ip=23.128.96.34; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=E+VgZxU2; dkim=neutral (no key) header.i=@suse.cz header.s=susede2_ed25519; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id D976680977B7; Mon, 2 Oct 2023 02:49:46 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236280AbjJBJti (ORCPT + 99 others); Mon, 2 Oct 2023 05:49:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41328 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236261AbjJBJtg (ORCPT ); Mon, 2 Oct 2023 05:49:36 -0400 Received: from smtp-out1.suse.de (smtp-out1.suse.de [IPv6:2001:67c:2178:6::1c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BAB2183; Mon, 2 Oct 2023 02:49:33 -0700 (PDT) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id 72D232185C; Mon, 2 Oct 2023 09:49:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1696240172; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=j+NdBRB608UMGwx19cp+azxH113d9HD7eQvWbnS3E3c=; b=E+VgZxU2q7CeNul975RN62i/o1qDZ41PCZ1yfpJ/5EpmyZ2G8JL3Jn7cukYgFh2niPOfWc SyETRyyDPubwOSlZT1g8pQ9/vahrFzS+iL6blQ33WfjlQMvm98l8e2Juw/3AINPSSM8jtj ayW3HiPv0UwgPQLGj+ef8g7/mj5okiE= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1696240172; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=j+NdBRB608UMGwx19cp+azxH113d9HD7eQvWbnS3E3c=; b=iRcq7NUyaP5be6nrcnYMoyljbjqkeyYLsaQZ4eSy3U1GaWLLWqRA9usXG8xjAdPx+QUsyb 9DNRCd1OwrwuHgAw== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 6381613434; Mon, 2 Oct 2023 09:49:32 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id LFFDGCySGmUkTwAAMHmgww (envelope-from ); Mon, 02 Oct 2023 09:49:32 +0000 Received: by quack3.suse.cz (Postfix, from userid 1000) id EEDC5A07C9; Mon, 2 Oct 2023 11:49:31 +0200 (CEST) Date: Mon, 2 Oct 2023 11:49:31 +0200 From: Jan Kara To: Wedson Almeida Filho Cc: Alexander Viro , Christian Brauner , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, Wedson Almeida Filho , Jan Kara , linux-ext4@vger.kernel.org Subject: Re: [PATCH 09/29] ext2: move ext2_xattr_handlers and ext2_xattr_handler_map to .rodata Message-ID: <20231002094931.yalzcksclq77qjvx@quack3> References: <20230930050033.41174-1-wedsonaf@gmail.com> <20230930050033.41174-10-wedsonaf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230930050033.41174-10-wedsonaf@gmail.com> X-Spam-Status: No, score=-1.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_NONE,SPF_SOFTFAIL autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (howler.vger.email [0.0.0.0]); Mon, 02 Oct 2023 02:49:47 -0700 (PDT) On Sat 30-09-23 02:00:13, Wedson Almeida Filho wrote: > From: Wedson Almeida Filho > > This makes it harder for accidental or malicious changes to > ext2_xattr_handlers or ext2_xattr_handler_map at runtime. > > Cc: Jan Kara > Cc: linux-ext4@vger.kernel.org > Signed-off-by: Wedson Almeida Filho Looks good to me. Feel free to add: Acked-by: Jan Kara Honza > --- > fs/ext2/xattr.c | 4 ++-- > fs/ext2/xattr.h | 2 +- > 2 files changed, 3 insertions(+), 3 deletions(-) > > diff --git a/fs/ext2/xattr.c b/fs/ext2/xattr.c > index 8906ba479aaf..cfbe376da612 100644 > --- a/fs/ext2/xattr.c > +++ b/fs/ext2/xattr.c > @@ -98,7 +98,7 @@ static struct buffer_head *ext2_xattr_cache_find(struct inode *, > static void ext2_xattr_rehash(struct ext2_xattr_header *, > struct ext2_xattr_entry *); > > -static const struct xattr_handler *ext2_xattr_handler_map[] = { > +static const struct xattr_handler * const ext2_xattr_handler_map[] = { > [EXT2_XATTR_INDEX_USER] = &ext2_xattr_user_handler, > #ifdef CONFIG_EXT2_FS_POSIX_ACL > [EXT2_XATTR_INDEX_POSIX_ACL_ACCESS] = &nop_posix_acl_access, > @@ -110,7 +110,7 @@ static const struct xattr_handler *ext2_xattr_handler_map[] = { > #endif > }; > > -const struct xattr_handler *ext2_xattr_handlers[] = { > +const struct xattr_handler * const ext2_xattr_handlers[] = { > &ext2_xattr_user_handler, > &ext2_xattr_trusted_handler, > #ifdef CONFIG_EXT2_FS_SECURITY > diff --git a/fs/ext2/xattr.h b/fs/ext2/xattr.h > index 7925f596e8e2..6a4966949047 100644 > --- a/fs/ext2/xattr.h > +++ b/fs/ext2/xattr.h > @@ -72,7 +72,7 @@ extern void ext2_xattr_delete_inode(struct inode *); > extern struct mb_cache *ext2_xattr_create_cache(void); > extern void ext2_xattr_destroy_cache(struct mb_cache *cache); > > -extern const struct xattr_handler *ext2_xattr_handlers[]; > +extern const struct xattr_handler * const ext2_xattr_handlers[]; > > # else /* CONFIG_EXT2_FS_XATTR */ > > -- > 2.34.1 > -- Jan Kara SUSE Labs, CR