diff options
author | Sergei Golubchik <serg@mariadb.org> | 2016-09-28 17:59:11 +0200 |
---|---|---|
committer | Sergei Golubchik <serg@mariadb.org> | 2016-09-28 17:59:11 +0200 |
commit | 735a4a17c2b83a214dcd5279c66cd3577ef76eb1 (patch) | |
tree | 1f283254cea2d241ea1b1422c4bc88a70ec90208 /mysys/mf_iocache.c | |
parent | 794c826244c4d8b082600afa4999130fe688aa49 (diff) | |
download | mariadb-git-735a4a17c2b83a214dcd5279c66cd3577ef76eb1.tar.gz |
MDEV-10508 Mariadb crash on out of disk space during dump import
update info->write_end and info->write_pos together, with no
"return on error" in between, otherwise write_end might end up being
smaller than write_pos
Diffstat (limited to 'mysys/mf_iocache.c')
-rw-r--r-- | mysys/mf_iocache.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/mysys/mf_iocache.c b/mysys/mf_iocache.c index daf99065eb0..4afe74da077 100644 --- a/mysys/mf_iocache.c +++ b/mysys/mf_iocache.c @@ -1825,8 +1825,6 @@ int my_b_flush_io_cache(IO_CACHE *info, int need_append_buffer_lock) if ((length=(size_t) (info->write_pos - info->write_buffer))) { - info->write_end= (info->write_buffer + info->buffer_length - - ((info->pos_in_file + length) & (IO_SIZE - 1))); if (append_cache) { @@ -1848,6 +1846,8 @@ int my_b_flush_io_cache(IO_CACHE *info, int need_append_buffer_lock) set_if_bigger(info->end_of_file, info->pos_in_file); } + info->write_end= (info->write_buffer + info->buffer_length - + ((info->pos_in_file + length) & (IO_SIZE - 1))); info->write_pos= info->write_buffer; ++info->disk_writes; UNLOCK_APPEND_BUFFER; |