Commit 2e81a4e
ext4: avoid deadlock when expanding inode size
When we need to move xattrs into external xattr block, we call
ext4_xattr_block_set() from ext4_expand_extra_isize_ea(). That may end
up calling ext4_mark_inode_dirty() again which will recurse back into
the inode expansion code leading to deadlocks.
Protect from recursion using EXT4_STATE_NO_EXPAND inode flag and move
its management into ext4_expand_extra_isize_ea() since its manipulation
is safe there (due to xattr_sem) from possible races with
ext4_xattr_set_handle() which plays with it as well.
CC: stable@vger.kernel.org # 4.4.x
Signed-off-by: Jan Kara <jack@suse.cz>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>1 parent 443a8c4 commit 2e81a4e
2 files changed
+13
-8
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5466 | 5466 | | |
5467 | 5467 | | |
5468 | 5468 | | |
5469 | | - | |
5470 | | - | |
5471 | 5469 | | |
5472 | 5470 | | |
5473 | 5471 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1358 | 1358 | | |
1359 | 1359 | | |
1360 | 1360 | | |
| 1361 | + | |
| 1362 | + | |
| 1363 | + | |
| 1364 | + | |
1361 | 1365 | | |
1362 | 1366 | | |
1363 | | - | |
1364 | | - | |
1365 | | - | |
1366 | | - | |
| 1367 | + | |
| 1368 | + | |
1367 | 1369 | | |
1368 | 1370 | | |
1369 | 1371 | | |
| |||
1392 | 1394 | | |
1393 | 1395 | | |
1394 | 1396 | | |
1395 | | - | |
1396 | | - | |
| 1397 | + | |
1397 | 1398 | | |
1398 | 1399 | | |
1399 | 1400 | | |
| |||
1553 | 1554 | | |
1554 | 1555 | | |
1555 | 1556 | | |
| 1557 | + | |
| 1558 | + | |
1556 | 1559 | | |
1557 | 1560 | | |
1558 | 1561 | | |
| |||
1564 | 1567 | | |
1565 | 1568 | | |
1566 | 1569 | | |
| 1570 | + | |
| 1571 | + | |
| 1572 | + | |
| 1573 | + | |
1567 | 1574 | | |
1568 | 1575 | | |
1569 | 1576 | | |
| |||
0 commit comments