From mboxrd@z Thu Jan 1 00:00:00 1970 X-GM-THRID: 6924371667242188800 X-Received: by 2002:a05:6402:d09:: with SMTP id eb9mr7190898edb.285.1613030880023; Thu, 11 Feb 2021 00:08:00 -0800 (PST) X-BeenThere: isar-users@googlegroups.com Received: by 2002:a17:907:104b:: with SMTP id oy11ls2414517ejb.6.gmail; Thu, 11 Feb 2021 00:07:59 -0800 (PST) X-Google-Smtp-Source: ABdhPJyTlgTs6QFaQQILh4JBLTe8qMWKvqEjiiLMKLDNh7++PI4sY4oVpH9XizuCk3lHF94ChuTW X-Received: by 2002:a17:906:69c2:: with SMTP id g2mr6961398ejs.249.1613030879162; Thu, 11 Feb 2021 00:07:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1613030879; cv=none; d=google.com; s=arc-20160816; b=nW60TpfYCbRko51yfTx1ZjkbnvqVvgEZn9sDo+4r6eg+C+wTKDGQM44RT6GGZ8w5sS gwT0cnpFuu9yn+tYJ9Xqryt4K/IojaDaSM7LKKp4sytn29m0x4JcxFJ2WI4WFw1xPbqs PEOM1k2WvayIw6uye0GoL2a1QZAzAqS2/ctNT3Sr+4eUAlmeaJoWTn/Pwy0Fv211f32r VNNF1eCPys7CTC3ZAsdsy1UAPEjZn9rw8mHqjR1p5EDAMCl/1IUFxTdASDCuiLJkdF1K JtQzhjHCpPybGV4st8n6DXHSQcgZdwrnpVRvrU12HGe8z8+EVbqhpSy7/Tss6F1QYogq ys7Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-language:content-transfer-encoding:in-reply-to:mime-version :user-agent:date:message-id:from:references:cc:to:subject; bh=n0Bf0mO+d4qkZ4bn2EXQbCxuvO22qN3JpFDb3XjV4LE=; b=IswcU4IVjxxizrXJHoZRy3SAQM3KtNKchNnvH2tfld80FffAe9/I5c++ypYkE/4aLP nonxsNZE4CntvFHIXIRsE5FczPW4NMi7WT6Lnnkt+aWcB58/sAImRXjL0wexyTB377vr v5bZPIZUHQ2XbshZEDGldN3h3KGjSWZD00Kos9qf0IgGZrXpuBz5l3SurJ4j+25qpnb8 VVPhaGML3foyrPGr2Ow91fi3FULej+xh3lFjEldW6ztTLRIaWcyLt4EwZEsu4yNL9iI8 jv3djyo5jnAlWmIpn4HQvCDkDWzrNaqATCZ7fmgHqt7ukfdrOhOouDCQU8VrsjKI5OVD hyVg== ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=pass (google.com: domain of amikan@ilbers.de designates 85.214.156.166 as permitted sender) smtp.mailfrom=amikan@ilbers.de Return-Path: Received: from shymkent.ilbers.de (shymkent.ilbers.de. [85.214.156.166]) by gmr-mx.google.com with ESMTPS id jz19si345320ejb.0.2021.02.11.00.07.59 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 11 Feb 2021 00:07:59 -0800 (PST) Received-SPF: pass (google.com: domain of amikan@ilbers.de designates 85.214.156.166 as permitted sender) client-ip=85.214.156.166; Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of amikan@ilbers.de designates 85.214.156.166 as permitted sender) smtp.mailfrom=amikan@ilbers.de Received: from [192.168.67.164] (mm-203-30-214-37.mgts.dynamic.pppoe.byfly.by [37.214.30.203] (may be forged)) (authenticated bits=0) by shymkent.ilbers.de (8.15.2/8.15.2/Debian-8) with ESMTPSA id 11B87v0w016147 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 11 Feb 2021 09:07:58 +0100 Subject: Re: [RFC PATCH 0/2] wic: warn on usage of Y2038 affected file systems To: "florian.bezdeka@siemens.com" , "isar-users@googlegroups.com" Cc: "henning.schild@siemens.com" , "quirin.gylstorff@siemens.com" , "jan.kiszka@siemens.com" References: <20210201185815.382326-1-florian.bezdeka@siemens.com> From: Anton Mikanovich Message-ID: <491c833c-c35c-d130-e8e6-f31aee4204aa@ilbers.de> Date: Thu, 11 Feb 2021 11:07:52 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.5.0 MIME-Version: 1.0 In-Reply-To: <20210201185815.382326-1-florian.bezdeka@siemens.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED autolearn=unavailable autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on shymkent.ilbers.de X-TUID: USoEMizWMzJn 01.02.2021 21:58, florian.bezdeka@siemens.com wrote: > From: Florian Bezdeka > > Hi ISAR developers, > > this series is the summary of a nice journey through the file system > jungle regarding Y2038 problem. It all began with a warning which is > reported by kernels >= 5.4: > > ext4 filesystem being mounted at (mountpoint) supports timestamps until > 2038 (0x7fffffff) > > I guess that most ISAR layers are using the Debian kernels, so that > warning was not recognized yet or at least not very often. > > When reading this warning I was surprised. Shouldn't a modern file > system like ext4 be Y2038-safe? As it turned out it depends on the > inode size if an ext4 file system is safe or not. So why was the > inode size not sufficient in my case? > > The inode size is chosen during file system generation and depends on > the size of the file system that is going to be created. For details > let's have a look at `man mke2fs`: > > -T usage-type[,...] > Specify how the filesystem is going to be used, so that mke2fs can > choose optimal filesystem parameters for that use. The usage types > that are supported are defined in the configuration file > /etc/mke2fs.conf. The user may specify one or more usage types > using a comma separated list. > > If this option is is not specified, mke2fs will pick a single > default usage type based on the size of the filesystem to be > created. If the filesystem size is less than 3 megabytes, mke2fs > will use the filesystem type floppy. If the filesystem size is > greater than or equal to 3 but less than 512 megabytes, mke2fs(8) > will use the filesystem type small. > > The relevant parts from /etc/mke2fs.conf: > [fs_types] > ... > small = { > blocksize = 1024 > inode_size = 128 > inode_ratio = 4096 > } > ... > > So whenever you create an ext4 file system with less than 512MB in > size you will end up with 128 byte inodes and your file system is > not Y2038-safe. > > The ISAR part: > ext4 may often be used in combination with the expand-on-first-boot > recipe / feature. So whenever creating a small partition (e.g. inside > a wic file) and extending it later may result in a Y2038 affected ext4 > file system. > > That is exactly what happened to me and I would like to make sure that > all other ISAR users are aware of this situation. > > Valid workarounds found so far: > - Tell wic that an partition will grow: > Add `--mkfs-extraopts "-T ext4"` to your wic partition definition > - Set the inode size to 256 (for small ext4 partitions) > Add `--mkfs-extraopts "-I 256"` to your wic partition definition > > The upstream part: > None of the following patches has been sent to any upstream (OE) > mailing lists yet but hopefully that will happen soon. So far: Any > comments welcome! > > Best regards, > Florian > > Florian Bezdeka (2): > wic-img: Forward warnings from wic to bitbake > wic: Warn if an ext filesystem affected by the Y2038 problem is used > > meta/classes/wic-img.bbclass | 20 ++++++++++++++----- > scripts/lib/wic/partition.py | 38 ++++++++++++++++++++++++++++++++++++ > 2 files changed, 53 insertions(+), 5 deletions(-) > Applied to next, thanks. -- Anton Mikanovich Promwad Ltd. External service provider of ilbers GmbH Maria-Merian-Str. 8 85521 Ottobrunn, Germany +49 (89) 122 67 24-0 Commercial register Munich, HRB 214197 General Manager: Baurzhan Ismagulov