1
0
Fork 0
mirror of https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git synced 2025-01-24 17:23:25 -05:00
No description
Find a file
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
arch gup: Turn fault_in_pages_{readable,writeable} into fault_in_{readable,writeable} 2021-10-18 16:33:03 +02:00
block block-5.15-2021-10-09 2021-10-09 14:51:59 -07:00
certs
crypto
Documentation xen: branch for v5.15-rc5 2021-10-08 12:55:23 -07:00
drivers gup: Turn fault_in_pages_{readable,writeable} into fault_in_{readable,writeable} 2021-10-18 16:33:03 +02:00
fs gfs2: Cancel remote delete work asynchronously 2021-10-25 08:42:20 +02:00
include iov_iter: Introduce nofault flag to disable page faults 2021-10-24 15:26:06 +02:00
init
ipc
kernel Networking fixes for 5.15-rc5, including fixes from xfrm, bpf, 2021-10-07 09:50:31 -07:00
lib iov_iter: Introduce nofault flag to disable page faults 2021-10-24 15:26:06 +02:00
LICENSES
mm gup: Introduce FOLL_NOFAULT flag to disable page faults 2021-10-24 15:26:05 +02:00
net Bug fixes for NFSD error handling paths 2021-10-07 14:11:40 -07:00
samples
scripts RISC-V Fixes for 5.15-rc5 2021-10-09 09:07:58 -07:00
security Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/klassert/ 2021-10-07 12:44:41 +01:00
sound
tools - Remove an extra section.len member in favour of section.sh_size 2021-10-10 10:05:39 -07:00
usr
virt
.clang-format
.cocciconfig
.get_maintainer.ignore
.gitattributes
.gitignore
.mailmap
COPYING
CREDITS
Kbuild
Kconfig
MAINTAINERS ARM: SoC fixes for v5.15 2021-10-07 14:01:29 -07:00
Makefile Linux 5.15-rc5 2021-10-10 17:01:59 -07:00
README

Linux kernel
============

There are several guides for kernel developers and users. These guides can
be rendered in a number of formats, like HTML and PDF. Please read
Documentation/admin-guide/README.rst first.

In order to build the documentation, use ``make htmldocs`` or
``make pdfdocs``.  The formatted documentation can also be read online at:

    https://www.kernel.org/doc/html/latest/

There are various text files in the Documentation/ subdirectory,
several of them using the Restructured Text markup notation.

Please read the Documentation/process/changes.rst file, as it contains the
requirements for building and running the kernel, and information about
the problems which may result by upgrading your kernel.