Commit c6f1401
xfs: fix fsmap for internal zoned devices
Filesystems with an internal zoned rt section use xfs_rtblock_t values
that are relative to the start of the data device. When fsmap reports
on internal rt sections, it reports the space used by the data section
as "OWN_FS".
Unfortunately, the logic for resuming a query isn't quite right, so
xfs/273 fails because it stress-tests GETFSMAP with a single-record
buffer. If we enter the "report fake space as OWN_FS" block with a
nonzero key[0].fmr_length, we should add that to key[0].fmr_physical
and recheck if we still need to emit the fake record. We should /not/
just return 0 from the whole function because that prevents all rmap
record iteration.
If we don't enter that block, the resumption is still wrong.
keys[*].fmr_physical is a reflection of what we copied out to userspace
on a previous query, which means that it already accounts for rgstart.
It is not correct to add rtstart_daddr when computing start_rtb or
end_rtb, so stop that.
While we're at it, add a xfs_has_zoned to make it clear that this is a
zoned filesystem thing.
Fixes: e50ec7f ("xfs: enable fsmap reporting for internal RT devices")
Signed-off-by: Darrick J. Wong <[email protected]>
Reviewed-by: Christoph Hellwig <[email protected]>
Signed-off-by: Carlos Maiolino <[email protected]>1 parent 1c40652 commit c6f1401
1 file changed
+33
-18
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
876 | 876 | | |
877 | 877 | | |
878 | 878 | | |
| 879 | + | |
879 | 880 | | |
880 | 881 | | |
881 | 882 | | |
| |||
887 | 888 | | |
888 | 889 | | |
889 | 890 | | |
890 | | - | |
| 891 | + | |
891 | 892 | | |
892 | 893 | | |
| 894 | + | |
| 895 | + | |
| 896 | + | |
| 897 | + | |
| 898 | + | |
| 899 | + | |
| 900 | + | |
| 901 | + | |
893 | 902 | | |
894 | | - | |
| 903 | + | |
895 | 904 | | |
896 | 905 | | |
897 | 906 | | |
898 | 907 | | |
899 | 908 | | |
900 | | - | |
901 | | - | |
902 | | - | |
903 | | - | |
| 909 | + | |
| 910 | + | |
| 911 | + | |
| 912 | + | |
| 913 | + | |
| 914 | + | |
| 915 | + | |
| 916 | + | |
| 917 | + | |
| 918 | + | |
| 919 | + | |
| 920 | + | |
904 | 921 | | |
905 | 922 | | |
906 | | - | |
907 | | - | |
908 | | - | |
909 | | - | |
| 923 | + | |
| 924 | + | |
| 925 | + | |
| 926 | + | |
910 | 927 | | |
911 | 928 | | |
912 | | - | |
913 | | - | |
914 | | - | |
915 | | - | |
| 929 | + | |
| 930 | + | |
916 | 931 | | |
917 | 932 | | |
918 | 933 | | |
919 | 934 | | |
920 | 935 | | |
921 | 936 | | |
922 | 937 | | |
923 | | - | |
924 | | - | |
| 938 | + | |
| 939 | + | |
925 | 940 | | |
926 | 941 | | |
927 | | - | |
928 | | - | |
| 942 | + | |
| 943 | + | |
929 | 944 | | |
930 | 945 | | |
931 | 946 | | |
| |||
0 commit comments