All of lore.kernel.org
 help / color / mirror / Atom feed
* [OE-core][PATCH 0/1] wic: warn on usage of Y2038 affected file systems
@ 2021-02-18 13:06 florian.bezdeka
  2021-02-18 13:06 ` [OE-core][PATCH 1/1] wic: Warn if an ext filesystem affected by the Y2038 problem is used florian.bezdeka
  2021-02-19 10:55 ` [OE-core][PATCH 0/1] wic: warn on usage of Y2038 affected file systems Richard Purdie
  0 siblings, 2 replies; 11+ messages in thread
From: florian.bezdeka @ 2021-02-18 13:06 UTC (permalink / raw)
  To: openembedded-core; +Cc: florian.bezdeka

From: Florian Bezdeka <florian.bezdeka@siemens.com>

The following patch 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)

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.

Some words to the other filesystems supported by wic:
 - ext2 and ext3 will overflow in 2038, 
   The user will be warned as well
 - squashfs will overflow in 2106
 - btrfs uses u64 for time representations, so Y2038 safe

Florian Bezdeka (1):
  wic: Warn if an ext filesystem affected by the Y2038 problem is used

 scripts/lib/wic/misc.py      |  1 +
 scripts/lib/wic/partition.py | 38 ++++++++++++++++++++++++++++++++++++
 2 files changed, 39 insertions(+)

-- 
2.29.2

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2021-02-25  8:22 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-18 13:06 [OE-core][PATCH 0/1] wic: warn on usage of Y2038 affected file systems florian.bezdeka
2021-02-18 13:06 ` [OE-core][PATCH 1/1] wic: Warn if an ext filesystem affected by the Y2038 problem is used florian.bezdeka
2021-02-19 10:55 ` [OE-core][PATCH 0/1] wic: warn on usage of Y2038 affected file systems Richard Purdie
2021-02-19 11:19   ` florian.bezdeka
2021-02-19 11:36     ` Richard Purdie
2021-02-22 11:42       ` [OE-core][PATCH v2] wic: Warn if an ext filesystem affected by the Y2038 problem is used florian.bezdeka
2021-02-22 15:59         ` Richard Purdie
2021-02-22 16:31           ` florian.bezdeka
2021-02-23 15:30           ` [OE-core][PATCH v3] " florian.bezdeka
2021-02-24 16:54             ` Richard Purdie
2021-02-25  8:22               ` [OE-core][PATCH v4] " florian.bezdeka

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.