Commit 2f1aeab
btrfs: return accurate error code on open failure in open_fs_devices()
When attempting to exclusive open a device which has no exclusive open
permission, such as a physical device associated with the flakey dm
device, the open operation will fail, resulting in a mount failure.
In this particular scenario, we erroneously return -EINVAL instead of the
correct error code provided by the bdev_open_by_path() function, which is
-EBUSY.
Fix this, by returning error code from the bdev_open_by_path() function.
With this correction, the mount error message will align with that of
ext4 and xfs.
Reviewed-by: Boris Burkov <[email protected]>
Signed-off-by: Anand Jain <[email protected]>
Reviewed-by: David Sterba <[email protected]>
Signed-off-by: David Sterba <[email protected]>1 parent a8b70c7 commit 2f1aeab
1 file changed
+12
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1184 | 1184 | | |
1185 | 1185 | | |
1186 | 1186 | | |
| 1187 | + | |
1187 | 1188 | | |
1188 | 1189 | | |
1189 | 1190 | | |
1190 | | - | |
| 1191 | + | |
1191 | 1192 | | |
1192 | | - | |
1193 | | - | |
| 1193 | + | |
| 1194 | + | |
1194 | 1195 | | |
1195 | 1196 | | |
1196 | | - | |
| 1197 | + | |
1197 | 1198 | | |
1198 | 1199 | | |
1199 | 1200 | | |
1200 | 1201 | | |
| 1202 | + | |
| 1203 | + | |
1201 | 1204 | | |
1202 | | - | |
| 1205 | + | |
| 1206 | + | |
| 1207 | + | |
| 1208 | + | |
1203 | 1209 | | |
| 1210 | + | |
1204 | 1211 | | |
1205 | 1212 | | |
1206 | 1213 | | |
| |||
0 commit comments