summaryrefslogtreecommitdiff
path: root/storage
diff options
context:
space:
mode:
authorOleksandr Byelkin <sanja@mariadb.com>2018-01-11 12:59:30 +0100
committerOleksandr Byelkin <sanja@mariadb.com>2018-01-11 17:24:29 +0100
commitabb9e703d22b640390ab611dacdcc58ca26e19ba (patch)
tree63a2443ec66bf56852ca66171828d88db9858bf7 /storage
parent1f18bd630a6b29b427dc5da01077e4f20fb60e01 (diff)
downloadmariadb-git-abb9e703d22b640390ab611dacdcc58ca26e19ba.tar.gz
MDEV-14690: Assertion `page_link == &fake_link' failed in pagecache_write_part
Fix the call to correspond protocoll of pagecache call. Fix of misleading variables names.
Diffstat (limited to 'storage')
-rw-r--r--storage/maria/ma_page.c40
1 files changed, 29 insertions, 11 deletions
diff --git a/storage/maria/ma_page.c b/storage/maria/ma_page.c
index ed62a80e4f7..0e494e22c5b 100644
--- a/storage/maria/ma_page.c
+++ b/storage/maria/ma_page.c
@@ -229,17 +229,35 @@ my_bool _ma_write_keypage(MARIA_PAGE *page, enum pagecache_page_lock lock,
#endif
page_cleanup(share, page);
- res= pagecache_write(share->pagecache,
- &share->kfile,
- (pgcache_page_no_t) (page->pos / block_size),
- level, buff, share->page_type,
- lock,
- lock == PAGECACHE_LOCK_LEFT_WRITELOCKED ?
- PAGECACHE_PIN_LEFT_PINNED :
- (lock == PAGECACHE_LOCK_WRITE_UNLOCK ?
- PAGECACHE_UNPIN : PAGECACHE_PIN),
- PAGECACHE_WRITE_DELAY, &page_link.link,
- LSN_IMPOSSIBLE);
+ {
+ PAGECACHE_BLOCK_LINK **link;
+ enum pagecache_page_pin pin;
+ if (lock == PAGECACHE_LOCK_LEFT_WRITELOCKED)
+ {
+ pin= PAGECACHE_PIN_LEFT_PINNED;
+ link= &page_link.link;
+ }
+ else if (lock == PAGECACHE_LOCK_WRITE_UNLOCK)
+ {
+ pin= PAGECACHE_UNPIN;
+ /*
+ We unlock this page so link should be 0 to prevent it usage
+ even accidentally
+ */
+ link= NULL;
+ }
+ else
+ {
+ pin= PAGECACHE_PIN;
+ link= &page_link.link;
+ }
+ res= pagecache_write(share->pagecache,
+ &share->kfile,
+ (pgcache_page_no_t) (page->pos / block_size),
+ level, buff, share->page_type,
+ lock, pin, PAGECACHE_WRITE_DELAY, link,
+ LSN_IMPOSSIBLE);
+ }
if (lock == PAGECACHE_LOCK_WRITE)
{