Darrick J. Wong
f4da9e07a6
xfs: fix forgotten rcu read unlock when skipping inode reclaim
...
[ Upstream commit 962cc1ad6caddb5abbb9f0a43e5abe7131a71f18 ]
In commit f2e9ad21 ("xfs: check for race with xfs_reclaim_inode"), we
skip an inode if we're racing with freeing the inode via
xfs_reclaim_inode, but we forgot to release the rcu read lock when
dumping the inode, with the result that we exit to userspace with a lock
held. Don't do that; generic/320 with a 1k block size fails this
very occasionally.
================================================
WARNING: lock held when returning to user space!
4.14.0-rc6-djwong #4 Tainted: G W
------------------------------------------------
rm/30466 is leaving the kernel with locks still held!
1 lock held by rm/30466:
#0 : (rcu_read_lock){....}, at: [<ffffffffa01364d3>] xfs_ifree_cluster.isra.17+0x2c3/0x6f0 [xfs]
------------[ cut here ]------------
WARNING: CPU: 1 PID: 30466 at kernel/rcu/tree_plugin.h:329 rcu_note_context_switch+0x71/0x700
Modules linked in: deadline_iosched dm_snapshot dm_bufio ext4 mbcache jbd2 dm_flakey xfs libcrc32c dax_pmem device_dax nd_pmem sch_fq_codel af_packet [last unloaded: scsi_debug]
CPU: 1 PID: 30466 Comm: rm Tainted: G W 4.14.0-rc6-djwong #4
Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.10.2-1ubuntu1djwong0 04/01/2014
task: ffff880037680000 task.stack: ffffc90001064000
RIP: 0010:rcu_note_context_switch+0x71/0x700
RSP: 0000:ffffc90001067e50 EFLAGS: 00010002
RAX: 0000000000000001 RBX: ffff880037680000 RCX: ffff88003e73d200
RDX: 0000000000000002 RSI: ffffffff819e53e9 RDI: ffffffff819f4375
RBP: 0000000000000000 R08: 0000000000000000 R09: ffff880062c900d0
R10: 0000000000000000 R11: 0000000000000000 R12: ffff880037680000
R13: 0000000000000000 R14: ffffc90001067eb8 R15: ffff880037680690
FS: 00007fa3b8ce8700(0000) GS:ffff88003ec00000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007f69bf77c000 CR3: 000000002450a000 CR4: 00000000000006e0
Call Trace:
__schedule+0xb8/0xb10
schedule+0x40/0x90
exit_to_usermode_loop+0x6b/0xa0
prepare_exit_to_usermode+0x7a/0x90
retint_user+0x8/0x20
RIP: 0033:0x7fa3b87fda87
RSP: 002b:00007ffe41206568 EFLAGS: 00000246 ORIG_RAX: ffffffffffffff02
RAX: 0000000000000000 RBX: 00000000010e88c0 RCX: 00007fa3b87fda87
RDX: 0000000000000000 RSI: 00000000010e89c8 RDI: 0000000000000005
RBP: 0000000000000000 R08: 0000000000000003 R09: 0000000000000000
R10: 000000000000015e R11: 0000000000000246 R12: 00000000010c8060
R13: 00007ffe41206690 R14: 0000000000000000 R15: 0000000000000000
---[ end trace e88f83bf0cfbd07d ]---
Fixes: f2e9ad212def50bcf4c098c6288779dd97fff0f0
Cc: Omar Sandoval <osandov@fb.com>
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Omar Sandoval <osandov@fb.com>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-12-14 09:53:09 +01:00
..
2017-11-02 11:10:55 +01:00
2017-06-19 08:59:10 -07:00
2017-05-08 17:15:13 -07:00
2017-07-12 16:26:03 -07:00
2017-06-05 16:59:08 +02:00
2017-10-11 10:21:06 -07:00
2017-06-27 18:23:21 -07:00
2017-10-16 12:26:50 -07:00
2017-08-31 09:31:47 -07:00
2017-10-11 10:21:07 -07:00
2017-07-13 14:55:05 -07:00
2017-06-20 10:45:22 -07:00
2017-09-01 10:55:30 -07:00
2016-10-04 11:05:44 -07:00
2017-10-11 10:21:06 -07:00
2017-10-11 10:21:06 -07:00
2017-09-02 08:22:19 -07:00
2017-09-01 10:55:30 -07:00
2017-09-25 18:22:30 -07:00
2017-08-31 09:31:47 -07:00
2017-06-20 10:45:22 -07:00
2017-06-19 14:11:33 -07:00
2017-11-02 11:10:55 +01:00
2016-07-22 09:52:35 +10:00
2017-09-01 10:55:30 -07:00
2017-09-25 18:22:30 -07:00
2017-08-22 09:22:24 -07:00
2016-07-15 15:31:29 -04:00
2017-02-16 17:20:12 -08:00
2017-02-09 10:50:25 -08:00
2017-04-25 09:40:42 -07:00
2016-08-03 11:23:49 +10:00
2017-10-23 18:31:50 -07:00
2016-10-03 09:56:28 +11:00
2017-10-16 12:26:50 -07:00
2017-04-03 15:18:17 -07:00
2017-06-19 14:11:33 -07:00
2017-06-19 14:11:33 -07:00
2017-06-19 08:59:10 -07:00
2017-09-01 10:55:30 -07:00
2017-06-19 14:11:34 -07:00
2016-11-28 14:57:42 +11:00
2017-10-11 10:21:06 -07:00
2017-12-14 09:53:09 +01:00
2017-07-02 22:46:13 -07:00
2017-04-03 15:18:17 -07:00
2017-06-19 14:11:33 -07:00
2017-09-26 10:55:19 -07:00
2017-06-19 14:11:33 -07:00
2017-09-26 10:55:19 -07:00
2017-09-26 10:55:19 -07:00
2017-09-02 08:22:19 -07:00
2016-09-22 10:56:19 +02:00
2017-06-19 14:11:34 -07:00
2017-06-19 14:11:34 -07:00
2017-09-12 20:02:22 -07:00
2017-08-04 13:43:36 -07:00
2017-06-19 14:11:33 -07:00
2017-09-02 08:22:19 -07:00
2017-10-11 10:21:06 -07:00
2017-06-19 14:11:33 -07:00
2017-06-19 08:59:10 -07:00
2017-11-02 11:10:55 +01:00
2017-10-11 10:21:06 -07:00
2017-06-27 18:23:20 -07:00
2017-10-11 10:21:06 -07:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2017-06-19 14:11:33 -07:00
2017-04-28 08:11:08 -07:00
2017-09-01 13:08:26 -07:00
2017-07-17 08:45:34 +01:00
2017-09-01 10:55:30 -07:00
2016-10-03 09:11:21 -07:00
2017-10-03 21:27:55 -07:00
2017-06-19 14:11:35 -07:00
2017-04-25 09:40:42 -07:00
2016-09-19 10:24:27 +10:00
2017-09-01 10:55:30 -07:00
2017-06-19 14:11:34 -07:00
2017-06-19 14:11:33 -07:00
2017-06-19 14:11:33 -07:00
2017-10-18 18:51:27 -04:00
2017-02-09 11:36:40 -08:00
2017-09-01 10:55:30 -07:00
2017-06-20 10:45:22 -07:00
2016-10-05 16:26:28 -07:00
2017-06-19 08:59:10 -07:00
2017-06-27 18:23:21 -07:00
2017-04-03 15:18:17 -07:00
2017-09-01 10:55:30 -07:00
2017-08-22 09:22:24 -07:00
2017-06-19 08:59:10 -07:00
2017-09-01 10:55:30 -07:00
2016-09-19 10:30:52 +10:00
2017-09-01 10:55:30 -07:00
2017-08-22 09:22:23 -07:00
2016-10-03 09:11:22 -07:00
2017-06-19 14:11:33 -07:00
2017-09-01 10:55:30 -07:00
2017-09-01 10:55:30 -07:00
2016-12-05 12:32:14 +11:00
2017-06-19 08:59:10 -07:00