Ticket #3124: panic_at_vnode_name.diff
File panic_at_vnode_name.diff, 4.2 KB (added by , 16 years ago) |
---|
-
src/system/kernel/device_manager/legacy_drivers.cpp
266 266 // the device was not present before -> publish it now 267 267 TRACE(("devfs: publishing new device \"%s\"\n", devicePaths[0])); 268 268 device = new(std::nothrow) LegacyDevice(driver, devicePaths[0], hooks); 269 270 ktrace_printf("republish_driver: driver->path=%s, " 271 "driver->name=%s, devicePaths[0]=%s\n", 272 driver->path, driver->name, devicePaths[0]); 273 269 274 if (device != NULL && device->InitCheck() == B_OK 270 275 && devfs_publish_device(devicePaths[0], device) == B_OK) { 271 276 driver->devices.Add(device); … … 281 286 continue; 282 287 283 288 TRACE(("devfs: unpublishing no more present \"%s\"\n", device->Path())); 289 ktrace_printf("republish_device: unpublishing %s\n", device->Path()); 284 290 iterator.Remove(); 285 291 286 292 devfs_unpublish_device(device, true); -
src/system/kernel/device_manager/devfs.cpp
215 215 { 216 216 struct devfs_vnode* vnode; 217 217 218 ktrace_printf("devfs_create_vnode: fs=%p, parent=%p, name=%s\n", fs,parent,name); 219 if (name[0] < 0) 220 panic("devfs_create_vnode: name[0] < 0"); 221 218 222 vnode = (struct devfs_vnode*)malloc(sizeof(struct devfs_vnode)); 219 223 if (vnode == NULL) 220 224 return NULL; … … 514 518 if (tempPath.InitCheck() != B_OK) 515 519 return B_NO_MEMORY; 516 520 521 522 ktrace_printf("publish_directory: %s\n", path); 517 523 TRACE(("devfs: publish directory \"%s\"\n", path)); 518 524 char *temp = tempPath.LockBuffer(); 519 525 … … 584 590 if (tempPath.InitCheck() != B_OK) 585 591 return B_NO_MEMORY; 586 592 593 ktrace_printf("new_node: %s\n", path); 594 587 595 char *temp = tempPath.LockBuffer(); 588 596 589 597 // create the path leading to the device … … 675 683 publish_device(struct devfs* fs, const char* path, BaseDevice* device) 676 684 { 677 685 TRACE(("publish_device(path = \"%s\", device = %p)\n", path, device)); 686 ktrace_printf("publish_device: %s\n", path); 678 687 679 688 if (sDeviceFileSystem == NULL) { 680 689 panic("publish_device() called before devfs mounted\n"); -
src/system/kernel/fs/vfs.cpp
5464 5464 char buffer[sizeof(struct dirent) + B_FILE_NAME_LENGTH]; 5465 5465 struct dirent* entry; 5466 5466 5467 bzero(&buffer, sizeof(buffer)); 5468 5467 5469 if (IS_USER_ADDRESS(userEntry)) { 5468 5470 entry = (struct dirent*)buffer; 5469 5471 if (user_memcpy(entry, userEntry, sizeof(struct dirent) - 1) != B_OK) … … 5471 5473 5472 5474 ASSERT(entry->d_reclen >= sizeof(struct dirent)); 5473 5475 5476 if ( entry->d_reclen > sizeof(buffer)) 5477 { 5478 char tmpBuf[2048]; 5479 char *pos = tmpBuf; 5480 unsigned i; 5481 5482 for (i = 0; i < entry->d_reclen - sizeof(struct dirent) + 1; i++) 5483 pos += sprintf(pos, "%02x ", (unsigned char)(userEntry->d_name[i])); 5484 5485 ktrace_printf("fix_dirent: name is %s\n", tmpBuf); 5486 5487 panic("%d = entry->d_reclen > sizeof(buffer) = %d", entry->d_reclen, (unsigned)sizeof(buffer)); 5488 5489 entry->d_reclen = sizeof(buffer) - 1; 5490 } 5491 5474 5492 if (user_memcpy(entry->d_name, userEntry->d_name, 5475 entry->d_reclen - sizeof(struct dirent) ) != B_OK)5493 entry->d_reclen - sizeof(struct dirent) + 1) != B_OK) 5476 5494 return B_BAD_ADDRESS; 5477 5495 } else 5478 5496 entry = userEntry; 5479 5497 5498 ktrace_printf("fix_dirent: _length=%p, entry=%p, parent=%p, entry->d_name=%s\n", 5499 _length, entry,parent, entry->d_name); 5480 5500 *_length = entry->d_reclen; 5481 5501 5482 5502 // set d_pdev and d_pino … … 5549 5569 if (count > 0) { 5550 5570 for (uint32 i = 0; i < count; i++) { 5551 5571 uint32 length; 5572 ktrace_printf("dir_read: cookie=%p, _count=%p, count=%d, i=%d, bufferSize=%d\n", 5573 cookie, _count, (unsigned)count, (unsigned)i, (unsigned)bufferSize); 5574 ktrace_printf("fix_dirent args: parent=%p, userEntry=%p, ioContext=%p, _length=%p\n", 5575 vnode, buffer, ioContext, &length); 5552 5576 error = fix_dirent(vnode, buffer, ioContext, &length); 5553 5577 if (error != B_OK) 5554 5578 return error;