mirror of
https://github.com/RGBCube/serenity
synced 2025-07-10 06:27:35 +00:00
Kernel/SysFS: Fix parent directory hierarchy with symbolic links
We should actually start counting from the parent directory and not from the symbolic link as it will represent a wrong count of hops from the actual mountpoint. The symlinks in /sys/dev/block and /sys/dev/char worked only by luck, because I have set it to the wrong parent directory which is the /sys/dev directory, so with the symlink it was 3 hops to /sys, together with the root directory, therefore, everything seemed to work. Now that the device symlinks in /sys/dev/block and /sys/dev/char are set to the right parent directory and we start measure hops from root directory with the parent directory of a symlink, everything seem to work correctly now.
This commit is contained in:
parent
7e6e7d67a9
commit
60f7d61ad2
5 changed files with 30 additions and 8 deletions
|
@ -91,7 +91,8 @@ static ErrorOr<NonnullOwnPtr<KString>> generate_return_path_to_mount_point(Nonnu
|
|||
|
||||
ErrorOr<NonnullOwnPtr<KString>> SysFSSymbolicLink::try_generate_return_path_to_mount_point() const
|
||||
{
|
||||
auto hops_from_mountpoint = TRY(relative_path_hops_count_from_mountpoint());
|
||||
VERIFY(m_parent_directory);
|
||||
auto hops_from_mountpoint = TRY(m_parent_directory->relative_path_hops_count_from_mountpoint());
|
||||
if (hops_from_mountpoint == 0)
|
||||
return KString::try_create("./"sv);
|
||||
auto start_return_path = TRY(KString::try_create("./"sv));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue