]> git.saurik.com Git - apple/xnu.git/blobdiff - bsd/hfs/hfs_vfsutils.c
xnu-1228.7.58.tar.gz
[apple/xnu.git] / bsd / hfs / hfs_vfsutils.c
index 0433aec327d9680d229052864cf5d203b3eb8fba..736ab6199549cfdfde83c23ff271908a9561b9c5 100644 (file)
@@ -243,13 +243,6 @@ OSErr hfs_MountHFSVolume(struct hfsmount *hfsmp, HFSMasterDirectoryBlock *mdb,
        /* mark the volume dirty (clear clean unmount bit) */
        vcb->vcbAtrb &= ~kHFSVolumeUnmountedMask;
 
-       /*
-        * all done with system files so we can unlock now...
-        */
-       hfs_unlock(VTOC(hfsmp->hfs_allocation_vp));
-       hfs_unlock(VTOC(hfsmp->hfs_catalog_vp));
-       hfs_unlock(VTOC(hfsmp->hfs_extents_vp));
-
     if (error == noErr)
       {
                error = cat_idlookup(hfsmp, kHFSRootFolderID, 0, NULL, NULL, NULL);
@@ -262,6 +255,14 @@ OSErr hfs_MountHFSVolume(struct hfsmount *hfsmp, HFSMasterDirectoryBlock *mdb,
             MarkVCBDirty( vcb );                                                               //      mark VCB dirty so it will be written
           }
       }
+
+       /*
+        * all done with system files so we can unlock now...
+        */
+       hfs_unlock(VTOC(hfsmp->hfs_allocation_vp));
+       hfs_unlock(VTOC(hfsmp->hfs_catalog_vp));
+       hfs_unlock(VTOC(hfsmp->hfs_extents_vp));
+
     goto       CmdDone;
 
     //--       Release any resources allocated so far before exiting with an error: