From 0d44df455be5e01d1592f69b2ad984093712d051 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stephan=20A=C3=9Fmus?= Date: Sat, 29 Aug 2009 10:50:04 +0000 Subject: [PATCH] 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 --- src/kits/storage/Volume.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/kits/storage/Volume.cpp b/src/kits/storage/Volume.cpp index 0fca362b7c..e73e946e94 100644 --- a/src/kits/storage/Volume.cpp +++ b/src/kits/storage/Volume.cpp @@ -292,14 +292,18 @@ BVolume::SetName(const char *name) FS_WRITE_FSINFO_NAME); if (error != B_OK) return error; + // change the name of the mount point + // 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 // 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 // volume, but lives in a different directory). // 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; BEntry entry; BEntry traversedEntry; @@ -313,7 +317,7 @@ BVolume::SetName(const char *name) && traversedEntry.GetNodeRef(&entryNodeRef) == B_OK && entryNodeRef.device == fDevice && entryNodeRef.node == oldInfo.root) { - traversedEntry.Rename(name, false); + entry.Rename(name, false); } return error; }