Skip to contentSkip to conversation

tmpfs: Disallow CONFIG_TMPFS_INODE64 on s390

PATCH Applied Seth Forshee 6 participants 8 messages Feb 5, 2021 – Feb 8, 2021

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 tmpfs: Disallow CONFIG_TMPFS_INODE64 on s390

This feature requires ino_t be 64-bits, which is true for every 64-bit architecture but s390, so prevent this option from being selected there.

Fixes ea3271f7196c ("tmpfs: support 64-bit inums per-sb")
Cc <[email protected]> # v5.9+
---
 fs/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fs/Kconfig +1 -1
index aa4c12282301..3347ec7bd837 100644
@@ -203,7 +203,7 @@ config TMPFS_XATTR
 
 config TMPFS_INODE64
 	bool "Use 64-bit ino_t by default in tmpfs"
-	depends on TMPFS && 64BIT
+	depends on TMPFS && 64BIT && !S390
 	default n
 	help
 	  tmpfs has historically used only inode numbers as wide as an unsigned
Signature · 1 line
2.29.2
maintainer
#1 lore raw
Quoted 4 lines · On Fri, 5 Feb 2021 17:06:20 -0600 Seth Forshee <[email protected]>…

This feature requires ino_t be 64-bits, which is true for every 64-bit architecture but s390, so prevent this option from being selected there.

The previous patch nicely described the end-user impact of the bug. This is especially important when requesting a -stable backport.

Here's what I ended up with:

From: Seth Forshee <[email protected]>
Subject: tmpfs: disallow CONFIG_TMPFS_INODE64 on s390

Currently there is an assumption in tmpfs that 64-bit architectures also have a 64-bit ino_t. This is not true on s390 which has a 32-bit ino_t. With CONFIG_TMPFS_INODE64=y tmpfs mounts will get 64-bit inode numbers and display "inode64" in the mount options, but passing the "inode64" mount option will fail. This leads to the following behavior:

 # mkdir mnt
 # mount -t tmpfs nodev mnt
 # mount -o remount,rw mnt
 mount: /home/ubuntu/mnt: mount point not mounted or bad option.

As mount sees "inode64" in the mount options and thus passes it in the options for the remount.

So prevent CONFIG_TMPFS_INODE64 from being selected on s390.

Fixes ea3271f7196c ("tmpfs: support 64-bit inums per-sb")
Cc Chris Down <[email protected]>
Cc Hugh Dickins <[email protected]>
Cc Amir Goldstein <[email protected]>
Cc Heiko Carstens <[email protected]>
Cc Vasily Gorbik <[email protected]>
Cc Christian Borntraeger <[email protected]>
Cc <[email protected]> [5.9+]

---

 fs/Kconfig |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fs/Kconfig renamed from fs/Kconfig~tmpfs-disallow-config_tmpfs_inode64-on-s390 +1 -1
@@ -203,7 +203,7 @@ config TMPFS_XATTR
 
 config TMPFS_INODE64
 	bool "Use 64-bit ino_t by default in tmpfs"
-	depends on TMPFS && 64BIT
+	depends on TMPFS && 64BIT && !S390
 	default n
 	help
 	  tmpfs has historically used only inode numbers as wide as an unsigned

_

Acked-by
#2 lore raw
Quoted 17 lines · Andrew Morton

Currently there is an assumption in tmpfs that 64-bit architectures also have a 64-bit ino_t. This is not true on s390 which has a 32-bit ino_t. With CONFIG_TMPFS_INODE64=y tmpfs mounts will get 64-bit inode numbers and display "inode64" in the mount options, but passing the "inode64" mount option will fail. This leads to the following behavior:

# mkdir mnt
# mount -t tmpfs nodev mnt
# mount -o remount,rw mnt
mount: /home/ubuntu/mnt: mount point not mounted or bad option.

As mount sees "inode64" in the mount options and thus passes it in the options for the remount.

So prevent CONFIG_TMPFS_INODE64 from being selected on s390.

Quoted 11 lines
Fixes ea3271f7196c ("tmpfs: support 64-bit inums per-sb")
Cc Chris Down <[email protected]>
Cc Hugh Dickins <[email protected]>
Cc Amir Goldstein <[email protected]>
Cc Heiko Carstens <[email protected]>
Cc Vasily Gorbik <[email protected]>
Cc Christian Borntraeger <[email protected]>
Cc <[email protected]> [5.9+]

Either of the two ways presented looks fine to me, no real preference. Thanks!

Quoted 18 lines

---

fs/Kconfig | 2 +-

1 file changed, 1 insertion(+), 1 deletion(-)
fs/Kconfig renamed from fs/Kconfig~tmpfs-disallow-config_tmpfs_inode64-on-s390 +0 -0
@@ -203,7 +203,7 @@ config TMPFS_XATTR
 

config TMPFS_INODE64
bool "Use 64-bit ino_t by default in tmpfs"

fs/Kconfig renamed from fs/Kconfig~tmpfs-disallow-config_tmpfs_inode64-on-s390 +1 -1
-	depends on TMPFS && 64BIT
+	depends on TMPFS && 64BIT && !S390

default n
help
tmpfs has historically used only inode numbers as wide as an unsigned
_

maintainer Acked-by
#3 lore raw
In reply to Andrew Morton
Quoted 52 lines · Andrew Morton
Quoted 4 lines · On Fri, 5 Feb 2021 17:06:20 -0600 Seth Forshee <[email protected]>…

This feature requires ino_t be 64-bits, which is true for every 64-bit architecture but s390, so prevent this option from being selected there.

The previous patch nicely described the end-user impact of the bug. This is especially important when requesting a -stable backport.

Here's what I ended up with:

