summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@mariadb.com>2022-12-15 12:45:26 +0200
committerMarko Mäkelä <marko.makela@mariadb.com>2022-12-15 12:45:26 +0200
commit92ff7bb63fee54a932ca0b7d8092af5aac1ded57 (patch)
tree8e2b5c1aa4718f4ed7aebc2b0283f0b59b0bb803
parent03fee585c12cb6bc9e2e03b9c182fa4c6dad88b7 (diff)
downloadmariadb-git-92ff7bb63fee54a932ca0b7d8092af5aac1ded57.tar.gz
MDEV-30227 [ERROR] [FATAL] InnoDB: fdatasync() returned 9
fil_space_t::flush<false>(): If the CLOSING flag is set, the file may already have been closed, resulting in EBADF being returned by fdatasync(). In any case, the thread that had set the flag should take care of invoking os_file_flush_func(). The crash occurred during the execution of FLUSH TABLES...FOR EXPORT. Tested by: Matthias Leich
-rw-r--r--storage/innobase/include/fil0fil.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/storage/innobase/include/fil0fil.h b/storage/innobase/include/fil0fil.h
index bcbcb02ccdb..af941e359f8 100644
--- a/storage/innobase/include/fil0fil.h
+++ b/storage/innobase/include/fil0fil.h
@@ -1469,9 +1469,10 @@ template<bool have_reference> inline void fil_space_t::flush()
}
else if (have_reference)
flush_low();
- else if (!(acquire_low() & STOPPING))
+ else
{
- flush_low();
+ if (!(acquire_low() & (STOPPING | CLOSING)))
+ flush_low();
release();
}
}