Darrick J. Wong
1eeb1edfd3
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:28:23 +01:00
..
2017-11-30 08:39:05 +00:00
2016-10-10 20:16:43 -07:00
2016-10-10 20:16:43 -07:00
2017-03-15 10:02:44 +08:00
2017-11-30 08:39:03 +00:00
2016-10-15 12:09:13 -07:00
2016-10-10 23:02:51 -04:00
2017-12-14 09:28:12 +01:00
2016-10-10 20:16:43 -07:00
2017-11-02 09:49:13 +01:00
2017-11-08 10:08:31 +01:00
2017-11-24 08:33:42 +01:00
2017-06-24 07:11:12 +02:00
2017-11-30 08:39:11 +00:00
2017-08-06 18:59:43 -07:00
2016-10-10 20:16:43 -07:00
2017-09-09 17:39:40 +02:00
2017-11-30 08:39:03 +00:00
2016-10-10 20:16:43 -07:00
2016-10-27 18:43:43 -07:00
2016-10-06 09:07:44 -04:00
2017-07-27 15:08:02 -07:00
2017-11-30 08:39:11 +00:00
2017-11-30 08:39:11 +00:00
2017-03-15 10:02:52 +08:00
2017-10-27 10:38:11 +02:00
2017-11-02 09:49:13 +01:00
2017-10-08 10:26:02 +02:00
2016-10-10 20:16:43 -07:00
2017-07-27 15:08:07 -07:00
2016-10-10 20:16:43 -07:00
2016-10-10 20:16:43 -07:00
2017-10-08 10:26:09 +02:00
2017-11-30 08:39:04 +00:00
2017-03-30 09:41:27 +02:00
2016-10-10 20:16:43 -07:00
2017-08-06 18:59:39 -07:00
2016-10-27 17:47:11 +02:00
2017-11-30 08:39:06 +00:00
2016-10-10 20:16:43 -07:00
2016-10-10 20:16:43 -07:00
2016-10-10 20:16:43 -07:00
2017-12-14 09:28:23 +01:00
2017-12-05 11:24:32 +01:00
2017-11-30 08:39:03 +00:00
2017-08-06 18:59:43 -07:00
2016-10-30 13:09:42 -04:00
2017-11-24 08:33:42 +01:00
2016-10-10 20:16:43 -07:00
2016-09-27 21:06:21 -04:00
2017-09-27 14:39:18 +02:00
2017-07-27 15:08:07 -07:00
2017-10-05 09:43:58 +02:00
2017-08-06 18:59:43 -07:00
2016-08-15 17:43:31 +02:00
2016-10-10 20:16:43 -07:00
2017-07-27 15:08:08 -07:00
2017-06-17 06:41:56 +02:00
2016-10-07 21:48:36 -04:00
2017-04-12 12:41:11 +02:00
2016-10-10 20:16:43 -07:00
2016-09-27 21:06:21 -04:00
2017-07-27 15:08:04 -07:00
2017-07-27 15:08:06 -07:00
2017-06-14 15:06:01 +02:00
2017-12-14 09:28:23 +01:00
2017-07-05 14:40:26 +02:00
2016-10-10 20:16:43 -07:00
2017-01-09 08:32:24 +01:00
2016-07-25 16:51:49 +10:00
2017-07-21 07:42:21 +02:00
2016-08-02 19:35:15 -04:00
2016-07-28 13:29:12 +10:00
2016-09-27 21:06:22 -04:00
2017-10-18 09:35:39 +02:00
2017-06-14 15:06:00 +02:00
2016-08-23 22:58:51 -07:00
2016-09-24 09:27:18 +02:00
2016-09-27 21:20:53 -04:00
2017-07-05 14:40:26 +02:00
2017-12-09 22:01:49 +01:00
2017-08-06 18:59:43 -07:00
2017-10-18 09:35:41 +02:00
2017-09-07 08:35:41 +02:00
2017-07-21 07:42:22 +02:00
2017-07-12 15:01:02 +02:00
2016-09-27 18:47:38 -04:00
2016-08-09 19:58:06 -06:00
2017-09-20 08:20:01 +02:00
2017-09-20 08:20:01 +02:00
2016-09-15 13:29:52 -07:00
2017-09-20 08:19:59 +02:00
2016-10-07 18:46:29 -07:00
2016-08-12 16:47:05 +01:00
2017-12-09 22:01:51 +01:00
2016-10-18 12:21:28 +02:00
2016-08-31 11:44:36 -04:00
2017-07-21 07:42:22 +02:00
2017-10-18 09:35:39 +02:00
2017-11-08 10:08:36 +01:00
2017-07-21 07:42:22 +02:00
2016-10-10 20:16:43 -07:00
2017-07-12 15:01:02 +02:00
2016-10-11 15:06:32 -07:00
2017-07-21 07:42:22 +02:00
2017-03-15 10:02:43 +08:00
2017-01-26 08:24:37 +01:00
2017-10-12 11:51:26 +02:00
2016-10-11 15:06:30 -07:00
2016-10-07 18:46:30 -07:00
2017-02-23 17:44:35 +01:00
2017-06-14 15:06:01 +02:00
2017-03-15 10:02:44 +08:00
2017-05-08 07:47:54 +02:00
2017-06-17 06:41:56 +02:00
2016-10-08 11:06:08 -04:00
2017-10-12 11:51:19 +02:00