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 X-Spam-Level: X-Spam-Status: No, score=-10.0 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2DEC4C43461 for ; Fri, 4 Sep 2020 08:23:52 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id EDEB92074D for ; Fri, 4 Sep 2020 08:23:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729822AbgIDIXv convert rfc822-to-8bit (ORCPT ); Fri, 4 Sep 2020 04:23:51 -0400 Received: from relay2-d.mail.gandi.net ([217.70.183.194]:59643 "EHLO relay2-d.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729731AbgIDIXr (ORCPT ); Fri, 4 Sep 2020 04:23:47 -0400 X-Originating-IP: 90.76.143.236 Received: from localhost (lfbn-tou-1-1075-236.w90-76.abo.wanadoo.fr [90.76.143.236]) (Authenticated sender: antoine.tenart@bootlin.com) by relay2-d.mail.gandi.net (Postfix) with ESMTPSA id E0ECA40015; Fri, 4 Sep 2020 08:23:44 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8BIT In-Reply-To: <159609406998.3391.5621985067917886015@kwain> References: <20200717100846.497546-1-antoine.tenart@bootlin.com> <159609406998.3391.5621985067917886015@kwain> Subject: Re: [PATCH v2] create_inode: set xattrs to the root directory as well To: Andreas Dilger , tytso@mit.edu Cc: Ext4 Developers List , matthew.weber@rockwellcollins.com, thomas.petazzoni@bootlin.com From: Antoine Tenart Message-ID: <159920782384.787733.9857416604675445355@kwain> Date: Fri, 04 Sep 2020 10:23:43 +0200 Sender: linux-ext4-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org Hello, Quoting Antoine Tenart (2020-07-30 09:27:50) > > Gentle ping. What's the status of this patch? Do anyone know if anything else is required to get this merged? Thanks! Antoine > Quoting Andreas Dilger (2020-07-17 13:17:08) > > > > > On Jul 17, 2020, at 4:08 AM, Antoine Tenart wrote: > > > > > > populate_fs do copy the xattrs for all files and directories, but the > > > root directory is skipped and as a result its extended attributes aren't > > > set. This is an issue when using mkfs to build a full system image that > > > can be used with SElinux in enforcing mode without making any runtime > > > fix at first boot. > > > > > > This patch adds logic to set the root directory's extended attributes. > > > > > > Signed-off-by: Antoine Tenart > > > > Reviewed-by: Andreas Dilger > > > > > --- > > > > > > Since v1: > > > - Moved the set_inode_xattr logic for the root directory > > > from __populate_fs to populate_fs2. > > > > > > misc/create_inode.c | 8 ++++++++ > > > 1 file changed, 8 insertions(+) > > > > > > diff --git a/misc/create_inode.c b/misc/create_inode.c > > > index e8d1df6b55a5..fe66faf1b53d 100644 > > > --- a/misc/create_inode.c > > > +++ b/misc/create_inode.c > > > @@ -1050,9 +1050,17 @@ errcode_t populate_fs2(ext2_filsys fs, ext2_ino_t parent_ino, > > > file_info.path_max_len = 255; > > > file_info.path = calloc(file_info.path_max_len, 1); > > > > > > + retval = set_inode_xattr(fs, root, source_dir); > > > + if (retval) { > > > + com_err(__func__, retval, > > > + _("while copying xattrs on root directory")); > > > + goto out; > > > + } > > > + > > > retval = __populate_fs(fs, parent_ino, source_dir, root, &hdlinks, > > > &file_info, fs_callbacks); > > > > > > +out: > > > free(file_info.path); > > > free(hdlinks.hdl); > > > return retval; > > > -- > > > 2.26.2 > > > > > > > > > Cheers, Andreas > > > > > > > > > > > > -- > Antoine Ténart, Bootlin > Embedded Linux and Kernel engineering > https://bootlin.com -- Antoine Ténart, Bootlin Embedded Linux and Kernel engineering https://bootlin.com