ntfs: Actually return errors from fs_mount.
This should fix the "mount succeeded but ops is NULL!" panic that occurs on auto-mounting read-only NTFS disks on boot.
This commit is contained in:
@@ -355,10 +355,8 @@ fs_mount(fs_volume *_vol, const char *device, uint32 flags, const char *args,
|
|||||||
TRACE("fs_mount - ENTER\n");
|
TRACE("fs_mount - ENTER\n");
|
||||||
|
|
||||||
ns = ntfs_malloc(sizeof(nspace));
|
ns = ntfs_malloc(sizeof(nspace));
|
||||||
if (!ns) {
|
if (ns == NULL)
|
||||||
result = ENOMEM;
|
return ENOMEM;
|
||||||
goto exit;
|
|
||||||
}
|
|
||||||
|
|
||||||
*ns = (nspace) {
|
*ns = (nspace) {
|
||||||
.state = NF_FreeClustersOutdate | NF_FreeMFTOutdate,
|
.state = NF_FreeClustersOutdate | NF_FreeMFTOutdate,
|
||||||
@@ -444,7 +442,6 @@ fs_mount(fs_volume *_vol, const char *device, uint32 flags, const char *args,
|
|||||||
if (result != B_NO_ERROR) {
|
if (result != B_NO_ERROR) {
|
||||||
free(ns);
|
free(ns);
|
||||||
result = EINVAL;
|
result = EINVAL;
|
||||||
goto exit;
|
|
||||||
} else {
|
} else {
|
||||||
result = B_NO_ERROR;
|
result = B_NO_ERROR;
|
||||||
ntfs_mark_free_space_outdated(ns);
|
ntfs_mark_free_space_outdated(ns);
|
||||||
@@ -454,12 +451,7 @@ fs_mount(fs_volume *_vol, const char *device, uint32 flags, const char *args,
|
|||||||
} else
|
} else
|
||||||
free(ns);
|
free(ns);
|
||||||
|
|
||||||
TRACE("fs_mount - EXIT\n");
|
TRACE("fs_mount - EXIT, result code is %s\n", strerror(result));
|
||||||
return B_OK;
|
|
||||||
|
|
||||||
exit:
|
|
||||||
ERROR("fs_mount - EXIT, result code is %s\n", strerror(result));
|
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user