* bfs_free_cookie() accidently reverted a transaction after having updated

the inode's internal last modified and size copies, causing in inconsistent
  data. This fixes #1643.
* The block being replayed are now dumped to the debug output.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23050 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Axel Dörfler 2007-12-02 16:38:38 +00:00
parent 653eea311d
commit 4afaeabbd8
3 changed files with 4 additions and 3 deletions

View File

@ -380,7 +380,7 @@ Journal::_ReplayRunArray(int32 *_start)
CachedBlock cached(fVolume); CachedBlock cached(fVolume);
for (int32 index = 0; index < array->CountRuns(); index++) { for (int32 index = 0; index < array->CountRuns(); index++) {
const block_run &run = array->RunAt(index); const block_run &run = array->RunAt(index);
PRINT(("replay block run %lu:%u:%u in log at %Ld!\n", INFORM(("replay block run %lu:%u:%u in log at %Ld!\n",
run.AllocationGroup(), run.Start(), run.Length(), blockNumber)); run.AllocationGroup(), run.Start(), run.Length(), blockNumber));
off_t offset = fVolume->ToOffset(run); off_t offset = fVolume->ToOffset(run);

View File

@ -1277,9 +1277,9 @@ bfs_free_cookie(void *_ns, void *_node, void *_cookie)
} }
WriteLocked locker(inode->Lock()); WriteLocked locker(inode->Lock());
status_t status = B_ERROR; status_t status = transaction.IsStarted() ? B_OK : B_ERROR;
if (transaction.IsStarted()) { if (status == B_OK) {
// trim the preallocated blocks and update the size, // trim the preallocated blocks and update the size,
// and last_modified indices if needed // and last_modified indices if needed
bool changedSize = false, changedTime = false; bool changedSize = false, changedTime = false;

View File

@ -40,6 +40,7 @@
#endif #endif
#define DEBUG_BLOCK_CACHE #define DEBUG_BLOCK_CACHE
//#define DEBUG_CHANGED
// This macro is used for fatal situations that are acceptable in a running // This macro is used for fatal situations that are acceptable in a running
// system, like out of memory situations - should only panic for debugging. // system, like out of memory situations - should only panic for debugging.