Jan Kara 50b556a1ce udf: Fix lock ordering in udf_evict_inode()
[ Upstream commit 8832fc1e502687869606bb0a7b79848ed3bf036f ]

udf_evict_inode() calls udf_setsize() to truncate deleted inode.
However inode deletion through udf_evict_inode() can happen from inode
reclaim context and udf_setsize() grabs mapping->invalidate_lock which
isn't generally safe to acquire from fs reclaim context since we
allocate pages under mapping->invalidate_lock for example in a page
fault path.  This is however not a real deadlock possibility as by the
time udf_evict_inode() is called, nobody can be accessing the inode,
even less work with its page cache. So this is just a lockdep triggering
false positive. Fix the problem by moving mapping->invalidate_lock
locking outsize of udf_setsize() into udf_setattr() as grabbing
mapping->invalidate_lock from udf_evict_inode() is pointless.

Reported-by: syzbot+0333a6f4b88bcd68a62f@syzkaller.appspotmail.com
Fixes: b9a861fd527a ("udf: Protect truncate and file type conversion with invalidate_lock")
Signed-off-by: Jan Kara <jack@suse.cz>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-08-03 08:59:36 +02:00
..
2024-05-29 09:25:15 -07:00
2024-07-02 21:23:00 +02:00
2024-01-11 20:11:35 -08:00
2024-07-12 12:08:42 -07:00
2024-05-13 14:14:05 -07:00
2024-05-20 13:23:43 -07:00
2024-05-23 12:04:36 -07:00
2024-05-21 09:51:42 -07:00
2023-12-29 11:58:34 -08:00
2024-05-21 09:51:42 -07:00
2024-07-27 11:40:32 +02:00
2024-07-11 09:03:28 -07:00
2024-06-28 09:32:33 -07:00
2024-07-27 11:40:32 +02:00
2024-03-27 13:17:15 +01:00
2024-04-23 13:27:43 +02:00
2024-03-12 20:03:34 -07:00
2024-05-02 20:35:57 +02:00
2023-10-30 19:28:19 -10:00
2024-05-21 09:51:42 -07:00
2024-05-23 12:04:36 -07:00
2024-04-25 20:56:20 -07:00
2024-07-11 09:03:28 -07:00
2024-05-10 08:26:31 +02:00
2024-03-12 20:03:34 -07:00
2024-03-15 09:00:09 -07:00
2024-05-02 20:35:57 +02:00
2024-04-17 13:49:44 +02:00
2024-03-11 10:21:06 -07:00
2024-03-13 12:53:53 -07:00
2024-07-01 09:22:08 -07:00
2024-02-02 13:11:49 +01:00
2024-03-12 20:03:34 -07:00
2024-05-02 16:28:20 +02:00
2024-05-24 13:34:07 +02:00
2024-03-26 09:01:18 +01:00
2024-04-10 16:23:02 -06:00
2024-02-15 23:43:47 -05:00