linux/fs
Josef Bacik 802a8369d2 btrfs: handle logged extent failure properly
commit bd727173e4 upstream.

If we're allocating a logged extent we attempt to insert an extent
record for the file extent directly.  We increase
space_info->bytes_reserved, because the extent entry addition will call
btrfs_update_block_group(), which will convert the ->bytes_reserved to
->bytes_used.  However if we fail at any point while inserting the
extent entry we will bail and leave space on ->bytes_reserved, which
will trigger a WARN_ON() on umount.  Fix this by pinning the space if we
fail to insert, which is what happens in every other failure case that
involves adding the extent entry.

CC: stable@vger.kernel.org # 5.4+
Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
Reviewed-by: Nikolay Borisov <nborisov@suse.com>
Reviewed-by: Qu Wenruo <wqu@suse.com>
Signed-off-by: Josef Bacik <josef@toxicpanda.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-02-28 17:22:13 +01:00
..
9p
adfs
affs
afs
autofs
befs
bfs
btrfs btrfs: handle logged extent failure properly 2020-02-28 17:22:13 +01:00
cachefiles
ceph ceph: check availability of mds cluster on mount after wait timeout 2020-02-24 08:36:59 +01:00
cifs cifs: log warning message (once) if out of disk space 2020-02-24 08:37:03 +01:00
coda
configfs
cramfs
crypto fscrypt: don't print name of busy file when removing key 2020-02-11 04:35:20 -08:00
debugfs
devpts
dlm
ecryptfs ecryptfs: fix a memory leak bug in ecryptfs_init_messaging() 2020-02-28 17:22:13 +01:00
efivarfs
efs
erofs erofs: fix out-of-bound read for shifted uncompressed block 2020-02-11 04:35:23 -08:00
exportfs
ext2 ext2: Adjust indentation in ext2_fill_super 2020-02-11 04:35:45 -08:00
ext4 ext4: fix deadlock allocating bio_post_read_ctx from mempool 2020-02-24 08:36:29 +01:00
f2fs f2fs: fix memleak of kobject 2020-02-24 08:36:53 +01:00
fat
freevxfs
fscache
fuse fuse: don't overflow LLONG_MAX with end offset 2020-02-24 08:37:03 +01:00
gfs2 gfs2: fix O_SYNC write handling 2020-02-11 04:35:35 -08:00
hfs
hfsplus
hostfs
hpfs
hugetlbfs
iomap
isofs
jbd2 jbd2: make sure ESHUTDOWN to be recorded in the journal superblock 2020-02-24 08:36:57 +01:00
jffs2
jfs
kernfs
lockd
minix
nfs NFS: Fix memory leaks 2020-02-24 08:37:02 +01:00
nfs_common
nfsd nfsd: Clone should commit src file metadata too 2020-02-24 08:36:38 +01:00
nilfs2
nls
notify
ntfs
ocfs2 ocfs2: fix a NULL pointer dereference when call ocfs2_update_inode_fsync_trans() 2020-02-24 08:37:00 +01:00
omfs
openpromfs Merge branch 'work.mount0' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs 2019-07-19 10:42:02 -07:00
orangefs help_next should increase position index 2020-02-24 08:37:02 +01:00
overlayfs ovl: fix lseek overflow on 32bit 2020-02-11 04:35:24 -08:00
proc
pstore
qnx4
qnx6
quota
ramfs
reiserfs reiserfs: prevent NULL pointer dereference in reiserfs_insert_item() 2020-02-24 08:37:00 +01:00
romfs
squashfs
sysfs
sysv
tracefs
ubifs ubifs: Fix memory leak from c->sup_node 2020-02-11 04:35:48 -08:00
udf udf: Fix free space reporting for metadata and virtual partitions 2020-02-24 08:36:44 +01:00
ufs
unicode
verity
xfs
aio.c aio: prevent potential eventfd recursion on poll 2020-02-11 04:35:37 -08:00
anon_inodes.c
attr.c
bad_inode.c
binfmt_aout.c
binfmt_elf_fdpic.c
binfmt_elf.c
binfmt_em86.c
binfmt_flat.c
binfmt_misc.c
binfmt_script.c
block_dev.c
buffer.c
char_dev.c
compat_binfmt_elf.c
compat_ioctl.c
compat.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
coredump.c
d_path.c
dax.c
dcache.c
dcookies.c
direct-io.c
drop_caches.c
eventfd.c eventfd: track eventfd_signal() recursion depth 2020-02-11 04:35:37 -08:00
eventpoll.c
exec.c
fcntl.c
fhandle.c
file_table.c
file.c
filesystems.c
fs_context.c
fs_parser.c
fs_pin.c
fs_struct.c
fs_types.c
fs-writeback.c
fsopen.c
inode.c
internal.h
io_uring.c
ioctl.c
Kconfig
Kconfig.binfmt
libfs.c
locks.c
Makefile
mbcache.c
mount.h
mpage.c
namei.c
namespace.c
no-block.c
nsfs.c
open.c
pipe.c
pnode.c
pnode.h
posix_acl.c
proc_namespace.c
read_write.c fs: allow deduplication of eof block into the end of the destination file 2020-02-11 04:35:23 -08:00
readdir.c
select.c
seq_file.c
signalfd.c
splice.c
stack.c
stat.c
statfs.c
super.c
sync.c
timerfd.c
userfaultfd.c
utimes.c
xattr.c treewide: Add SPDX license identifier for missed files 2019-05-21 10:50:45 +02:00