diff --git a/src/add-ons/kernel/file_systems/bfs/Volume.cpp b/src/add-ons/kernel/file_systems/bfs/Volume.cpp index 6e6a57d9d0..62ce2ca6d1 100644 --- a/src/add-ons/kernel/file_systems/bfs/Volume.cpp +++ b/src/add-ons/kernel/file_systems/bfs/Volume.cpp @@ -359,15 +359,21 @@ Volume::Mount(const char *deviceName, uint32 flags) return B_ERROR; fJournal = new Journal(this); - // replaying the log is the first thing we will do on this disk - if ((fJournal != NULL && fJournal->InitCheck() < B_OK) - || fBlockAllocator.Initialize() < B_OK) { - // ToDo: improve error reporting for a bad journal - FATAL(("could not initialize journal/block bitmap allocator!\n")); + if (fJournal == NULL) return B_NO_MEMORY; + + // replaying the log is the first thing we will do on this disk + status_t status = fJournal->InitCheck(); + if (status < B_OK) { + FATAL(("could not initialize journal: %s!\n", strerror(status))); + return status; } - status_t status = B_OK; + status = fBlockAllocator.Initialize(); + if (status < B_OK) { + FATAL(("could not initialize block bitmap allocator!\n")); + return status; + } fRootNode = new Inode(this, ToVnode(Root())); if (fRootNode && fRootNode->InitCheck() == B_OK) { diff --git a/src/add-ons/kernel/file_systems/bfs/kernel_interface.cpp b/src/add-ons/kernel/file_systems/bfs/kernel_interface.cpp index 7de4b0cfe0..157630fcb9 100644 --- a/src/add-ons/kernel/file_systems/bfs/kernel_interface.cpp +++ b/src/add-ons/kernel/file_systems/bfs/kernel_interface.cpp @@ -114,17 +114,18 @@ bfs_mount(dev_t mountID, const char *device, uint32 flags, const char *args, if (volume == NULL) return B_NO_MEMORY; - status_t status; - if ((status = volume->Mount(device, flags)) == B_OK) { - *_data = volume; - *_rootID = volume->ToVnode(volume->Root()); - INFORM(("mounted \"%s\" (root node at %Ld, device = %s)\n", - volume->Name(), *_rootID, device)); - } - else + status_t status = volume->Mount(device, flags); + if (status != B_OK) { delete volume; + RETURN_ERROR(status); + } - RETURN_ERROR(status); + *_data = volume; + *_rootID = volume->ToVnode(volume->Root()); + + INFORM(("mounted \"%s\" (root node at %Ld, device = %s)\n", + volume->Name(), *_rootID, device)); + return B_OK; }