Chris Mason
570dd45042
btrfs: fix races on root_log_ctx lists
...
btrfs_remove_all_log_ctxs takes a shortcut where it avoids walking the
list because it knows all of the waiters are patiently waiting for the
commit to finish.
But, there's a small race where btrfs_sync_log can remove itself from
the list if it finds a log commit is already done. Also, it uses
list_del_init() to remove itself from the list, but there's no way to
know if btrfs_remove_all_log_ctxs has already run, so we don't know for
sure if it is safe to call list_del_init().
This gets rid of all the shortcuts for btrfs_remove_all_log_ctxs(), and
just calls it with the proper locking.
This is part two of the corruption fixed by cbd60aa7cd1. I should have
done this in the first place, but convinced myself the optimizations were
safe. A 12 hour run of dbench 2048 will eventually trigger a list debug
WARN_ON for the list_del_init() in btrfs_sync_log().
Fixes: d1433debe7f4346cf9fc0dafc71c3137d2a97bc4
Reported-by: Dave Jones <davej@codemonkey.org.uk>
cc: stable@vger.kernel.org # 3.15+
Signed-off-by: Chris Mason <clm@fb.com>
2016-10-27 10:42:20 -07:00
..
2016-08-07 10:01:14 -04:00
2016-08-07 10:01:14 -04:00
2016-07-31 16:37:25 -04:00
2016-08-06 00:08:40 -04:00
2016-09-19 15:36:17 -07:00
2016-05-23 17:04:14 -07:00
2016-05-09 11:41:14 -04:00
2016-10-27 10:42:20 -07:00
2016-08-03 13:33:26 -04:00
2016-09-05 14:30:35 +02:00
2016-09-09 23:58:07 -05:00
2016-05-29 19:08:00 -04:00
2016-09-16 12:58:28 +02:00
2016-05-09 11:41:14 -04:00
2016-09-10 01:18:57 -04:00
2016-06-30 23:34:49 -04:00
2016-09-03 11:02:50 -07:00
2016-08-26 13:22:14 -05:00
2016-07-08 10:35:28 -05:00
2016-07-31 16:37:25 -04:00
2016-05-20 17:58:30 -07:00
2016-06-07 13:41:38 -06:00
2016-05-02 19:49:29 -04:00
2016-08-06 09:49:02 -04:00
2016-09-10 01:18:57 -04:00
2016-09-10 01:18:57 -04:00
2016-08-07 10:01:14 -04:00
2016-06-13 10:20:39 +02:00
2016-06-30 23:34:49 -04:00
2016-08-24 18:17:04 +02:00
2016-08-07 10:03:31 -04:00
2016-08-07 10:01:14 -04:00
2016-08-07 10:01:14 -04:00
2016-08-04 00:18:10 +02:00
2016-07-31 16:37:25 -04:00
2016-07-31 16:37:25 -04:00
2016-07-26 18:35:55 -07:00
2016-06-10 20:21:46 -07:00
2016-07-31 16:37:25 -04:00
2016-08-31 14:48:52 +02:00
2016-07-28 12:59:05 -07:00
2016-08-06 09:49:02 -04:00
2016-05-02 19:49:32 -04:00
2016-07-31 16:37:25 -04:00
2016-09-11 14:56:44 -04:00
2016-08-12 16:10:25 -04:00
2016-08-02 19:35:21 -04:00
2016-09-19 15:36:17 -07:00
2016-07-28 12:59:05 -07:00
2016-09-19 15:36:17 -07:00
2016-05-09 11:41:14 -04:00
2016-05-09 11:41:14 -04:00
2016-08-02 15:39:13 -04:00
2016-09-05 13:55:20 +02:00
2016-09-20 13:32:49 -07:00
2016-08-05 11:21:46 -07:00
2016-05-09 11:41:14 -04:00
2016-05-09 11:41:14 -04:00
2016-07-29 15:54:19 -07:00
2016-09-19 15:36:17 -07:00
2016-08-02 19:35:22 -04:00
2016-05-09 11:41:15 -04:00
2016-06-07 13:41:38 -06:00
2016-08-31 15:14:44 +02:00
2016-06-10 20:21:46 -07:00
2016-05-29 16:22:07 -04:00
2016-08-23 23:02:52 +02:00
2016-07-26 15:37:51 -07:00
2016-07-28 12:59:05 -07:00
2016-08-30 13:51:39 +10:00
2016-09-15 15:49:28 -07:00
2016-07-05 15:06:46 -05:00
2016-05-27 20:09:16 -04:00
2016-05-28 16:34:59 -07:00
2016-07-25 16:51:49 +10:00
2016-08-31 09:13:56 -07:00
2016-08-02 19:35:15 -04:00
2016-07-28 13:29:12 +10:00
2016-08-07 10:13:14 -04:00
2016-08-25 08:38:26 -06:00
2016-07-27 09:53:35 -07:00
2016-07-14 16:21:53 +09:00
2016-06-28 10:00:13 -03:00
2016-05-24 12:55:26 -07:00
2016-06-07 22:07:09 -04:00
2016-07-28 17:38:16 -07:00
2016-08-07 10:01:14 -04:00
2016-06-07 13:41:38 -06:00
2016-05-19 19:12:14 -07:00
2016-08-04 18:04:44 -04:00
2016-05-02 19:49:28 -04:00
2016-08-09 19:58:06 -06:00
2016-08-07 10:01:14 -04:00
2016-08-07 10:13:14 -04:00
2016-09-15 13:29:52 -07:00
2016-08-29 11:33:58 +10:00
2016-08-04 19:59:06 -04:00
2016-07-28 13:29:13 +10:00
2016-06-20 17:11:29 -04:00
2016-07-01 10:24:18 -04:00
2016-06-21 09:23:11 +10:00
2016-08-07 14:41:02 -06:00
2016-08-07 10:03:31 -04:00
2016-07-29 15:54:19 -07:00
2016-08-07 10:13:14 -04:00
2016-08-09 10:14:10 -07:00
2016-05-05 09:54:45 -05:00
2016-07-29 15:54:19 -07:00
2016-07-15 10:30:26 +02:00
2016-05-26 00:13:25 -04:00
2016-05-19 19:12:14 -07:00
2016-08-26 17:39:35 -07:00
2016-05-11 00:00:29 -04:00
2016-07-29 15:54:19 -07:00
2016-06-09 23:42:38 +02:00
2016-07-26 16:19:19 -07:00
2016-08-07 10:03:31 -04:00
2016-07-05 15:06:46 -05:00