Commit 5f32f3d4 authored by Dave Kleikamp's avatar Dave Kleikamp

JFS: Updated field isn't always written to disk during truncate

There is a possibility that a change to header.next is not logged
or written to disk if it is the only change to an xtree leaf page.
Signed-off-by: default avatarDave Kleikamp <shaggy@austin.ibm.com>
parent c8ba8d59
...@@ -3495,7 +3495,17 @@ s64 xtTruncate(tid_t tid, struct inode *ip, s64 newsize, int flag) ...@@ -3495,7 +3495,17 @@ s64 xtTruncate(tid_t tid, struct inode *ip, s64 newsize, int flag)
* a page that was formerly to the right, let's make sure that the * a page that was formerly to the right, let's make sure that the
* next pointer is zero. * next pointer is zero.
*/ */
if (p->header.next) {
if (log)
/*
* Make sure this change to the header is logged.
* If we really truncate this leaf, the flag
* will be changed to tlckTRUNCATE
*/
tlck = txLock(tid, ip, mp, tlckXTREE|tlckGROW);
BT_MARK_DIRTY(mp, ip);
p->header.next = 0; p->header.next = 0;
}
freed = 0; freed = 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment