[Commits] 11f18bb: Add missing WAIT_ALLOW_WRITES() calls to os0file.cc

Jan Lindström jan.lindstrom at mariadb.com
Fri Oct 14 08:40:34 EEST 2016


revision-id: 11f18bb834a852817b375633832ca1a041c95f7b (mariadb-10.2.2-41-g11f18bb)
parent(s): 123710d5a1f23da8d391168328890edf35738d2a
author: Jan Lindström
committer: Jan Lindström
timestamp: 2016-10-14 08:40:14 +0300
message:

Add missing WAIT_ALLOW_WRITES() calls to os0file.cc

---
 storage/innobase/os/os0file.cc | 38 +++++++++++++++++++++++++++++++++-----
 1 file changed, 33 insertions(+), 5 deletions(-)

diff --git a/storage/innobase/os/os0file.cc b/storage/innobase/os/os0file.cc
index 6b934db..47c7ea4 100644
--- a/storage/innobase/os/os0file.cc
+++ b/storage/innobase/os/os0file.cc
@@ -1636,6 +1636,7 @@ os_file_create_tmpfile(
 	const char*	path)
 {
 	FILE*	file	= NULL;
+	WAIT_ALLOW_WRITES();
 	int	fd	= innobase_mysql_tmpfile(path);
 
 	if (fd >= 0) {
@@ -3182,6 +3183,7 @@ os_file_flush_func(
 {
 	int	ret;
 
+	WAIT_ALLOW_WRITES();
 	ret = os_file_fsync_posix(file);
 
 	if (ret == 0) {
@@ -3233,6 +3235,10 @@ os_file_create_simple_func(
 	int		create_flag;
 	const char*	mode_str	= NULL;
 
+	if (create_mode != OS_FILE_OPEN && create_mode != OS_FILE_OPEN_RAW) {
+		WAIT_ALLOW_WRITES();
+	}
+
 	ut_a(!(create_mode & OS_FILE_ON_ERROR_SILENT));
 	ut_a(!(create_mode & OS_FILE_ON_ERROR_NO_EXIT));
 
@@ -3368,7 +3374,10 @@ os_file_create_directory(
 	const char*	pathname,
 	bool		fail_if_exists)
 {
-	int	rcode = mkdir(pathname, 0770);
+	int	rcode;
+
+	WAIT_ALLOW_WRITES();
+	rcode = mkdir(pathname, 0770);
 
 	if (!(rcode == 0 || (errno == EEXIST && !fail_if_exists))) {
 		/* failure */
@@ -3747,6 +3756,10 @@ os_file_create_simple_no_error_handling_func(
 	os_file_t	file;
 	int		create_flag;
 
+	if (create_mode != OS_FILE_OPEN && create_mode != OS_FILE_OPEN_RAW) {
+		WAIT_ALLOW_WRITES();
+	}
+
 	ut_a(!(create_mode & OS_FILE_ON_ERROR_SILENT));
 	ut_a(!(create_mode & OS_FILE_ON_ERROR_NO_EXIT));
 
@@ -3820,7 +3833,10 @@ os_file_delete_if_exists_func(
 		*exist = true;
 	}
 
-	int	ret = unlink(name);
+	int	ret;
+	WAIT_ALLOW_WRITES();
+
+	ret = unlink(name);
 
 	if (ret != 0 && errno == ENOENT) {
 		if (exist != NULL) {
@@ -3842,7 +3858,10 @@ bool
 os_file_delete_func(
 	const char*	name)
 {
-	int	ret = unlink(name);
+	int	ret;
+	WAIT_ALLOW_WRITES();
+
+	ret = unlink(name);
 
 	if (ret != 0) {
 		os_file_handle_error_no_exit(name, "delete", FALSE);
@@ -3878,7 +3897,10 @@ os_file_rename_func(
 	ut_ad(exists);
 #endif /* UNIV_DEBUG */
 
-	int	ret = rename(oldpath, newpath);
+	int	ret;
+	WAIT_ALLOW_WRITES();
+
+	ret = rename(oldpath, newpath);
 
 	if (ret != 0) {
 		os_file_handle_error_no_exit(oldpath, "rename", FALSE);
@@ -4063,6 +4085,7 @@ bool
 os_file_set_eof(
 	FILE*		file)	/*!< in: file to be truncated */
 {
+	WAIT_ALLOW_WRITES();
 	return(!ftruncate(fileno(file), ftell(file)));
 }
 
@@ -4826,6 +4849,10 @@ os_file_create_func(
 	DWORD		create_flag;
 	DWORD		share_mode = FILE_SHARE_READ;
 
+	if (create_mode != OS_FILE_OPEN && create_mode != OS_FILE_OPEN_RAW) {
+		WAIT_ALLOW_WRITES();
+	}
+
 	on_error_no_exit = create_mode & OS_FILE_ON_ERROR_NO_EXIT
 		? true : false;
 
@@ -5741,7 +5768,8 @@ os_file_write_page(
 
 	ut_ad(type.validate());
 	ut_ad(n > 0);
-	
+
+	WAIT_ALLOW_WRITES();
 	ssize_t	n_bytes = os_file_pwrite(type, file, buf, n, offset, &err);
 
 	if ((ulint) n_bytes != n && !os_has_said_disk_full) {


More information about the commits mailing list