Commit fb265c9
committed
ext4: add ext4_sb_bread() to disambiguate ENOMEM cases
Today, when sb_bread() returns NULL, this can either be because of an
I/O error or because the system failed to allocate the buffer. Since
it's an old interface, changing would require changing many call
sites.
So instead we create our own ext4_sb_bread(), which also allows us to
set the REQ_META flag.
Also fixed a problem in the xattr code where a NULL return in a
function could also mean that the xattr was not found, which could
lead to the wrong error getting returned to userspace.
Fixes: ac27a0e ("ext4: initial copy of files from ext3")
Cc: stable@kernel.org # 2.6.19
Signed-off-by: Theodore Ts'o <tytso@mit.edu>1 parent 2e6e902 commit fb265c9
5 files changed
+115
-94
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2538 | 2538 | | |
2539 | 2539 | | |
2540 | 2540 | | |
| 2541 | + | |
| 2542 | + | |
2541 | 2543 | | |
2542 | 2544 | | |
2543 | 2545 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
116 | 116 | | |
117 | 117 | | |
118 | 118 | | |
119 | | - | |
120 | | - | |
121 | | - | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
122 | 122 | | |
123 | 123 | | |
124 | 124 | | |
| |||
145 | 145 | | |
146 | 146 | | |
147 | 147 | | |
148 | | - | |
149 | | - | |
150 | | - | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
151 | 151 | | |
152 | 152 | | |
153 | 153 | | |
| |||
175 | 175 | | |
176 | 176 | | |
177 | 177 | | |
178 | | - | |
179 | | - | |
180 | | - | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
181 | 181 | | |
182 | 182 | | |
183 | 183 | | |
| |||
224 | 224 | | |
225 | 225 | | |
226 | 226 | | |
227 | | - | |
228 | | - | |
229 | | - | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
230 | 230 | | |
231 | 231 | | |
232 | 232 | | |
| |||
254 | 254 | | |
255 | 255 | | |
256 | 256 | | |
257 | | - | |
258 | | - | |
259 | | - | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
260 | 260 | | |
261 | 261 | | |
262 | 262 | | |
| |||
382 | 382 | | |
383 | 383 | | |
384 | 384 | | |
385 | | - | |
386 | | - | |
387 | | - | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
388 | 388 | | |
389 | 389 | | |
390 | 390 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
127 | 127 | | |
128 | 128 | | |
129 | 129 | | |
130 | | - | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
131 | 133 | | |
132 | 134 | | |
133 | | - | |
| 135 | + | |
134 | 136 | | |
135 | 137 | | |
136 | 138 | | |
| |||
781 | 783 | | |
782 | 784 | | |
783 | 785 | | |
784 | | - | |
785 | | - | |
786 | | - | |
| 786 | + | |
| 787 | + | |
| 788 | + | |
787 | 789 | | |
788 | | - | |
| 790 | + | |
789 | 791 | | |
790 | 792 | | |
791 | 793 | | |
| |||
794 | 796 | | |
795 | 797 | | |
796 | 798 | | |
797 | | - | |
798 | | - | |
799 | | - | |
| 799 | + | |
| 800 | + | |
| 801 | + | |
800 | 802 | | |
801 | 803 | | |
802 | 804 | | |
803 | 805 | | |
804 | | - | |
| 806 | + | |
805 | 807 | | |
806 | 808 | | |
807 | 809 | | |
808 | | - | |
809 | | - | |
810 | | - | |
811 | | - | |
| 810 | + | |
| 811 | + | |
| 812 | + | |
| 813 | + | |
| 814 | + | |
812 | 815 | | |
813 | 816 | | |
814 | 817 | | |
815 | 818 | | |
816 | 819 | | |
817 | 820 | | |
818 | 821 | | |
819 | | - | |
| 822 | + | |
820 | 823 | | |
821 | 824 | | |
822 | 825 | | |
823 | 826 | | |
824 | 827 | | |
825 | | - | |
| 828 | + | |
826 | 829 | | |
827 | 830 | | |
828 | 831 | | |
829 | 832 | | |
830 | | - | |
| 833 | + | |
831 | 834 | | |
832 | 835 | | |
833 | 836 | | |
| |||
837 | 840 | | |
838 | 841 | | |
839 | 842 | | |
840 | | - | |
| 843 | + | |
841 | 844 | | |
842 | 845 | | |
843 | 846 | | |
| |||
846 | 849 | | |
847 | 850 | | |
848 | 851 | | |
849 | | - | |
| 852 | + | |
850 | 853 | | |
851 | 854 | | |
852 | 855 | | |
| |||
862 | 865 | | |
863 | 866 | | |
864 | 867 | | |
865 | | - | |
| 868 | + | |
866 | 869 | | |
867 | 870 | | |
868 | 871 | | |
| |||
871 | 874 | | |
872 | 875 | | |
873 | 876 | | |
874 | | - | |
875 | | - | |
| 877 | + | |
876 | 878 | | |
877 | 879 | | |
878 | 880 | | |
| |||
888 | 890 | | |
889 | 891 | | |
890 | 892 | | |
891 | | - | |
892 | 893 | | |
893 | | - | |
894 | | - | |
| 894 | + | |
895 | 895 | | |
896 | 896 | | |
897 | | - | |
898 | 897 | | |
899 | | - | |
900 | 898 | | |
901 | 899 | | |
902 | 900 | | |
| |||
916 | 914 | | |
917 | 915 | | |
918 | 916 | | |
919 | | - | |
920 | | - | |
921 | | - | |
| 917 | + | |
| 918 | + | |
| 919 | + | |
922 | 920 | | |
923 | 921 | | |
924 | 922 | | |
| |||
975 | 973 | | |
976 | 974 | | |
977 | 975 | | |
978 | | - | |
979 | | - | |
980 | | - | |
| 976 | + | |
| 977 | + | |
| 978 | + | |
| 979 | + | |
981 | 980 | | |
982 | 981 | | |
983 | 982 | | |
| |||
996 | 995 | | |
997 | 996 | | |
998 | 997 | | |
999 | | - | |
1000 | | - | |
1001 | | - | |
| 998 | + | |
| 999 | + | |
| 1000 | + | |
| 1001 | + | |
1002 | 1002 | | |
1003 | 1003 | | |
1004 | 1004 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
140 | 140 | | |
141 | 141 | | |
142 | 142 | | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
143 | 166 | | |
144 | 167 | | |
145 | 168 | | |
| |||
0 commit comments