You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In testing I ran into a crash in vmfs-fuse (the 0.2.5 version) when mounting a volume with some linked clone VMs on it. I have a patch below, and can submit a pull request if you like, but since this project doesn't seem active I wanted to check here fist. The backtrace from the core was this:
(gdb) bt
#0 vmfs_inode_get_block (inode=0x60d8c0, pos=0, blk_id=0x7fffb322a3fc) at libvmfs/vmfs_inode.c:314 #1 0x0000000000404609 in vmfs_file_pread (f=0x60dda0, buf=0x7fffb322a600 "", len=512, pos=0)
at libvmfs/vmfs_file.c:149 #2 0x0000000000402a23 in vmfs_bitmap_open_from_file (f=0x60dda0) at libvmfs/vmfs_bitmap.c:521 #3 0x0000000000404ee2 in vmfs_open_all_meta_files (fs=0x60c380) at libvmfs/vmfs_fs.c:124 #4 vmfs_read_fdc_base (fs=0x60c380) at libvmfs/vmfs_fs.c:187 #5 0x0000000000405355 in vmfs_fs_open (paths=Unhandled dwarf expression opcode 0xf3
) at libvmfs/vmfs_fs.c:255 #6 0x0000000000401999 in main (argc=Unhandled dwarf expression opcode 0xf3
) at vmfs-fuse/vmfs-fuse.c:498
The crash was caused by this line in vmfs_inode.c:
DECL_ALIGNED_BUFFER_WOL(buf,fs->pbc->bmh.data_size);
buf.fs->pbc is null here, because the init code is reading the FBB file - it hasn't processed the PBC file yet. The following patch will fix the problem by reorganizing the code to read the PBC file first. This doesn't seem to cause any other problems.
diff --git a/libvmfs/vmfs_fs.c b/libvmfs/vmfs_fs.c
index f355526..36750fb 100644
--- a/libvmfs/vmfs_fs.c
+++ b/libvmfs/vmfs_fs.c
@@ -121,6 +121,14 @@ static int vmfs_open_all_meta_files(vmfs_fs_t *fs)
return(-1);
}
+ /* Read pbc first, because FBB may have blocks in it that will require access
+ to the pbc to read. */
+ fs->pbc = vmfs_open_meta_file(root_dir, VMFS_PBC_FILENAME,
+ VMFS_BLK_PB_MAX_ITEM, VMFS_BLK_PB_MAX_ENTRY,
+ "pointer block bitmap (PBC)");
+ if (!fs->pbc)
+ return(-1);
+
if (!(fs->fbb = vmfs_bitmap_open_at(root_dir,VMFS_FBB_FILENAME))) {
fprintf(stderr,"Unable to open file-block bitmap (FBB).\n");
return(-1);
@@ -136,12 +144,6 @@ static int vmfs_open_all_meta_files(vmfs_fs_t *fs)
if (!fs->fdc)
return(-1);
- fs->pbc = vmfs_open_meta_file(root_dir, VMFS_PBC_FILENAME,
- VMFS_BLK_PB_MAX_ITEM, VMFS_BLK_PB_MAX_ENTRY,
- "pointer block bitmap (PBC)");
- if (!fs->pbc)
- return(-1);
-
fs->sbc = vmfs_open_meta_file(root_dir, VMFS_SBC_FILENAME,
VMFS_BLK_SB_MAX_ITEM, VMFS_BLK_SB_MAX_ENTRY,
"pointer block bitmap (PBC)");
The text was updated successfully, but these errors were encountered:
In testing I ran into a crash in vmfs-fuse (the 0.2.5 version) when mounting a volume with some linked clone VMs on it. I have a patch below, and can submit a pull request if you like, but since this project doesn't seem active I wanted to check here fist. The backtrace from the core was this:
(gdb) bt
#0 vmfs_inode_get_block (inode=0x60d8c0, pos=0, blk_id=0x7fffb322a3fc) at libvmfs/vmfs_inode.c:314
#1 0x0000000000404609 in vmfs_file_pread (f=0x60dda0, buf=0x7fffb322a600 "", len=512, pos=0)
at libvmfs/vmfs_file.c:149
#2 0x0000000000402a23 in vmfs_bitmap_open_from_file (f=0x60dda0) at libvmfs/vmfs_bitmap.c:521
#3 0x0000000000404ee2 in vmfs_open_all_meta_files (fs=0x60c380) at libvmfs/vmfs_fs.c:124
#4 vmfs_read_fdc_base (fs=0x60c380) at libvmfs/vmfs_fs.c:187
#5 0x0000000000405355 in vmfs_fs_open (paths=Unhandled dwarf expression opcode 0xf3
) at libvmfs/vmfs_fs.c:255
#6 0x0000000000401999 in main (argc=Unhandled dwarf expression opcode 0xf3
) at vmfs-fuse/vmfs-fuse.c:498
The crash was caused by this line in vmfs_inode.c:
DECL_ALIGNED_BUFFER_WOL(buf,fs->pbc->bmh.data_size);
buf.fs->pbc is null here, because the init code is reading the FBB file - it hasn't processed the PBC file yet. The following patch will fix the problem by reorganizing the code to read the PBC file first. This doesn't seem to cause any other problems.
The text was updated successfully, but these errors were encountered: