android_kernel_motorola_sm6225/fs/hfsplus
Ernesto A. Fernández 0b54b59d85 hfsplus: prevent btree data loss on ENOSPC
[ Upstream commit d92915c35bfaf763d78bf1d5ac7f183420e3bd99 ]

Inserting or deleting a record in a btree may require splitting several of
its nodes.  If we hit ENOSPC halfway through, the new nodes will be left
orphaned and their records will be lost.  This could mean lost inodes,
extents or xattrs.

Henceforth, check the available disk space before making any changes.
This still leaves the potential problem of corruption on ENOMEM.

The patch can be tested with xfstests generic/027.

Link: http://lkml.kernel.org/r/4596eef22fbda137b4ffa0272d92f0da15364421.1536269129.git.ernesto.mnd.fernandez@gmail.com
Signed-off-by: Ernesto A. Fernández <ernesto.mnd.fernandez@gmail.com>
Cc: Christoph Hellwig <hch@lst.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2019-12-01 09:17:08 +01:00
..
attributes.c hfsplus: prevent btree data loss on ENOSPC 2019-12-01 09:17:08 +01:00
bfind.c
bitmap.c
bnode.c
brec.c hfsplus: fix BUG on bnode parent update 2019-12-01 09:17:08 +01:00
btree.c hfsplus: prevent btree data loss on ENOSPC 2019-12-01 09:17:08 +01:00
catalog.c hfsplus: prevent btree data loss on ENOSPC 2019-12-01 09:17:08 +01:00
dir.c hfsplus: fix NULL dereference in hfsplus_lookup() 2018-08-23 18:48:42 -07:00
extents.c hfsplus: prevent btree data loss on ENOSPC 2019-12-01 09:17:08 +01:00
hfsplus_fs.h hfsplus: prevent btree data loss on ENOSPC 2019-12-01 09:17:08 +01:00
hfsplus_raw.h
inode.c hfsplus: drop ACL support 2018-08-22 10:52:50 -07:00
ioctl.c
Kconfig hfsplus: drop ACL support 2018-08-22 10:52:50 -07:00
Makefile hfsplus: drop ACL support 2018-08-22 10:52:50 -07:00
options.c
part_tbl.c
super.c hfsplus: drop ACL support 2018-08-22 10:52:50 -07:00
tables.c
unicode.c hfsplus: fix decomposition of Hangul characters 2018-08-22 10:52:50 -07:00
wrapper.c
xattr.c hfsplus: drop ACL support 2018-08-22 10:52:50 -07:00
xattr.h hfsplus: drop ACL support 2018-08-22 10:52:50 -07:00
xattr_security.c hfsplus: drop ACL support 2018-08-22 10:52:50 -07:00
xattr_trusted.c
xattr_user.c