Andriy Gapon
e298466ee2
corefile_open_last: don't keep a locked vnode while locking other ones
...
Consider this scenario:
- kern.corefile=/var/coredumps/%N.%U.%I.core
- multiple processes with the same name crash at the same time
It's possible that one process selects existing file N as oldvp while it
keeps looking for an unused file number. Another process scans through
files and stumbles upon N. That process would be blocked on the vnode
lock while holding the directory vnode exclusively locked. The first
process would, thus, get blocked on the directory's vnode lock.
More generally, holding a file's vnode lock (oldvp) while trying to lock
its directory (for the next lookup) is a violation of the vnode locking
order.
I have observed this deadlock in the wild.
So, the change to keep oldvp "opened" but unlocked and to lock it again
only if it's to be returned as the result.
As kib noted, an alternative would be to keep the directory locked and
to use VOP_LOOKUP directly for scanning through existing core files.
Reviewed by: kib
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D25027
2020-05-29 07:44:02 +00:00
..
2020-02-26 16:22:28 +00:00
2020-04-12 21:23:19 +00:00
2019-10-29 17:28:25 +00:00
2020-04-15 20:21:30 +00:00
2020-02-26 14:26:36 +00:00
2020-04-16 21:53:17 +00:00
2018-11-29 21:00:56 +00:00
2020-01-30 20:05:05 +00:00
2020-05-28 21:23:02 +00:00
2020-02-26 14:26:36 +00:00
2020-01-30 20:05:05 +00:00
2020-04-01 04:51:39 +00:00
2018-09-06 02:10:59 +00:00
2020-01-30 20:05:05 +00:00
2020-02-26 14:26:36 +00:00
2018-11-26 20:56:05 +00:00
2020-04-29 14:14:15 +00:00
2019-12-13 09:32:16 +00:00
2020-01-03 22:29:58 +00:00
2020-04-27 13:54:00 +00:00
2019-10-14 13:04:04 +00:00
2019-09-12 14:34:46 +00:00
2020-02-26 14:26:36 +00:00
2020-04-21 03:57:30 +00:00
2020-05-02 18:54:25 +00:00
2020-05-25 12:41:44 +00:00
2020-02-26 14:26:36 +00:00
2020-02-26 14:26:36 +00:00
2020-05-16 03:45:15 +00:00
2020-01-30 20:05:05 +00:00
2020-02-26 14:26:36 +00:00
2020-04-18 07:50:30 +00:00
2020-02-26 14:26:36 +00:00
2020-01-30 20:05:05 +00:00
2020-02-26 14:26:36 +00:00
2020-02-26 14:26:36 +00:00
2020-05-19 18:34:50 +00:00
2020-04-09 23:42:13 +00:00
2020-01-30 20:05:05 +00:00
2019-08-21 23:43:58 +00:00
2018-12-07 16:11:45 +00:00
2020-02-26 14:26:36 +00:00
2020-05-03 00:37:16 +00:00
2020-05-15 13:53:10 +00:00
2020-01-30 20:05:05 +00:00
2020-02-26 14:26:36 +00:00
2020-02-26 14:26:36 +00:00
2019-01-15 01:02:16 +00:00
2020-02-26 14:26:36 +00:00
2020-02-26 14:26:36 +00:00
2020-02-13 22:22:15 +00:00
2020-02-26 14:26:36 +00:00
2020-05-01 14:30:59 +00:00
2020-05-25 12:41:44 +00:00
2020-02-26 14:26:36 +00:00
2019-09-15 02:59:53 +00:00
2020-02-15 18:48:38 +00:00
2020-01-30 20:05:05 +00:00
2020-02-12 11:17:18 +00:00
2020-02-26 14:26:36 +00:00
2020-05-03 00:37:16 +00:00
2019-12-02 22:38:25 +00:00
2020-04-26 00:41:29 +00:00
2020-05-29 07:44:02 +00:00
2020-02-26 14:26:36 +00:00
2020-02-26 14:26:36 +00:00
2020-04-21 17:13:06 +00:00
2019-12-11 15:52:29 +00:00
2020-04-16 17:24:13 +00:00
2020-02-26 14:26:36 +00:00
2020-02-26 14:26:36 +00:00
2020-04-26 22:04:43 +00:00
2020-04-14 20:53:12 +00:00
2020-03-16 22:25:25 +00:00
2020-01-30 20:05:05 +00:00
2020-03-02 15:30:52 +00:00
2020-04-15 18:39:12 +00:00
2018-12-04 16:48:47 +00:00
2020-01-30 20:05:05 +00:00
2020-05-07 19:32:49 +00:00
2019-06-25 16:39:25 +00:00
2020-02-12 19:06:34 +00:00
2019-09-30 20:58:29 +00:00
2020-02-26 14:26:36 +00:00
2020-03-02 15:30:52 +00:00
2020-03-02 15:30:52 +00:00
2019-05-13 23:37:44 +00:00
2018-12-11 19:32:16 +00:00
2020-01-30 20:05:05 +00:00
2020-01-03 18:29:20 +00:00
2020-01-30 20:05:05 +00:00
2019-04-18 22:52:12 +00:00
2020-01-30 20:05:05 +00:00
2020-05-25 22:12:04 +00:00
2020-02-26 14:26:36 +00:00
2018-10-30 18:26:34 +00:00
2020-03-26 15:02:37 +00:00
2020-01-30 20:05:05 +00:00
2020-02-20 23:53:48 +00:00
2020-03-06 19:09:01 +00:00
2020-02-14 23:18:03 +00:00
2020-05-25 16:40:48 +00:00
2019-12-20 03:40:53 +00:00
2020-02-26 14:26:36 +00:00
2019-03-12 05:10:41 +00:00
2018-10-12 00:32:45 +00:00
2020-02-26 14:26:36 +00:00
2019-05-21 20:38:48 +00:00
2020-01-30 20:05:05 +00:00
2020-01-30 20:05:05 +00:00
2019-11-28 08:47:36 +00:00
2020-03-30 14:24:03 +00:00
2020-01-30 20:05:05 +00:00
2020-01-30 20:05:05 +00:00
2020-02-26 14:26:36 +00:00
2020-03-02 15:30:52 +00:00
2020-02-26 14:26:36 +00:00
2018-07-19 20:00:28 +00:00
2018-08-09 17:42:27 +00:00
2020-02-26 14:26:36 +00:00
2020-03-06 19:09:01 +00:00
2019-04-06 21:56:24 +00:00
2020-04-19 00:12:30 +00:00
2019-05-20 00:38:23 +00:00
2020-05-09 15:56:02 +00:00
2020-02-26 14:26:36 +00:00
2019-02-20 09:38:19 +00:00
2020-02-26 14:26:36 +00:00
2020-02-26 14:26:36 +00:00
2020-01-30 20:05:05 +00:00
2019-08-16 19:46:22 +00:00
2020-05-03 00:37:16 +00:00
2020-02-26 14:26:36 +00:00
2020-02-26 14:26:36 +00:00
2020-03-06 19:10:00 +00:00
2019-09-25 18:26:31 +00:00
2020-02-26 14:26:36 +00:00
2020-04-01 19:22:09 +00:00
2020-02-11 18:48:07 +00:00
2019-09-26 07:19:26 +00:00
2020-04-01 19:22:09 +00:00
2020-04-02 20:47:51 +00:00
2020-05-20 20:58:17 +00:00
2020-01-30 20:05:05 +00:00
2020-02-19 08:17:27 +00:00
2020-02-26 14:26:36 +00:00
2020-03-19 15:39:45 +00:00
2020-04-15 13:20:51 +00:00
2020-01-12 23:52:16 +00:00
2020-04-27 15:59:19 +00:00
2019-11-25 18:33:21 +00:00
2020-04-01 19:22:09 +00:00
2020-03-20 20:09:00 +00:00
2020-05-28 21:23:02 +00:00
2020-05-28 21:06:10 +00:00
2020-05-28 21:23:02 +00:00
2019-05-04 19:05:30 +00:00
2020-01-30 20:05:05 +00:00
2020-04-14 20:30:48 +00:00
2020-04-14 20:30:48 +00:00
2020-04-17 18:34:49 +00:00
2019-11-29 03:56:01 +00:00
2019-05-20 00:38:23 +00:00
2020-04-17 18:34:49 +00:00
2020-05-15 12:47:39 +00:00
2020-02-26 14:26:36 +00:00
2020-01-15 03:34:21 +00:00
2020-05-26 08:25:24 +00:00
2019-11-06 22:40:19 +00:00
2020-05-07 17:58:07 +00:00
2020-02-26 14:26:36 +00:00
2018-12-11 19:32:16 +00:00
2020-04-14 13:32:03 +00:00
2020-05-03 00:37:16 +00:00
2020-05-29 00:09:12 +00:00
2019-08-11 19:16:07 +00:00
2020-04-13 19:22:05 +00:00
2020-02-15 01:28:42 +00:00
2020-02-26 14:26:36 +00:00
2020-05-25 23:47:31 +00:00
2020-03-06 19:10:00 +00:00
2020-01-30 20:05:05 +00:00
2020-03-30 21:44:30 +00:00
2020-05-11 15:38:44 +00:00
2020-05-14 03:01:23 +00:00
2020-01-11 22:56:20 +00:00
2020-01-30 20:05:05 +00:00
2020-03-01 21:54:28 +00:00
2020-03-22 18:18:30 +00:00
2020-04-27 13:54:00 +00:00
2020-05-21 01:55:35 +00:00
2020-03-24 17:16:52 +00:00
2020-05-25 04:57:57 +00:00
2020-02-23 03:32:11 +00:00