1
0
Fork 0
mirror of https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git synced 2025-01-25 17:53:34 -05:00
linux/fs
Andreas Gruenbacher 486408d690 gfs2: Cancel remote delete work asynchronously
In gfs2_inode_lookup and gfs2_create_inode, we're calling
gfs2_cancel_delete_work which currently cancels any remote delete work
(delete_work_func) synchronously.  This means that if the work is
currently running, it will wait for it to finish.  We're doing this to
pevent a previous instance of an inode from having any influence on the
next instance.

However, delete_work_func uses gfs2_inode_lookup internally, and we can
end up in a deadlock when delete_work_func gets interrupted at the wrong
time.  For example,

  (1) An inode's iopen glock has delete work queued, but the inode
      itself has been evicted from the inode cache.

  (2) The delete work is preempted before reaching gfs2_inode_lookup.

  (3) Another process recreates the inode (gfs2_create_inode).  It tries
      to cancel any outstanding delete work, which blocks waiting for
      the ongoing delete work to finish.

  (4) The delete work calls gfs2_inode_lookup, which blocks waiting for
      gfs2_create_inode to instantiate and unlock the new inode =>
      deadlock.

It turns out that when the delete work notices that its inode has been
re-instantiated, it will do nothing.  This means that it's safe to
cancel the delete work asynchronously.  This prevents the kind of
deadlock described above.

Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com>
Signed-off-by: Bob Peterson <rpeterso@redhat.com>
2021-10-25 08:42:20 +02:00
..
9p 9p: Fix a bunch of kerneldoc warnings shown up by W=1 2021-10-04 22:07:46 +01:00
adfs
affs
afs netfslib, cachefiles and afs fixes 2021-10-07 11:20:08 -07:00
autofs
befs
bfs
btrfs iomap: Add done_before argument to iomap_dio_rw 2021-10-24 15:26:05 +02:00
cachefiles
ceph ceph: fix off by one bugs in unsafe_request_wait() 2021-09-21 17:39:20 +02:00
cifs cifs: fix incorrect check for null pointer in header_assemble 2021-09-23 21:12:53 -05:00
coda
configfs
cramfs
crypto
debugfs debugfs: debugfs_create_file_size(): use IS_ERR to check for error 2021-09-21 09:09:06 +02:00
devpts
dlm
ecryptfs
efivarfs
efs
erofs iomap: Add done_before argument to iomap_dio_rw 2021-10-24 15:26:05 +02:00
exfat
exportfs
ext2 ext2: fix sleeping in atomic bugs on error 2021-09-22 13:05:23 +02:00
ext4 iomap: Add done_before argument to iomap_dio_rw 2021-10-24 15:26:05 +02:00
f2fs iov_iter: Turn iov_iter_fault_in_readable into fault_in_iov_iter_readable 2021-10-18 16:35:06 +02:00
fat
freevxfs
fscache fscache: Remove an unused static variable 2021-10-04 22:13:12 +01:00
fuse iov_iter: Turn iov_iter_fault_in_readable into fault_in_iov_iter_readable 2021-10-18 16:35:06 +02:00
gfs2 gfs2: Cancel remote delete work asynchronously 2021-10-25 08:42:20 +02:00
hfs
hfsplus
hostfs
hpfs
hugetlbfs
iomap iomap: Add done_before argument to iomap_dio_rw 2021-10-24 15:26:05 +02:00
isofs
jbd2
jffs2
jfs
kernfs kernfs: also call kernfs_set_rev() for positive dentry 2021-09-28 18:18:15 +02:00
ksmbd ksmbd: fix oops from fuse driver 2021-10-07 10:18:36 -05:00
lockd Critical bug fixes: 2021-09-22 09:21:02 -07:00
minix
netfs netfs: Fix READ/WRITE confusion when calling iov_iter_xarray() 2021-10-05 11:22:06 +01:00
nfs
nfs_common nfs: Fix kerneldoc warning shown up by W=1 2021-10-04 22:02:17 +01:00
nfsd Bug fixes for NFSD error handling paths 2021-10-07 14:11:40 -07:00
nilfs2
nls
notify
ntfs iov_iter: Turn iov_iter_fault_in_readable into fault_in_iov_iter_readable 2021-10-18 16:35:06 +02:00
ntfs3 iov_iter: Turn iov_iter_fault_in_readable into fault_in_iov_iter_readable 2021-10-18 16:35:06 +02:00
ocfs2 ocfs2: drop acl cache for directories too 2021-09-24 16:13:34 -07:00
omfs
openpromfs
orangefs
overlayfs ovl: fix IOCB_DIRECT if underlying fs doesn't support direct IO 2021-09-28 09:16:12 +02:00
proc
pstore
qnx4 qnx4: work around gcc false positive warning bug 2021-09-21 08:36:48 -07:00
qnx6
quota
ramfs
reiserfs
romfs
smbfs_common
squashfs
sysfs
sysv
tracefs
ubifs
udf
ufs
unicode
vboxsf vboxfs: fix broken legacy mount signature checking 2021-09-27 11:26:21 -07:00
verity fs-verity: fix signed integer overflow with i_size near S64_MAX 2021-09-22 10:56:34 -07:00
xfs iomap: Add done_before argument to iomap_dio_rw 2021-10-24 15:26:05 +02:00
zonefs iomap: Add done_before argument to iomap_dio_rw 2021-10-24 15:26:05 +02:00
aio.c
anon_inodes.c
attr.c
bad_inode.c
binfmt_aout.c
binfmt_elf.c elf: don't use MAP_FIXED_NOREPLACE for elf interpreter mappings 2021-10-03 14:02:58 -07:00
binfmt_elf_fdpic.c
binfmt_flat.c
binfmt_misc.c
binfmt_script.c
buffer.c mm: fs: invalidate bh_lrus for only cold path 2021-09-24 16:13:35 -07:00
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.c
file_table.c
filesystems.c
fs-writeback.c
fs_context.c
fs_parser.c
fs_pin.c
fs_struct.c
fs_types.c
fsopen.c
init.c
inode.c
internal.h
io-wq.c io-wq: exclusively gate signal based exit on get_signal() return 2021-09-27 11:03:43 -06:00
io-wq.h
io_uring.c io_uring: kill fasync 2021-10-01 11:16:02 -06:00
ioctl.c
Kconfig
Kconfig.binfmt
kernel_read_file.c
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
readdir.c
remap_range.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