android_kernel_samsung_msm8976/fs/ext4
Vegard Nossum 22b8207fa3 ext4: fix reference counting bug on block allocation error
commit 554a5ccc4e4a20c5f3ec859de0842db4b4b9c77e upstream.

If we hit this error when mounted with errors=continue or
errors=remount-ro:

    EXT4-fs error (device loop0): ext4_mb_mark_diskspace_used:2940: comm ext4.exe: Allocating blocks 5090-6081 which overlap fs metadata

then ext4_mb_new_blocks() will call ext4_mb_release_context() and try to
continue. However, ext4_mb_release_context() is the wrong thing to call
here since we are still actually using the allocation context.

Instead, just error out. We could retry the allocation, but there is a
possibility of getting stuck in an infinite loop instead, so this seems
safer.

[ Fixed up so we don't return EAGAIN to userspace. --tytso ]

Fixes: 8556e8f3b6 ("ext4: Don't allow new groups to be added during block allocation")
Signed-off-by: Vegard Nossum <vegard.nossum@oracle.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Cc: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
Cc: stable@vger.kernel.org
[wt: 3.10 doesn't have EFSCORRUPTED, but XFS uses EUCLEAN as does 3.14
     on this patch so use this instead]

Signed-off-by: Willy Tarreau <w@1wt.eu>
2019-07-27 21:41:52 +02:00
..
acl.c posix_acl: Clear SGID bit when setting file permissions 2017-04-28 00:00:11 -07:00
acl.h
balloc.c Import latest Samsung release 2017-04-18 03:43:52 +02:00
bitmap.c
block_validity.c Import latest Samsung release 2017-04-18 03:43:52 +02:00
dir.c Import latest Samsung release 2017-04-18 03:43:52 +02:00
ext4.h fs: Remove Samsung implementation of sdcardfs 2018-02-06 13:12:17 +01:00
ext4_extents.h
ext4_jbd2.c Import latest Samsung release 2017-04-18 03:43:52 +02:00
ext4_jbd2.h
extents.c ext4: check for extents that wrap around 2019-07-27 21:41:51 +02:00
extents_status.c ext4: fix data corruption caused by unwritten and delayed extents 2015-05-13 05:15:42 -07:00
extents_status.h
file.c ext4: prevent bugon on race between write/fcntl 2015-02-11 14:48:17 +08:00
fsync.c
hash.c
ialloc.c ext4: fix hang when processing corrupted orphaned inode list 2019-07-27 21:41:49 +02:00
indirect.c ext4: don't retry file block mapping on bigalloc fs with non-extent file 2015-08-03 09:29:43 -07:00
inline.c fs: Remove Samsung implementation of sdcardfs 2018-02-06 13:12:17 +01:00
inode.c ext4: don't call ext4_should_journal_data() on the journal inode 2019-07-27 21:41:51 +02:00
ioctl.c Import latest Samsung release 2017-04-18 03:43:52 +02:00
Kconfig
Makefile Import latest Samsung release 2017-04-18 03:43:52 +02:00
mballoc.c ext4: fix reference counting bug on block allocation error 2019-07-27 21:41:52 +02:00
mballoc.h
migrate.c ext4: correctly migrate a file with a hole at the beginning 2015-08-03 09:29:43 -07:00
mmp.c
move_extent.c ext4: add lockdep annotations for i_data_sem 2016-06-07 10:42:50 +02:00
namei.c ext[34]: fix double put in tmpfile 2018-12-03 11:52:41 +01:00
page-io.c ext4: fix zeroing of page during writeback 2014-06-30 20:09:42 -07:00
resize.c This is the 3.10.98 stable release 2017-04-18 17:17:24 +02:00
super.c ext4: short-cut orphan cleanup on error 2019-07-27 21:41:51 +02:00
symlink.c
truncate.h
xattr.c ext4: check EA value offset when loading 2014-11-14 08:47:57 -08:00
xattr.h
xattr_security.c
xattr_trusted.c
xattr_user.c