No description
  • C 97.1%
  • Makefile 1.2%
  • Shell 0.7%
  • Assembly 0.5%
  • C++ 0.2%
  • Other 0.1%
Find a file
Milos Nikic d80222b978 ext2fs: Fix journal deadlock during transaction finalization
When a VFS thread finalizes a transaction in journal_stop_transaction_locked, it holds the global j_state_lock while performing memcpy to hydrate shadow buffers from the live Mach virtual memory cache (bptr).

Under heavy memory pressure, this memcpy can trigger a Page Fault. If the Mach kernel decides to evict dirty pages to satisfy the fault, the ext2fs pager is invoked. The pager then attempts to write blocks to disk, which requires acquiring the j_state_lock but that lock is already held by the suspended VFS thread, causing a circular deadlock.

Fix:
Decouple memory hydration (memcpy) from the j_state_lock.
- While holding the lock, identify blocks needing hydration and stage them in a thread-local list using jb_next.
- Temporarily increment t_updates to protect the transaction from being freed.
- Drop the j_state_lock to perform the memcpy. If a page fault occurs here, the pager can now safely acquire the lock to satisfy the I/O.
- Re-acquire the lock and decrement t_updates to finalize the commit.

This ensures the lock is never held while accessing pageable memory.

Test:
I have run the scenario in which i can recreate the deadlock multiple
times with debugging messages on and off, and i don't manage to cause this specific
deadlock scenario any more.
2026-06-30 01:01:16 +02:00
acpi acpi: Ignore irq 9 requests because PIIX3 ACPI is wrong 2025-06-22 21:41:30 +02:00
auth Add a description comment for the MIG type translation files 2024-12-14 23:09:50 +01:00
benchmarks Modernize code by removing use of old style definitions. 2023-04-03 00:22:08 +02:00
boot Added checks for mmap return value in several places. 2026-06-28 18:47:29 +02:00
config Do not hardcode /libexec libexecdir 2021-03-16 22:45:53 +00:00
console Added checks for mmap return value in several places. 2026-06-28 18:47:29 +02:00
console-client Hurd: Use designated initializers across the codebase 2026-04-17 00:29:00 +02:00
daemons getty: Also accept --autologin 2026-06-08 23:41:12 +02:00
defpager Fix accessing bit 31 2023-02-15 18:18:08 +01:00
devnode Add a description comment for the MIG type translation files 2024-12-14 23:09:50 +01:00
doc Revert "Add const qualifier to parameter `name' of function diskfs_lookup" 2025-11-08 23:46:16 +01:00
eth-multiplexer Add names to threads 2025-02-08 21:25:55 +01:00
exec Added checks for mmap return value in several places. 2026-06-28 18:47:29 +02:00
ext2fs ext2fs: Fix journal deadlock during transaction finalization 2026-06-30 01:01:16 +02:00
fatfs Added checks for mmap return value in several places. 2026-06-28 18:47:29 +02:00
fstests More device_get_status count fixes 2024-11-04 17:53:40 +01:00
ftpfs ftpfs: Better take actual error from errno 2025-10-04 22:11:44 +02:00
hostmux Homogeneize [gs]et_translator and get_dire[nc]ts into mach_msg_type_number_t 2023-08-08 02:28:06 +02:00
hurd Comment fixed 2025-04-02 14:14:00 +02:00
include Fix DESTDIR support 2018-04-22 17:21:01 +02:00
init init: give -s some real behavior 2026-06-19 16:06:32 +02:00
isofs Added checks for mmap return value in several places. 2026-06-28 18:47:29 +02:00
libbpf Raise NET_MAX_FILTER 2026-06-14 23:45:20 +02:00
libcons Add names to threads 2025-02-08 21:25:55 +01:00
libdiskfs ext2fs: Add JBD2 journaling to ext2/libdiskfs 2026-05-27 01:35:07 +02:00
libfshelp libfshelp: Free Memory Read errors after calls to rele_lock() 2026-03-22 19:50:55 +01:00
libfshelp-tests Use mach_msg_type_number_t whenever required to avoid warnings 2023-12-29 22:32:06 +01:00
libftpconn libftpconn: add out >= 2 condition to make GCC happy 2023-12-29 22:45:15 +01:00
libhurd-slab Use our own variant of 'assert' and 'assert_perror'. 2017-08-05 18:42:22 +02:00
libhurdbugaddr Switch to the new ChangeLog style. 2009-07-11 10:40:39 +02:00
libihash libihash: Prevent multiple evaluation in iteration macros 2026-03-29 18:38:11 +02:00
libiohelp libiohelp: Port to x86_64 2023-05-10 02:06:54 +02:00
libirqhelp Add names to threads 2025-02-08 21:25:55 +01:00
libmachdev Added checks for mmap return value in several places. 2026-06-28 18:47:29 +02:00
libnetfs Added checks for mmap return value in several places. 2026-06-28 18:47:29 +02:00
libpager libpager, ext2fs: add bulk page write support 2025-09-01 21:21:08 +02:00
libpipe libpipe: Do not split writes on dgrem and seqpack pipes 2025-03-05 00:37:08 +01:00
libports Add a description comment for the MIG type translation files 2024-12-14 23:09:50 +01:00
libps libps: fix ignored asprintf result warnings 2025-09-28 21:20:26 +02:00
libshouldbeinlibc libshouldbeinlibc: fix unused result from asprintf 2025-09-27 23:43:44 +02:00
libstore Hurd: Use designated initializers across the codebase 2026-04-17 00:29:00 +02:00
libtrivfs Add a description comment for the MIG type translation files 2024-12-14 23:09:50 +01:00
login Use our own variant of 'assert' and 'assert_perror'. 2017-08-05 18:42:22 +02:00
lwip Added checks for mmap return value in several places. 2026-06-28 18:47:29 +02:00
mach-defpager mach-defpager: on error, print errno 2025-10-04 22:10:03 +02:00
mount *** empty log message *** 1996-07-18 04:35:29 +00:00
nfs Added checks for mmap return value in several places. 2026-06-28 18:47:29 +02:00
nfsd nfsd: fix cast to integer of different size 2025-10-08 00:29:08 +02:00
pci-arbiter pci-arbiter: Fix long standing bug with PCI access 2024-12-29 01:43:57 +01:00
pfinet Added checks for mmap return value in several places. 2026-06-28 18:47:29 +02:00
pflocal Added checks for mmap return value in several places. 2026-06-28 18:47:29 +02:00
proc proc: Also check whether the last child is already dead. 2025-12-17 01:05:22 +01:00
procfs procfs: Honor hidden entries during lookup 2026-06-22 01:53:48 +02:00
release libthreads: Remove 2020-11-11 01:20:03 +01:00
rtc rtc: Fix crash on reading 2025-01-10 14:30:48 +01:00
rumpdisk rumpdisk: wrap usage of DEV_FLUSH_CAHCE in ifdef 2026-03-22 11:31:19 +01:00
rumpnet rumpnet: Fix structure member widths for amd64 2025-10-09 08:56:47 +02:00
shutdown Add a description comment for the MIG type translation files 2024-12-14 23:09:50 +01:00
startup Fix typo 2025-10-23 19:13:33 +02:00
storeio storeio.static: include all boot store types 2026-04-26 22:14:10 +02:00
sutils Hurd: Use designated initializers across the codebase 2026-04-17 00:29:00 +02:00
term Added checks for mmap return value in several places. 2026-06-28 18:47:29 +02:00
tmpfs tmpfs: fix typos. 2026-05-20 15:52:59 +02:00
trans Added checks for mmap return value in several places. 2026-06-28 18:47:29 +02:00
usermux Homogeneize [gs]et_translator and get_dire[nc]ts into mach_msg_type_number_t 2023-08-08 02:28:06 +02:00
utils login: Write cat output to stdout 2026-06-22 01:48:56 +02:00
.gitignore Minor documentation changes 2015-09-29 01:09:41 +02:00
aclocal.m4 Fix build against libgcrypt >= 1.11.0 2024-07-23 00:00:56 +02:00
BUGS *** empty log message *** 1996-08-14 18:10:19 +00:00
build.mk.in (VPATH): New variable. 1995-09-22 18:26:03 +00:00
build.mkcf.in Wed Jul 17 22:49:50 1996 Roland McGrath <roland@baalperazim.frob.com> 1996-07-18 06:28:57 +00:00
ChangeLog Fix "random" ChangeLog handling 2016-12-17 23:07:53 +01:00
config.guess Update config.guess and config.sub 2013-02-26 16:04:39 +01:00
config.make.in console-client: use xkbcommon instead of x11 for xkb extended support 2024-03-10 17:00:12 +01:00
config.sub Update config.guess and config.sub 2013-02-26 16:04:39 +01:00
configure.ac rumpdisk: Set USER_DEVICE ktype on device ports 2025-08-31 23:37:01 +02:00
COPYING *** empty log message *** 1996-07-18 04:35:29 +00:00
gitlog-to-changelog Generate ChangeLog files for distributions. 2013-09-27 16:29:45 +02:00
hurd.boot boot scripts: recommend using exec.static 2025-08-21 00:52:39 +02:00
INSTALL Drop mention of non-existing check target 2023-06-21 00:11:04 +02:00
INSTALL-cross GNU Hurd 0.5. 2013-09-27 21:41:02 +02:00
install-sh 2008-11-17 Thomas Schwinge <tschwinge@gnu.org> 2008-11-17 11:28:31 +00:00
Makeconf rumpdisk: Support dynamic linkage of librump 2025-07-01 20:52:25 +02:00
Makefile rumpnet: Add device translator for (Intel) NICs 2025-08-01 00:27:39 +02:00
mkinstalldirs *** empty log message *** 1996-07-18 04:35:29 +00:00
move-if-change 1999-06-17 Roland McGrath <roland@baalperazim.frob.com> 1999-06-18 21:01:28 +00:00
NEWS Use our own variant of 'assert' and 'assert_perror'. 2017-08-05 18:42:22 +02:00
README 64-bit is mostly ready 2025-08-14 22:20:18 +02:00
tasks Add TASK_EVENTS_INFO support to libps 2013-01-13 20:28:51 +01:00
TODO TODO: drop items that were done 2020-06-06 19:27:07 +02:00
version.h.in 2002-05-13 Marcus Brinkmann <marcus@gnu.org> 2002-05-13 20:45:23 +00:00

