The patch titled Subject: tmpfs: support 64-bit inums per-sb fix has been added to the -mm tree. Its filename is tmpfs-support-64-bit-inums-per-sb-fix.patch This patch should soon appear at http://ozlabs.org/~akpm/mmots/broken-out/tmpfs-support-64-bit-inums-per-sb-fix.patch and later at http://ozlabs.org/~akpm/mmotm/broken-out/tmpfs-support-64-bit-inums-per-sb-fix.patch Before you just go and hit "reply", please: a) Consider who else should be cc'ed b) Prefer to cc a suitable mailing list as well c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's *** Remember to use Documentation/process/submit-checklist.rst when testing your code *** The -mm tree is included into linux-next and is updated there every 3-4 working days ------------------------------------------------------ From: Hugh Dickins <hughd@xxxxxxxxxx> Subject: tmpfs: support 64-bit inums per-sb fix Expanded Chris's Documentation and Kconfig help on tmpfs inode64. TMPFS_INODE64 still there, still default N, but writing down its very limited limitation does make me wonder again if we want the option. Link: http://lkml.kernel.org/r/alpine.LSU.2.11.2008011928010.13320@eggly.anvils Signed-off-by: Hugh Dickins <hughd@xxxxxxxxxx> Cc: Amir Goldstein <amir73il@xxxxxxxxx> Cc: Al Viro <viro@xxxxxxxxxxxxxxxxxx> Cc: Matthew Wilcox <willy@xxxxxxxxxxxxx> Cc: Jeff Layton <jlayton@xxxxxxxxxx> Cc: Johannes Weiner <hannes@xxxxxxxxxxx> Cc: Tejun Heo <tj@xxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- Documentation/filesystems/tmpfs.rst | 13 ++++++++++--- fs/Kconfig | 16 +++++++++++----- 2 files changed, 21 insertions(+), 8 deletions(-) --- a/Documentation/filesystems/tmpfs.rst~tmpfs-support-64-bit-inums-per-sb-fix +++ a/Documentation/filesystems/tmpfs.rst @@ -153,11 +153,18 @@ parameters with chmod(1), chown(1) and c tmpfs has a mount option to select whether it will wrap at 32- or 64-bit inode numbers: +======= ======================== inode64 Use 64-bit inode numbers inode32 Use 32-bit inode numbers +======= ======================== + +On a 32-bit kernel, inode32 is implicit, and inode64 is refused at mount time. +On a 64-bit kernel, CONFIG_TMPFS_INODE64 sets the default. inode64 avoids the +possibility of multiple files with the same inode number on a single device; +but risks glibc failing with EOVERFLOW once 33-bit inode numbers are reached - +if a long-lived tmpfs is accessed by 32-bit applications so ancient that +opening a file larger than 2GiB fails with EINVAL. -On 64-bit, the default is set by CONFIG_TMPFS_INODE64. On 32-bit, inode64 is -not legal and will produce an error at mount time. So 'mount -t tmpfs -o size=10G,nr_inodes=10k,mode=700 tmpfs /mytmpfs' will give you tmpfs instance on /mytmpfs which can allocate 10GB @@ -170,5 +177,5 @@ RAM/SWAP in 10240 inodes and it is only Hugh Dickins, 4 June 2007 :Updated: KOSAKI Motohiro, 16 Mar 2010 -Updated: +:Updated: Chris Down, 13 July 2020 --- a/fs/Kconfig~tmpfs-support-64-bit-inums-per-sb-fix +++ a/fs/Kconfig @@ -207,12 +207,18 @@ config TMPFS_INODE64 default n help tmpfs has historically used only inode numbers as wide as an unsigned - int. In some cases this can cause wraparound, potentially resulting in - multiple files with the same inode number on a single device. This option - makes tmpfs use the full width of ino_t by default, similarly to the - inode64 mount option. + int. In some cases this can cause wraparound, potentially resulting + in multiple files with the same inode number on a single device. This + option makes tmpfs use the full width of ino_t by default, without + needing to specify the inode64 option when mounting. - To override this default, use the inode32 or inode64 mount options. + But if a long-lived tmpfs is to be accessed by 32-bit applications so + ancient that opening a file larger than 2GiB fails with EINVAL, then + the INODE64 config option and inode64 mount option risk operations + failing with EOVERFLOW once 33-bit inode numbers are reached. + + To override this configured default, use the inode32 or inode64 + option when mounting. If unsure, say N. _ Patches currently in -mm which might be from hughd@xxxxxxxxxx are tmpfs-support-64-bit-inums-per-sb-fix.patch mm-memcontrol-decouple-reference-counting-from-page-accounting-fix.patch khugepaged-collapse_pte_mapped_thp-flush-the-right-range.patch khugepaged-collapse_pte_mapped_thp-protect-the-pmd-lock.patch khugepaged-retract_page_tables-remember-to-test-exit.patch khugepaged-khugepaged_test_exit-check-mmget_still_valid.patch