linux/fs
Xiubo Li 35b092d3b5 ceph: put the requests/sessions when it fails to alloc memory
[ Upstream commit 89d43d0551 ]

When failing to allocate the sessions memory we should make sure
the req1 and req2 and the sessions get put. And also in case the
max_sessions decreased so when kreallocate the new memory some
sessions maybe missed being put.

And if the max_sessions is 0 krealloc will return ZERO_SIZE_PTR,
which will lead to a distinct access fault.

URL: https://tracker.ceph.com/issues/53819
Fixes: e1a4541ec0 ("ceph: flush the mdlog before waiting on unsafe reqs")
Signed-off-by: Xiubo Li <xiubli@redhat.com>
Reviewed-by: Venky Shankar <vshankar@redhat.com>
Reviewed-by: Jeff Layton <jlayton@kernel.org>
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2022-02-01 17:27:14 +01:00
..
9p 9p: only copy valid iattrs in 9P2000.L setattr implementation 2022-01-20 09:13:14 +01:00
adfs
affs
afs
autofs
befs
bfs
btrfs btrfs: respect the max size in the header when activating swap file 2022-01-27 11:05:15 +01:00
cachefiles
ceph ceph: put the requests/sessions when it fails to alloc memory 2022-02-01 17:27:14 +01:00
cifs cifs: sanitize multiple delimiters in prepath 2021-12-22 09:32:48 +01:00
coda
configfs fsnotify: fix fsnotify hooks in pseudo filesystems 2022-02-01 17:27:01 +01:00
cramfs
crypto
debugfs debugfs: lockdown: Allow reading debugfs files that are not world readable 2022-01-27 11:03:55 +01:00
devpts fsnotify: fix fsnotify hooks in pseudo filesystems 2022-02-01 17:27:01 +01:00
dlm fs: dlm: filter user dlm messages for kernel locks 2022-01-27 11:04:23 +01:00
ecryptfs
efivarfs
efs
erofs
exfat
exportfs
ext2
ext4 ext4: don't use the orphan list when migrating an inode 2022-01-27 11:05:18 +01:00
f2fs f2fs: fix to check available space of CP area correctly in update_ckpt_flags() 2022-01-27 11:05:30 +01:00
fat
freevxfs
fscache
fuse fuse: Pass correct lend value to filemap_write_and_wait_range() 2022-01-27 11:05:08 +01:00
gfs2
hfs
hfsplus
hostfs
hpfs
hugetlbfs
iomap
isofs
jbd2 jbd2: export jbd2_journal_[grab|put]_journal_head 2022-02-01 17:27:05 +01:00
jffs2 jffs2: GC deadlock reading a page that is used in jffs2_write_begin() 2022-01-27 11:04:49 +01:00
jfs
kernfs
ksmbd ksmbd: add reserved room in ipc request/response 2022-01-27 11:02:53 +01:00
lockd
minix
netfs netfs: fix parameter of cleanup() 2021-12-29 12:28:59 +01:00
nfs NFS: Ensure the server has an up to date ctime before renaming 2022-02-01 17:27:09 +01:00
nfs_common
nfsd fsnotify: fix fsnotify hooks in pseudo filesystems 2022-02-01 17:27:01 +01:00
nilfs2
nls
notify
ntfs
ntfs3
ocfs2 ocfs2: fix a deadlock when commit trans 2022-02-01 17:27:05 +01:00
omfs
openpromfs
orangefs orangefs: Fix the size of a memory allocation in orangefs_bufmap_alloc() 2022-01-20 09:13:13 +01:00
overlayfs ovl: fix warning in ovl_create_real() 2021-12-22 09:32:50 +01:00
proc
pstore
qnx4
qnx6
quota
ramfs
reiserfs
romfs
smbfs_common
squashfs
sysfs
sysv
tracefs
ubifs ubifs: Error path in ubifs_remount_rw() seems to wrongly free write buffers 2022-01-27 11:05:07 +01:00
udf udf: Fix NULL ptr deref when converting from inline format 2022-02-01 17:27:00 +01:00
ufs
unicode
vboxsf
verity
xfs xfs: map unwritten blocks in XFS_IOC_{ALLOC,FREE}SP just like fallocate 2022-01-11 15:35:16 +01:00
zonefs zonefs: add MODULE_ALIAS_FS 2021-12-22 09:32:48 +01:00
aio.c
anon_inodes.c
attr.c
bad_inode.c
binfmt_aout.c
binfmt_elf_fdpic.c
binfmt_elf.c
binfmt_flat.c
binfmt_misc.c
binfmt_script.c
buffer.c
char_dev.c
compat_binfmt_elf.c
coredump.c
d_path.c
dax.c
dcache.c
direct-io.c
drop_caches.c
eventfd.c
eventpoll.c
exec.c
fcntl.c
fhandle.c
file_table.c
file.c fget: clarify and improve __fget_files() implementation 2022-01-16 09:12:42 +01:00
filesystems.c
fs_context.c vfs: fs_context: fix up param length parsing in legacy_parse_param 2022-01-20 09:13:14 +01:00
fs_parser.c
fs_pin.c
fs_struct.c
fs_types.c
fs-writeback.c
fsopen.c
init.c
inode.c
internal.h
io_uring.c io_uring: fix bug in slow unregistering of nodes 2022-02-01 17:27:11 +01:00
io-wq.c io-wq: drop wqe lock before creating new worker 2021-12-22 09:32:51 +01:00
io-wq.h
ioctl.c
Kconfig
Kconfig.binfmt
kernel_read_file.c
libfs.c
locks.c
Makefile
mbcache.c
mount.h
mpage.c
namei.c
namespace.c fs/mount_setattr: always cleanup mount_kattr 2022-01-05 12:42:39 +01:00
no-block.c
nsfs.c
open.c
pipe.c
pnode.c
pnode.h
posix_acl.c
proc_namespace.c
read_write.c
readdir.c
remap_range.c
select.c select: Fix indefinitely sleeping task in poll_schedule_timeout() 2022-01-29 10:58:25 +01:00
seq_file.c
signalfd.c
splice.c
stack.c
stat.c
statfs.c
super.c devtmpfs regression fix: reconfigure on each mount 2022-01-20 09:13:13 +01:00
sync.c
timerfd.c
userfaultfd.c
utimes.c
xattr.c