Commit 1ad0f42
ext4: move pagecache_isize_extended() out of active handle
In ext4_alloc_file_blocks(), pagecache_isize_extended() is called under
an active handle and may also hold folio lock if the block size is
smaller than the folio size. This also breaks the "folio lock ->
transaction start" lock ordering for the upcoming iomap buffered I/O
path.
Therefore, move pagecache_isize_extended() outside of an active handle.
Additionally, it is unnecessary to update the file length during each
iteration of the allocation loop. Instead, update the file length only
to the position where the allocation is successful. Postpone updating
the inode size until after the allocation loop completes or is
interrupted due to an error.
Signed-off-by: Zhang Yi <yi.zhang@huawei.com>
Reviewed-by: Jan Kara <jack@suse.cz>
Link: https://patch.msgid.link/20260327102939.1095257-13-yi.zhang@huaweicloud.com
Signed-off-by: Theodore Ts'o <tytso@mit.edu>1 parent 116c0bd commit 1ad0f42
1 file changed
Lines changed: 39 additions & 23 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4582 | 4582 | | |
4583 | 4583 | | |
4584 | 4584 | | |
4585 | | - | |
| 4585 | + | |
4586 | 4586 | | |
4587 | 4587 | | |
4588 | 4588 | | |
| |||
4647 | 4647 | | |
4648 | 4648 | | |
4649 | 4649 | | |
| 4650 | + | |
| 4651 | + | |
| 4652 | + | |
| 4653 | + | |
| 4654 | + | |
4650 | 4655 | | |
4651 | 4656 | | |
4652 | 4657 | | |
4653 | 4658 | | |
4654 | | - | |
4655 | | - | |
4656 | | - | |
4657 | | - | |
4658 | | - | |
4659 | | - | |
4660 | | - | |
4661 | | - | |
4662 | | - | |
4663 | | - | |
4664 | | - | |
4665 | | - | |
4666 | | - | |
4667 | | - | |
4668 | 4659 | | |
4669 | 4660 | | |
4670 | 4661 | | |
4671 | | - | |
4672 | | - | |
4673 | | - | |
4674 | | - | |
| 4662 | + | |
| 4663 | + | |
| 4664 | + | |
| 4665 | + | |
4675 | 4666 | | |
4676 | 4667 | | |
4677 | | - | |
| 4668 | + | |
4678 | 4669 | | |
4679 | 4670 | | |
4680 | 4671 | | |
4681 | | - | |
4682 | | - | |
| 4672 | + | |
| 4673 | + | |
| 4674 | + | |
4683 | 4675 | | |
| 4676 | + | |
4684 | 4677 | | |
4685 | 4678 | | |
4686 | 4679 | | |
4687 | | - | |
| 4680 | + | |
| 4681 | + | |
| 4682 | + | |
| 4683 | + | |
| 4684 | + | |
| 4685 | + | |
| 4686 | + | |
| 4687 | + | |
| 4688 | + | |
| 4689 | + | |
| 4690 | + | |
| 4691 | + | |
| 4692 | + | |
| 4693 | + | |
| 4694 | + | |
| 4695 | + | |
| 4696 | + | |
| 4697 | + | |
| 4698 | + | |
| 4699 | + | |
| 4700 | + | |
| 4701 | + | |
| 4702 | + | |
| 4703 | + | |
4688 | 4704 | | |
4689 | 4705 | | |
4690 | 4706 | | |
| |||
0 commit comments