This is the GNU Hurd, <http://www.gnu.org/software/hurd/>.  Welcome.

GNU Hurd runs on 32-bit and 64-bit x86 machines.  Volunteers interested in ports
to other architectures are sought; please contact us (see below) if you'd like
to help.

To compile the Hurd, you need a toolchain configured to target i?86-gnu;
you cannot use a toolchain targeting GNU/Linux.  Also note that you
cannot run the Hurd "in isolation": you'll need to add further components
such as the GNU C Library (glibc), to turn it into a runnable system.

Recent versions of Mach, MIG, glibc, and GCC are required.  Optionally, a Sun
RPC implementation is needed to build the NFS translator and daemon:

glibc   Configured with --enable-obsolete-rpc.
TI-RPC  Currently fails to build on GNU, see
        <http://lists.debian.org/debian-hurd/2010/12/msg00007.html>.

Obviously, you also need somewhat recent versions of binutils, make,
bash and some other tools.  No hard requirements are currently known
for these, though.

For instructions on compiling and installing the GNU Hurd from an
already running Hurd system, see the file `INSTALL'.

It is possible to cross-build the Hurd; the file INSTALL-cross
contains some past instructions for doing so, but it's too much
trouble to maintain these instructions and keep them up to date.  Your
best bet is to start with a running Hurd system already.  If you do
decide to cross compile, you will need to examine the instructions in
INSTALL for building Mach, libc, and the Hurd together, and follow
them.  The instructions in INSTALL-cross are quite out-of-date, but
they contain some useful hints buried amongst the errors, so we have
left the file for those who find it useful.

Please note that this directory also contains a fair amount of
not-yet-working code.  By default, the makefiles build only the
working code.


The GNU Hurd is free software.  All of it, including the libraries in
this distribution, is covered by the GNU General Public License, found
in the file COPYING.


Please read the FAQ at <http://www.gnu.org/software/hurd/faq.html>.
Bug reports should be sent to <bug-hurd@gnu.org> or filed on
<http://savannah.gnu.org/bugs/?group=hurd>.  Requests for assistance
should be sent to <help-hurd@gnu.org> or filed on
<http://savannah.gnu.org/support/?group=hurd>.  You can also find us on
the libera.chat IRC network in the #hurd channel.