Commit 35dc55b
xfs: handle nimaps=0 from xfs_bmapi_write in xfs_alloc_file_space
If xfs_bmapi_write finds a delalloc extent at the requested range, it
tries to convert the entire delalloc extent to a real allocation.
But if the allocator cannot find a single free extent large enough to
cover the start block of the requested range, xfs_bmapi_write will
return 0 but leave *nimaps set to 0.
In that case we simply need to keep looping with the same startoffset_fsb
so that one of the following allocations will eventually reach the
requested range.
Note that this could affect any caller of xfs_bmapi_write that covers
an existing delayed allocation. As far as I can tell we do not have
any other such caller, though - the regular writeback path uses
xfs_bmapi_convert_delalloc to convert delayed allocations to real ones,
and direct I/O invalidates the page cache first.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: "Darrick J. Wong" <djwong@kernel.org>
Signed-off-by: Chandan Babu R <chandanbabu@kernel.org>1 parent 2b99e41 commit 35dc55b
1 file changed
Lines changed: 13 additions & 11 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
774 | 774 | | |
775 | 775 | | |
776 | 776 | | |
777 | | - | |
778 | 777 | | |
779 | 778 | | |
780 | 779 | | |
781 | 780 | | |
782 | | - | |
783 | 781 | | |
784 | 782 | | |
785 | 783 | | |
| |||
802 | 800 | | |
803 | 801 | | |
804 | 802 | | |
805 | | - | |
806 | 803 | | |
807 | 804 | | |
808 | 805 | | |
| |||
813 | 810 | | |
814 | 811 | | |
815 | 812 | | |
| 813 | + | |
816 | 814 | | |
817 | 815 | | |
818 | 816 | | |
| |||
878 | 876 | | |
879 | 877 | | |
880 | 878 | | |
881 | | - | |
882 | | - | |
883 | | - | |
884 | | - | |
885 | | - | |
| 879 | + | |
| 880 | + | |
| 881 | + | |
| 882 | + | |
| 883 | + | |
| 884 | + | |
| 885 | + | |
| 886 | + | |
| 887 | + | |
| 888 | + | |
| 889 | + | |
| 890 | + | |
886 | 891 | | |
887 | | - | |
888 | | - | |
889 | | - | |
890 | 892 | | |
891 | 893 | | |
892 | 894 | | |
| |||
0 commit comments