From 48931654004f0561f45c55f430e64150fa87cc79 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Axel=20D=C3=B6rfler?= Date: Tue, 25 Mar 2008 20:24:07 +0000 Subject: [PATCH] * Inode::OldSize() is the size of the file before the last index update - this might be a bit older, so we cannot use it for the previous size in the call to Inode::FillGapWithZeros() in bfs_write_stat(). * This fixes the perl problem Ingo ran into after r24555. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24580 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/add-ons/kernel/file_systems/bfs/kernel_interface.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/add-ons/kernel/file_systems/bfs/kernel_interface.cpp b/src/add-ons/kernel/file_systems/bfs/kernel_interface.cpp index 0a54c37767..caf0d5a9eb 100644 --- a/src/add-ons/kernel/file_systems/bfs/kernel_interface.cpp +++ b/src/add-ons/kernel/file_systems/bfs/kernel_interface.cpp @@ -729,13 +729,15 @@ bfs_write_stat(void *_ns, void *_node, const struct stat *stat, uint32 mask) return B_IS_A_DIRECTORY; if (inode->Size() != stat->st_size) { + off_t oldSize = inode->Size(); + status = inode->SetFileSize(transaction, stat->st_size); if (status < B_OK) return status; // fill the new blocks (if any) with zeros if ((mask & B_STAT_SIZE_INSECURE) == 0) - inode->FillGapWithZeros(inode->OldSize(), inode->Size()); + inode->FillGapWithZeros(oldSize, inode->Size()); if (!inode->IsDeleted()) { Index index(volume);