diff options
author | Mike Buland <mike@xagasoft.com> | 2024-08-05 12:44:59 -0700 |
---|---|---|
committer | Mike Buland <mike@xagasoft.com> | 2024-08-05 12:44:59 -0700 |
commit | caee572ff94822ca2ed354fcb79ca04ed9adf388 (patch) | |
tree | 4d5253c310e99a09852863024250a22d810ead7b /src/unstable | |
parent | 5f183d4a0e7caa529db09f32848314360cecfd91 (diff) | |
download | libbu++-0.0.1.tar.gz libbu++-0.0.1.tar.bz2 libbu++-0.0.1.tar.xz libbu++-0.0.1.zip |
Perhaps fixed a Myriad race condition.0.0.1
If so, this will fix the issue where streams randomly truncate when
accessed by multiple threads.
Diffstat (limited to '')
-rw-r--r-- | src/unstable/myriadfs.cpp | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/src/unstable/myriadfs.cpp b/src/unstable/myriadfs.cpp index b24997a..991c21d 100644 --- a/src/unstable/myriadfs.cpp +++ b/src/unstable/myriadfs.cpp | |||
@@ -476,7 +476,7 @@ Bu::MyriadFs::Dir Bu::MyriadFs::readDir( int32_t iNode ) | |||
476 | 476 | ||
477 | Bu::MyriadStream is = mStore.openStream( 2 ); | 477 | Bu::MyriadStream is = mStore.openStream( 2 ); |
478 | Dir lDir; | 478 | Dir lDir; |
479 | sio << "Reading dir " << iNode << ", " << iNumChildren << " entries:" << sio.nl; | 479 | // sio << "Reading dir " << iNode << ", " << iNumChildren << " entries:" << sio.nl; |
480 | for( int32_t j = 0; j < iNumChildren; j++ ) | 480 | for( int32_t j = 0; j < iNumChildren; j++ ) |
481 | { | 481 | { |
482 | int32_t iChildNode = 0; | 482 | int32_t iChildNode = 0; |
@@ -485,7 +485,6 @@ Bu::MyriadFs::Dir Bu::MyriadFs::readDir( int32_t iNode ) | |||
485 | throw Bu::MyriadFsException( | 485 | throw Bu::MyriadFsException( |
486 | "Failed to read iChildNode from directory."); | 486 | "Failed to read iChildNode from directory."); |
487 | } | 487 | } |
488 | Bu::println(" - iNode = %1").arg( iChildNode ); | ||
489 | Stat s; | 488 | Stat s; |
490 | stat( iChildNode, s, is ); | 489 | stat( iChildNode, s, is ); |
491 | uint8_t uLen; | 490 | uint8_t uLen; |
@@ -494,14 +493,12 @@ Bu::MyriadFs::Dir Bu::MyriadFs::readDir( int32_t iNode ) | |||
494 | throw Bu::MyriadFsException( | 493 | throw Bu::MyriadFsException( |
495 | "Failed to read uLen from directory."); | 494 | "Failed to read uLen from directory."); |
496 | } | 495 | } |
497 | Bu::println(" - Name bytes = %1").arg( uLen ); | ||
498 | s.sName.setSize( uLen ); | 496 | s.sName.setSize( uLen ); |
499 | if( ms.read( s.sName.getStr(), uLen ) < uLen ) | 497 | if( ms.read( s.sName.getStr(), uLen ) < uLen ) |
500 | { | 498 | { |
501 | throw Bu::MyriadFsException( | 499 | throw Bu::MyriadFsException( |
502 | "Failed to read sName from directory."); | 500 | "Failed to read sName from directory."); |
503 | } | 501 | } |
504 | Bu::println(" - Name = \"%1\"").arg( s.sName ); | ||
505 | lDir.append( s ); | 502 | lDir.append( s ); |
506 | 503 | ||
507 | // sio << " " << s.sName << sio.nl; | 504 | // sio << " " << s.sName << sio.nl; |
@@ -519,8 +516,6 @@ Bu::MyriadStream Bu::MyriadFs::openByInode( int32_t iNode ) | |||
519 | case typeDir: | 516 | case typeDir: |
520 | case typeSymLink: | 517 | case typeSymLink: |
521 | case typeRegFile: | 518 | case typeRegFile: |
522 | Bu::println("Opening stream by iNode=%1, myriad stream=%2") | ||
523 | .arg( iNode ).arg( rs.uStreamIndex ); | ||
524 | return mStore.openStream( rs.uStreamIndex ); | 519 | return mStore.openStream( rs.uStreamIndex ); |
525 | 520 | ||
526 | default: | 521 | default: |