diff --git a/Kernel/FileSystem/Mount.cpp b/Kernel/FileSystem/Mount.cpp index 1f05f36c81..e934d2eb71 100644 --- a/Kernel/FileSystem/Mount.cpp +++ b/Kernel/FileSystem/Mount.cpp @@ -27,11 +27,11 @@ Mount::Mount(Inode& source, Custody& host_custody, int flags) { } -String Mount::absolute_path() const +ErrorOr> Mount::absolute_path() const { if (!m_host_custody) - return "/"; - return m_host_custody->absolute_path(); + return KString::try_create("/"sv); + return m_host_custody->try_serialize_absolute_path(); } Inode* Mount::host() diff --git a/Kernel/FileSystem/Mount.h b/Kernel/FileSystem/Mount.h index 065f2766fe..7fdf67f0c9 100644 --- a/Kernel/FileSystem/Mount.h +++ b/Kernel/FileSystem/Mount.h @@ -26,7 +26,7 @@ public: FileSystem const& guest_fs() const { return *m_guest_fs; } FileSystem& guest_fs() { return *m_guest_fs; } - String absolute_path() const; + ErrorOr> absolute_path() const; int flags() const { return m_flags; } void set_flags(int flags) { m_flags = flags; } diff --git a/Kernel/GlobalProcessExposed.cpp b/Kernel/GlobalProcessExposed.cpp index 94009c6762..378e73e1e1 100644 --- a/Kernel/GlobalProcessExposed.cpp +++ b/Kernel/GlobalProcessExposed.cpp @@ -358,7 +358,12 @@ private: fs_object.add("free_block_count", fs.free_block_count()); fs_object.add("total_inode_count", fs.total_inode_count()); fs_object.add("free_inode_count", fs.free_inode_count()); - fs_object.add("mount_point", mount.absolute_path()); + auto mount_point_or_error = mount.absolute_path(); + if (mount_point_or_error.is_error()) { + result = mount_point_or_error.release_error(); + return IterationDecision::Break; + } + fs_object.add("mount_point", mount_point_or_error.value()->view()); fs_object.add("block_size", static_cast(fs.block_size())); fs_object.add("readonly", fs.is_readonly()); fs_object.add("mount_flags", mount.flags());