Filipe Manana
abdd2e80a5
Btrfs: fix crash when starting transaction
...
Often when starting a transaction we commit the currently running transaction,
which can end up writing block group caches when the current process has its
journal_info set to NULL (and not to a transaction). This makes our assertion
at btrfs_check_data_free_space() (current_journal != NULL) fail, resulting
in a crash/hang. Therefore fix it by setting journal_info.
Two different traces of this issue follow below.
1)
[51502.241936] BTRFS: assertion failed: current->journal_info, file: fs/btrfs/extent-tree.c, line: 3670
[51502.242213] ------------[ cut here ]------------
[51502.242493] kernel BUG at fs/btrfs/ctree.h:3964!
[51502.242669] invalid opcode: 0000 [#1 ] SMP DEBUG_PAGEALLOC
(...)
[51502.244010] Call Trace:
[51502.244010] [<ffffffffa02bc025>] btrfs_check_data_free_space+0x395/0x3a0 [btrfs]
[51502.244010] [<ffffffffa02c3bdc>] btrfs_write_dirty_block_groups+0x4ac/0x640 [btrfs]
[51502.244010] [<ffffffffa0357a6a>] commit_cowonly_roots+0x164/0x226 [btrfs]
[51502.244010] [<ffffffffa02d53cd>] btrfs_commit_transaction+0x4ed/0xab0 [btrfs]
[51502.244010] [<ffffffff8168ec7b>] ? _raw_spin_unlock+0x2b/0x40
[51502.244010] [<ffffffffa02d6259>] start_transaction+0x459/0x620 [btrfs]
[51502.244010] [<ffffffffa02d67ab>] btrfs_start_transaction+0x1b/0x20 [btrfs]
[51502.244010] [<ffffffffa02d73e1>] __unlink_start_trans+0x31/0xe0 [btrfs]
[51502.244010] [<ffffffffa02dea67>] btrfs_unlink+0x37/0xc0 [btrfs]
[51502.244010] [<ffffffff811bb054>] ? do_unlinkat+0x114/0x2a0
[51502.244010] [<ffffffff811baebc>] vfs_unlink+0xcc/0x150
[51502.244010] [<ffffffff811bb1a0>] do_unlinkat+0x260/0x2a0
[51502.244010] [<ffffffff811a9ef4>] ? filp_close+0x64/0x90
[51502.244010] [<ffffffff810aaea6>] ? trace_hardirqs_on_caller+0x16/0x1e0
[51502.244010] [<ffffffff81349cab>] ? trace_hardirqs_on_thunk+0x3a/0x3f
[51502.244010] [<ffffffff811be9eb>] SyS_unlinkat+0x1b/0x40
[51502.244010] [<ffffffff81698452>] system_call_fastpath+0x16/0x1b
[51502.244010] Code: 0b 55 48 89 e5 0f 0b 55 48 89 e5 0f 0b 55 89 f1 48 c7 c2 71 13 36 a0 48 89 fe 31 c0 48 c7 c7 b8 43 36 a0 48 89 e5 e8 5d b0 32 e1 <0f> 0b 0f 1f 44 00 00 55 b9 11 00 00 00 48 89 e5 41 55 49 89 f5
[51502.244010] RIP [<ffffffffa03575da>] assfail.constprop.88+0x1e/0x20 [btrfs]
2)
[25405.097230] BTRFS: assertion failed: current->journal_info, file: fs/btrfs/extent-tree.c, line: 3670
[25405.097488] ------------[ cut here ]------------
[25405.097767] kernel BUG at fs/btrfs/ctree.h:3964!
[25405.097940] invalid opcode: 0000 [#1 ] SMP DEBUG_PAGEALLOC
(...)
[25405.100008] Call Trace:
[25405.100008] [<ffffffffa02bc025>] btrfs_check_data_free_space+0x395/0x3a0 [btrfs]
[25405.100008] [<ffffffffa02c3bdc>] btrfs_write_dirty_block_groups+0x4ac/0x640 [btrfs]
[25405.100008] [<ffffffffa035755a>] commit_cowonly_roots+0x164/0x226 [btrfs]
[25405.100008] [<ffffffffa02d53cd>] btrfs_commit_transaction+0x4ed/0xab0 [btrfs]
[25405.100008] [<ffffffff8109c170>] ? bit_waitqueue+0xc0/0xc0
[25405.100008] [<ffffffffa02d6259>] start_transaction+0x459/0x620 [btrfs]
[25405.100008] [<ffffffffa02d67ab>] btrfs_start_transaction+0x1b/0x20 [btrfs]
[25405.100008] [<ffffffffa02e3407>] btrfs_create+0x47/0x210 [btrfs]
[25405.100008] [<ffffffffa02d74cc>] ? btrfs_permission+0x3c/0x80 [btrfs]
[25405.100008] [<ffffffff811bc63b>] vfs_create+0x9b/0x130
[25405.100008] [<ffffffff811bcf19>] do_last+0x849/0xe20
[25405.100008] [<ffffffff811b9409>] ? link_path_walk+0x79/0x820
[25405.100008] [<ffffffff811bd5b5>] path_openat+0xc5/0x690
[25405.100008] [<ffffffff810ab07d>] ? trace_hardirqs_on+0xd/0x10
[25405.100008] [<ffffffff811cdcd2>] ? __alloc_fd+0x32/0x1d0
[25405.100008] [<ffffffff811be2a3>] do_filp_open+0x43/0xa0
[25405.100008] [<ffffffff811cddf1>] ? __alloc_fd+0x151/0x1d0
[25405.100008] [<ffffffff811abcfc>] do_sys_open+0x13c/0x230
[25405.100008] [<ffffffff810aaea6>] ? trace_hardirqs_on_caller+0x16/0x1e0
[25405.100008] [<ffffffff811abe12>] SyS_open+0x22/0x30
[25405.100008] [<ffffffff81698452>] system_call_fastpath+0x16/0x1b
[25405.100008] Code: 0b 55 48 89 e5 0f 0b 55 48 89 e5 0f 0b 55 89 f1 48 c7 c2 51 13 36 a0 48 89 fe 31 c0 48 c7 c7 d0 43 36 a0 48 89 e5 e8 6d b5 32 e1 <0f> 0b 0f 1f 44 00 00 55 b9 11 00 00 00 48 89 e5 41 55 49 89 f5
[25405.100008] RIP [<ffffffffa03570ca>] assfail.constprop.88+0x1e/0x20 [btrfs]
Signed-off-by: Filipe David Borba Manana <fdmanana@gmail.com>
Signed-off-by: Chris Mason <clm@fb.com>
2014-07-03 07:04:18 -07:00
..
2014-04-07 16:35:53 -07:00
2014-04-07 16:36:08 -07:00
2014-05-06 13:05:00 -07:00
2014-05-23 13:05:22 +01:00
2014-05-06 13:04:59 -07:00
2014-04-04 15:39:39 -07:00
2014-04-07 16:36:08 -07:00
2014-07-03 07:04:18 -07:00
2014-04-12 14:49:50 -07:00
2014-05-05 15:17:02 -07:00
2014-04-24 22:37:03 -05:00
2014-04-04 15:39:39 -07:00
2013-11-21 16:42:27 -08:00
2014-04-04 15:39:39 -07:00
2014-04-04 15:39:39 -07:00
2014-03-13 10:14:33 -04:00
2014-04-11 16:15:36 -04:00
2014-04-04 14:03:05 -07:00
2014-03-04 16:16:16 +00:00
2014-04-04 15:39:39 -07:00
2014-04-10 14:33:02 -07:00
2014-04-07 17:59:17 -07:00
2014-04-07 17:59:17 -07:00
2014-04-20 20:43:47 -07:00
2014-04-07 16:38:06 -07:00
2014-04-04 15:39:39 -07:00
2014-04-04 15:39:39 -07:00
2014-02-17 13:47:35 -08:00
2014-04-28 16:43:44 +02:00
2014-04-07 16:35:53 -07:00
2014-04-04 15:39:39 -07:00
2014-04-04 15:39:39 -07:00
2014-04-03 16:21:01 -07:00
2014-04-04 15:39:39 -07:00
2014-05-06 13:04:58 -07:00
2014-04-07 17:59:17 -07:00
2013-12-04 12:27:46 +01:00
2014-03-12 16:38:03 -04:00
2014-04-07 10:17:30 -07:00
2014-04-04 15:39:39 -07:00
2014-06-03 08:11:18 -07:00
2014-03-28 10:43:08 -04:00
2014-04-03 16:21:01 -07:00
2014-04-04 15:39:39 -07:00
2014-04-12 17:31:22 -07:00
2014-04-07 16:35:53 -07:00
2014-05-21 11:11:21 -04:00
2014-04-07 16:35:53 -07:00
2014-01-25 03:14:05 -05:00
2014-05-06 13:04:59 -07:00
2014-04-12 14:49:50 -07:00
2014-05-23 09:37:30 -07:00
2014-04-03 16:21:01 -07:00
2014-03-13 10:14:33 -04:00
2014-06-06 13:21:16 -07:00
2014-04-04 15:39:39 -07:00
2014-03-13 10:14:33 -04:00
2014-03-13 10:14:33 -04:00
2014-04-07 17:59:17 -07:00
2014-01-23 16:36:58 -08:00
2014-04-07 17:59:17 -07:00
2014-03-13 10:14:33 -04:00
2014-03-13 10:14:33 -04:00
2014-06-03 08:11:18 -07:00
2014-04-04 15:39:39 -07:00
2014-05-05 09:31:33 +03:00
2014-04-12 14:49:50 -07:00
2014-04-07 16:36:16 -07:00
2014-05-15 09:23:24 +10:00
2014-05-01 08:37:43 -04:00
2014-03-27 09:52:54 -07:00
2013-12-05 16:36:21 -06:00
2014-04-07 16:35:52 -07:00
2014-04-03 16:21:16 -07:00
2014-04-09 08:00:06 -06:00
2014-04-12 14:49:50 -07:00
2014-04-12 14:49:50 -07:00
2014-04-12 14:49:50 -07:00
2013-11-14 12:08:14 +09:00
2014-03-04 08:05:21 +00:00
2014-03-06 16:30:44 +01:00
2014-04-22 08:23:58 -04:00
2014-04-19 13:23:31 -07:00
2014-05-31 09:13:21 -07:00
2014-01-29 16:22:40 -08:00
2014-04-04 15:50:08 -07:00
2014-04-03 16:21:04 -07:00
2014-01-25 03:13:04 -05:00
2014-01-02 14:40:30 -08:00
2014-05-15 00:00:35 +01:00
2014-04-22 08:23:58 -04:00
2014-04-12 14:49:50 -07:00
2014-04-12 14:49:50 -07:00
2014-04-03 16:21:05 -07:00
2014-04-04 14:49:16 -07:00
2014-04-04 15:39:39 -07:00
2014-02-07 16:08:57 -08:00
2013-11-15 22:04:17 -05:00
2014-05-09 11:41:54 -04:00
2014-02-07 16:08:57 -08:00
2014-03-18 19:24:49 -04:00
2014-04-01 23:19:09 -04:00
2013-11-23 22:33:47 -08:00
2014-04-19 12:30:58 -04:00
2014-04-01 23:19:18 -04:00
2014-04-20 20:43:47 -07:00
2014-04-01 23:19:22 -04:00
2014-04-01 23:19:08 -04:00
2014-04-01 23:19:08 -04:00
2014-05-06 13:58:42 -04:00
2014-04-01 23:19:09 -04:00
2014-03-31 14:32:17 -07:00
2013-11-13 15:34:18 +09:00
2013-11-18 19:07:53 -08:00
2014-05-28 01:54:52 -04:00
2014-04-16 11:53:08 -07:00
2014-02-22 02:02:28 +01:00
2014-01-23 16:57:40 -08:00