]> git.baikalelectronics.ru Git - kernel.git/commit
tmpfs: restore functionality of nr_inodes=0
authorByron Stanoszek <gandalf@winds.org>
Sat, 19 Sep 2020 04:20:18 +0000 (21:20 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Sat, 19 Sep 2020 20:13:38 +0000 (13:13 -0700)
commit71acf8c0e4afff50f4d730444313ce30e9bd945e
treeacdc903969e1ae6165a9356debfb40a0dcf08c79
parenta88331b56a3e5b278c30cce6b3859214f548e938
tmpfs: restore functionality of nr_inodes=0

Commit 0db15f5f27b0 ("tmpfs: per-superblock i_ino support") made changes
to shmem_reserve_inode() in mm/shmem.c, however the original test for
(sbinfo->max_inodes) got dropped.  This causes mounting tmpfs with option
nr_inodes=0 to fail:

  # mount -ttmpfs -onr_inodes=0 none /ext0
  mount: /ext0: mount(2) system call failed: Cannot allocate memory.

This patch restores the nr_inodes=0 functionality.

Fixes: 0db15f5f27b0 ("tmpfs: per-superblock i_ino support")
Signed-off-by: Byron Stanoszek <gandalf@winds.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Acked-by: Hugh Dickins <hughd@google.com>
Acked-by: Chris Down <chris@chrisdown.name>
Link: https://lkml.kernel.org/r/20200902035715.16414-1-gandalf@winds.org
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
mm/shmem.c