Skip to contentSkip to conversation

ext2: mark as deprecated

PATCH In review [email protected] 2 participants 2 messages Feb 22, 2024 ext2 file system

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ext2: mark as deprecated

From: Michael Opdenacker <[email protected]>

Add a DEPRECATED keyword to the kernel parameter description, to warn users that this filesystem doesn't support dates beyond 2038.

---
 fs/ext2/Kconfig | 22 ++++++++++++++++++----
 1 file changed, 18 insertions(+), 4 deletions(-)
fs/ext2/Kconfig +18 -4
index 74d98965902e..49e4660ae436 100644
@@ -1,16 +1,30 @@
 # SPDX-License-Identifier: GPL-2.0-only
 config EXT2_FS
-	tristate "Second extended fs support"
+	tristate "Second extended fs support (DEPRECATED)"
 	select BUFFER_HEAD
 	select FS_IOMAP
 	select LEGACY_DIRECT_IO
 	help
 	  Ext2 is a standard Linux file system for hard disks.
 
-	  To compile this file system support as a module, choose M here: the
-	  module will be called ext2.
+	  It is deprecated because even if the filesystem is created with
+	  256 byte inodes (mkfs.ext2 -I 256), the filesystem driver will stick
+	  to 32 bit dates. Because of this, this filesystem does not support
+	  dates beyond 03:14:07 UTC on 19 January 2038.
 
-	  If unsure, say Y.
+	  Ext2 users are advised to migrate their partitions to ext4:
+
+	  $ tune2fs -O extents,uninit_bg,dir_index,has_journal /dev/sda1
+	  $ e2fsck -pf /dev/sda1
+
+	  Ext4 is also a working solution for very small partitions
+	  as it can be created without a journal:
+
+	  $ mkfs.ext4 -O ^has_journal /dev/sda1
+
+	  This code is kept as a simple reference for filesystem developers.
+
+	  If unsure, say N.
 
 config EXT2_FS_XATTR
 	bool "Ext2 extended attributes"
Signature · 1 line
2.34.1
#1 lore raw
Quoted 6 lines · On Thu 22-02-24 10:50:01, [email protected] wrote:

From: Michael Opdenacker <[email protected]>

Add a DEPRECATED keyword to the kernel parameter description, to warn users that this filesystem doesn't support dates beyond 2038.

Thanks! I've modified the help text to:

Ext2 is a standard Linux file system for hard disks.

This filesystem driver is deprecated because it does not properly support inode time stamps beyond 03:14:07 UTC on 19 January 2038.

Ext2 users are advised to use ext4 driver to access their filesystem. The driver is fully compatible, supports filesystems without journal or extents, and also supports larger time stamps if the filesystem is created with at least 256 byte inodes.

This code is kept as a simple reference for filesystem developers.

If unsure, say N.

and added it to my tree.

Honza

Quoted 46 lines
---
 fs/ext2/Kconfig | 22 ++++++++++++++++++----
 1 file changed, 18 insertions(+), 4 deletions(-)
fs/ext2/Kconfig +18 -4
index 74d98965902e..49e4660ae436 100644
@@ -1,16 +1,30 @@
 # SPDX-License-Identifier: GPL-2.0-only
 config EXT2_FS
-	tristate "Second extended fs support"
+	tristate "Second extended fs support (DEPRECATED)"
 	select BUFFER_HEAD
 	select FS_IOMAP
 	select LEGACY_DIRECT_IO
 	help
 	  Ext2 is a standard Linux file system for hard disks.
 
-	  To compile this file system support as a module, choose M here: the
-	  module will be called ext2.
+	  It is deprecated because even if the filesystem is created with
+	  256 byte inodes (mkfs.ext2 -I 256), the filesystem driver will stick
+	  to 32 bit dates. Because of this, this filesystem does not support
+	  dates beyond 03:14:07 UTC on 19 January 2038.
 
-	  If unsure, say Y.
+	  Ext2 users are advised to migrate their partitions to ext4:
+
+	  $ tune2fs -O extents,uninit_bg,dir_index,has_journal /dev/sda1
+	  $ e2fsck -pf /dev/sda1
+
+	  Ext4 is also a working solution for very small partitions
+	  as it can be created without a journal:
+
+	  $ mkfs.ext4 -O ^has_journal /dev/sda1
+
+	  This code is kept as a simple reference for filesystem developers.
+
+	  If unsure, say N.
 
 config EXT2_FS_XATTR
 	bool "Ext2 extended attributes"
Signature · 1 line
2.34.1
Signature · 2 lines
Jan Kara <[email protected]>
SUSE Labs, CR