From 5850567a72f1cf604fae3465c30f4c021574bae1 Mon Sep 17 00:00:00 2001 From: "Bruno G. Albuquerque" Date: Sun, 24 May 2009 13:56:16 +0000 Subject: [PATCH] - Fix renaming a FAT volume. Note that this does not fix the fact that the volume name can be in the bpb or in a diri. The dosfs_identify_partition() only returns the label in the bpb so more usually than not it will show one name in Tracker's mount menu and a different name when mounted. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@30837 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/add-ons/kernel/file_systems/fat/dosfs.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/add-ons/kernel/file_systems/fat/dosfs.c b/src/add-ons/kernel/file_systems/fat/dosfs.c index 8053d56eea..829d4c82c1 100644 --- a/src/add-ons/kernel/file_systems/fat/dosfs.c +++ b/src/add-ons/kernel/file_systems/fat/dosfs.c @@ -1017,7 +1017,7 @@ dosfs_write_fs_stat(fs_volume *_vol, const struct fs_info * fss, uint32 mask) if ((vol->sectors_per_fat == 0 && (buffer[0x42] != 0x29 || strncmp(buffer + 0x47, vol->vol_label, 11) != 0)) || (vol->sectors_per_fat != 0 && (buffer[0x26] != 0x29 - || strncmp(buffer + 0x2b, vol->vol_label, 11) != 0))) { + || strncmp(buffer + 0x2b, vol->vol_label, 11) == 0))) { dprintf("dosfs_wfsstat: label mismatch\n"); block_cache_set_dirty(vol->fBlockCache, 0, false, tid); result = B_ERROR; @@ -1033,7 +1033,9 @@ dosfs_write_fs_stat(fs_volume *_vol, const struct fs_info * fss, uint32 mask) buffer = diri_init(vol, vol->root_vnode.cluster, vol->vol_entry, &diri); // check if it is the same as the old volume label - if ((buffer == NULL) || (strncmp(buffer, vol->vol_label, 11))) { + dprintf("buffer = %s\n", buffer); + dprintf("vol->vol_label = %s\n", vol->vol_label); + if ((buffer == NULL) || (strncmp(buffer, vol->vol_label, 11) == 0)) { dprintf("dosfs_wfsstat: label mismatch\n"); diri_free(&diri); result = B_ERROR;