From: Seth Forshee <[email protected]>
Subject: tmpfs: disallow CONFIG_TMPFS_INODE64 on s390

Currently there is an assumption in tmpfs that 64-bit architectures also have a 64-bit ino_t. This is not true on s390 which has a 32-bit ino_t. With CONFIG_TMPFS_INODE64=y tmpfs mounts will get 64-bit inode numbers and display "inode64" in the mount options, but passing the "inode64" mount option will fail. This leads to the following behavior:

 # mkdir mnt
 # mount -t tmpfs nodev mnt
 # mount -o remount,rw mnt
 mount: /home/ubuntu/mnt: mount point not mounted or bad option.

As mount sees "inode64" in the mount options and thus passes it in the options for the remount.

So prevent CONFIG_TMPFS_INODE64 from being selected on s390.

Fixes ea3271f7196c ("tmpfs: support 64-bit inums per-sb")
Cc Chris Down <[email protected]>
Cc Hugh Dickins <[email protected]>
Cc Amir Goldstein <[email protected]>
Cc Heiko Carstens <[email protected]>
Cc Vasily Gorbik <[email protected]>
Cc Christian Borntraeger <[email protected]>
Cc <[email protected]> [5.9+]

---

 fs/Kconfig |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

fs/Kconfig config TMPFS_XATTR · line 206

Quoted 5 lines
fs/Kconfig renamed from fs/Kconfig~tmpfs-disallow-config_tmpfs_inode64-on-s390 +1 -1
@@ -203,7 +203,7 @@ config TMPFS_XATTR
 
 config TMPFS_INODE64
 	bool "Use 64-bit ino_t by default in tmpfs"
-	depends on TMPFS && 64BIT
+	depends on TMPFS && 64BIT && !S390

Heh, it's sort of funny that we have a similar patch, which unfortunately was/is not yet on our external features branch, which does exactly the same.

In any case:

Acked-by
#4 lore raw
In reply to Andrew Morton
Quoted 31 lines · Andrew Morton
Quoted 4 lines · On Fri, 5 Feb 2021 17:06:20 -0600 Seth Forshee <[email protected]>…

This feature requires ino_t be 64-bits, which is true for every 64-bit architecture but s390, so prevent this option from being selected there.

The previous patch nicely described the end-user impact of the bug. This is especially important when requesting a -stable backport.

Here's what I ended up with:

From: Seth Forshee <[email protected]>
Subject: tmpfs: disallow CONFIG_TMPFS_INODE64 on s390

Currently there is an assumption in tmpfs that 64-bit architectures also have a 64-bit ino_t. This is not true on s390 which has a 32-bit ino_t. With CONFIG_TMPFS_INODE64=y tmpfs mounts will get 64-bit inode numbers and display "inode64" in the mount options, but passing the "inode64" mount option will fail. This leads to the following behavior:

 # mkdir mnt
 # mount -t tmpfs nodev mnt
 # mount -o remount,rw mnt
 mount: /home/ubuntu/mnt: mount point not mounted or bad option.

As mount sees "inode64" in the mount options and thus passes it in the options for the remount.

Quoted 7 lines

So prevent CONFIG_TMPFS_INODE64 from being selected on s390.

Fixes ea3271f7196c ("tmpfs: support 64-bit inums per-sb")
Cc Chris Down <[email protected]>
Cc Hugh Dickins <[email protected]>

Thank you Seth: now that you've fixed Kirill's alpha observation too,

Quoted 25 lines
Cc Amir Goldstein <[email protected]>
Cc Heiko Carstens <[email protected]>
Cc Vasily Gorbik <[email protected]>
Cc Christian Borntraeger <[email protected]>
Cc <[email protected]> [5.9+]

---

 fs/Kconfig |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fs/Kconfig renamed from fs/Kconfig~tmpfs-disallow-config_tmpfs_inode64-on-s390 +1 -1
@@ -203,7 +203,7 @@ config TMPFS_XATTR
 
 config TMPFS_INODE64
 	bool "Use 64-bit ino_t by default in tmpfs"
-	depends on TMPFS && 64BIT
+	depends on TMPFS && 64BIT && !S390
 	default n
 	help
 	  tmpfs has historically used only inode numbers as wide as an unsigned

_

#5 lore raw
In reply to Seth Forshee
Quoted 3 lines · Seth Forshee

This feature requires ino_t be 64-bits, which is true for every 64-bit architecture but s390, so prevent this option from being selected there.

Quick grep suggests the same for alpha. Am I wrong?

Signature · 1 line
 Kirill A. Shutemov
#6 lore raw
Quoted 6 lines · Kirill A. Shutemov
Quoted 3 lines · Seth Forshee

This feature requires ino_t be 64-bits, which is true for every 64-bit architecture but s390, so prevent this option from being selected there.

Quick grep suggests the same for alpha. Am I wrong?

No, it appears you are right. Looks like my grep missed alpha somehow.

Andrew, do you prefer an additional patch or an updated version of the previous patch?

maintainer
#7 lore raw
Quoted 6 lines · On Mon, 8 Feb 2021 07:06:58 -0600 Seth Forshee <[email protected]>…
Quoted 5 lines · Kirill A. Shutemov
Quoted 3 lines · Seth Forshee

This feature requires ino_t be 64-bits, which is true for every 64-bit architecture but s390, so prevent this option from being selected there.

Quoted 6 lines
Quoted 1 line

Quick grep suggests the same for alpha. Am I wrong?

No, it appears you are right. Looks like my grep missed alpha somehow.

Andrew, do you prefer an additional patch or an updated version of the previous patch?

Doesn't matter much. A second patch for Alpha would be best, I guess. Thanks.