The code didn't follow the comment above it. For the /boot partition, a link

in / is created with the partition content name, pointing to /boot, where the
volume is actually mounted for real. The code is supposed to rename the link
in this case, not the actual folder. Added a note about the special case when
the boot volume is actually named "boot", in which case there will not be a
separate link. Then renaming /boot is prevented in the kernel now.

This commit completes the fix for ticket #4365.

+alphabranch


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32807 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Stephan Aßmus
2009-08-29 10:50:04 +00:00
parent 8c5ad61d4b
commit 0d44df455b
+6 -2
View File
@@ -292,14 +292,18 @@ BVolume::SetName(const char *name)
FS_WRITE_FSINFO_NAME); FS_WRITE_FSINFO_NAME);
if (error != B_OK) if (error != B_OK)
return error; return error;
// change the name of the mount point // change the name of the mount point
// R5 implementation checks, if an entry with the volume's old name // R5 implementation checks, if an entry with the volume's old name
// exists in the root directory and renames that entry, if it is indeed // exists in the root directory and renames that entry, if it is indeed
// the mount point of the volume (or a link referring to it). In all other // the mount point of the volume (or a link referring to it). In all other
// cases, nothing is done (even if the mount point is named like the // cases, nothing is done (even if the mount point is named like the
// volume, but lives in a different directory). // volume, but lives in a different directory).
// We follow suit for the time being. // We follow suit for the time being.
// create the entry // NOTE: If the volume name itself is actually "boot", then this code
// tries to rename /boot, but that is prevented in the kernel.
BPath entryPath; BPath entryPath;
BEntry entry; BEntry entry;
BEntry traversedEntry; BEntry traversedEntry;
@@ -313,7 +317,7 @@ BVolume::SetName(const char *name)
&& traversedEntry.GetNodeRef(&entryNodeRef) == B_OK && traversedEntry.GetNodeRef(&entryNodeRef) == B_OK
&& entryNodeRef.device == fDevice && entryNodeRef.device == fDevice
&& entryNodeRef.node == oldInfo.root) { && entryNodeRef.node == oldInfo.root) {
traversedEntry.Rename(name, false); entry.Rename(name, false);
} }
return error; return error;
} }