linux-uconsole/fs/ext4
Theodore Ts'o 5bad8861ed UPSTREAM: ext4: fix check to prevent initializing reserved inodes
commit 5012284700 upstream.

Commit 8844618d8a: "ext4: only look at the bg_flags field if it is
valid" will complain if block group zero does not have the
EXT4_BG_INODE_ZEROED flag set.  Unfortunately, this is not correct,
since a freshly created file system has this flag cleared.  It gets
almost immediately after the file system is mounted read-write --- but
the following somewhat unlikely sequence will end up triggering a
false positive report of a corrupted file system:

   mkfs.ext4 /dev/vdc
   mount -o ro /dev/vdc /vdc
   mount -o remount,rw /dev/vdc

Instead, when initializing the inode table for block group zero, test
to make sure that itable_unused count is not too large, since that is
the case that will result in some or all of the reserved inodes
getting cleared.

This fixes the failures reported by Eric Whiteney when running
generic/230 and generic/231 in the the nojournal test case.

Change-Id: I799bfafa4712e2dd29268c7481b539b23e2cf475
Fixes: 8844618d8a ("ext4: only look at the bg_flags field if it is valid")
Reported-by: Eric Whitney <enwlinux@gmail.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Tao Huang <huangtao@rock-chips.com>
(cherry picked from commit 7736fcede7)
2018-08-17 10:34:02 +08:00
..
acl.c ext4: Don't clear SGID when inheriting ACLs 2017-10-12 11:27:35 +02:00
acl.h
balloc.c ext4: only look at the bg_flags field if it is valid 2018-07-11 16:03:48 +02:00
bitmap.c
block_validity.c
crypto.c BACKPORT, FROMLIST: fscrypt: add Speck128/256 support 2018-06-11 15:59:44 +05:30
crypto_fname.c BACKPORT, FROMLIST: fscrypt: add Speck128/256 support 2018-06-11 15:59:44 +05:30
crypto_key.c BACKPORT, FROMLIST: fscrypt: add Speck128/256 support 2018-06-11 15:59:44 +05:30
crypto_policy.c BACKPORT, FROMLIST: fscrypt: add Speck128/256 support 2018-06-11 15:59:44 +05:30
dir.c ext4 crypto: revalidate dentry after adding or removing the key 2017-05-08 07:46:02 +02:00
ext4.h Merge branch 'linux-linaro-lsk-v4.4' into linux-linaro-lsk-v4.4-android 2018-07-13 13:22:34 +01:00
ext4_crypto.h BACKPORT, FROMLIST: fscrypt: add Speck128/256 support 2018-06-11 15:59:44 +05:30
ext4_extents.h ext4: verify the depth of extent tree in ext4_find_extent() 2018-07-11 16:03:48 +02:00
ext4_jbd2.c
ext4_jbd2.h ext4: do not perform data journaling when data is encrypted 2017-01-06 11:16:13 +01:00
extents.c ext4: verify the depth of extent tree in ext4_find_extent() 2018-07-11 16:03:48 +02:00
extents_status.c
extents_status.h
file.c ext4: fix off-by-one on max nr_pages in ext4_find_unwritten_pgoff() 2018-04-13 19:50:11 +02:00
fsync.c
hash.c
ialloc.c UPSTREAM: ext4: fix check to prevent initializing reserved inodes 2018-08-17 10:34:02 +08:00
indirect.c
inline.c Merge branch 'linux-linaro-lsk-v4.4' into linux-linaro-lsk-v4.4-android 2018-07-13 13:22:34 +01:00
inode.c Merge branch 'linux-linaro-lsk-v4.4' into linux-linaro-lsk-v4.4-android 2018-07-13 13:22:34 +01:00
ioctl.c Revert "ext4: require encryption feature for EXT4_IOC_SET_ENCRYPTION_POLICY" 2017-06-21 16:34:04 +05:30
Kconfig ANDROID: ext4: allow encrypting filenames using HEH algorithm 2017-04-10 13:12:16 +05:30
Makefile
mballoc.c Merge branch 'linux-linaro-lsk-v4.4' into linux-linaro-lsk-v4.4-android 2018-07-13 13:22:34 +01:00
mballoc.h
migrate.c
mmp.c
move_extent.c fs: add i_blocksize() 2017-06-14 13:16:24 +02:00
namei.c do d_instantiate/unlock_new_inode combinations safely 2018-05-30 07:48:52 +02:00
page-io.c ext4 crypto: fix some error handling 2017-05-25 14:30:11 +02:00
readpage.c Merge branch 'linux-linaro-lsk-v4.4' into linux-linaro-lsk-v4.4-android 2017-05-26 12:03:29 +08:00
resize.c ext4: fix fencepost error in check for inode count overflow during resize 2018-07-03 11:21:25 +02:00
super.c UPSTREAM: ext4: fix check to prevent initializing reserved inodes 2018-08-17 10:34:02 +08:00
symlink.c don't put symlink bodies in pagecache into highmem 2018-02-16 20:09:38 +01:00
sysfs.c ext4: check return value of kstrtoull correctly in reserved_clusters_store 2017-07-15 11:57:50 +02:00
truncate.h ext4: fix races between page faults and hole punching 2016-05-04 14:48:53 -07:00
xattr.c Merge branch 'linux-linaro-lsk-v4.4' into linux-linaro-lsk-v4.4-android 2018-05-20 13:36:03 +05:30
xattr.h Merge branch 'linux-linaro-lsk-v4.4' into linux-linaro-lsk-v4.4-android 2018-05-20 13:36:03 +05:30
xattr_security.c
xattr_trusted.c
xattr_user.c