diff options
author | Sergei Golubchik <serg@mariadb.org> | 2017-02-20 22:40:47 +0100 |
---|---|---|
committer | Sergei Golubchik <serg@mariadb.org> | 2017-02-27 12:35:10 +0100 |
commit | d72dbb41229ceb6434ecd3e23d559bb7b39dd15f (patch) | |
tree | fab72e0fca0e0b1d8d29ebfa13b6c21c5df10430 /include | |
parent | 955f2f036d6252b90e2bffcec521dd4a7db0a30a (diff) | |
download | mariadb-git-d72dbb41229ceb6434ecd3e23d559bb7b39dd15f.tar.gz |
bugfix: remove my_delete_with_symlink()
it was race condition prone. instead use either a pair of my_delete()
calls with already resolved paths, or a safe high-level function
my_handler_delete_with_symlink(), like MyISAM and Aria already do.
Diffstat (limited to 'include')
-rw-r--r-- | include/my_sys.h | 1 | ||||
-rw-r--r-- | include/mysql/psi/mysql_file.h | 41 |
2 files changed, 0 insertions, 42 deletions
diff --git a/include/my_sys.h b/include/my_sys.h index 261d68deaab..10551e119ac 100644 --- a/include/my_sys.h +++ b/include/my_sys.h @@ -578,7 +578,6 @@ extern int my_realpath(char *to, const char *filename, myf MyFlags); extern File my_create_with_symlink(const char *linkname, const char *filename, int createflags, int access_flags, myf MyFlags); -extern int my_delete_with_symlink(const char *name, myf MyFlags); extern int my_rename_with_symlink(const char *from,const char *to,myf MyFlags); extern int my_symlink(const char *content, const char *linkname, myf MyFlags); extern int my_handler_delete_with_symlink(PSI_file_key key, const char *name, diff --git a/include/mysql/psi/mysql_file.h b/include/mysql/psi/mysql_file.h index 6fc6689c47d..4a0f3fdd68b 100644 --- a/include/mysql/psi/mysql_file.h +++ b/include/mysql/psi/mysql_file.h @@ -435,20 +435,6 @@ #endif /** - @def mysql_file_delete_with_symlink(K, P1, P2) - Instrumented delete with symbolic link. - @c mysql_file_delete_with_symlink is a replacement - for @c my_delete_with_symlink. -*/ -#ifdef HAVE_PSI_INTERFACE - #define mysql_file_delete_with_symlink(K, P1, P2) \ - inline_mysql_file_delete_with_symlink(K, __FILE__, __LINE__, P1, P2) -#else - #define mysql_file_delete_with_symlink(K, P1, P2) \ - inline_mysql_file_delete_with_symlink(P1, P2) -#endif - -/** @def mysql_file_rename_with_symlink(K, P1, P2, P3) Instrumented rename with symbolic link. @c mysql_file_rename_with_symlink is a replacement @@ -1349,33 +1335,6 @@ inline_mysql_file_create_with_symlink( } static inline int -inline_mysql_file_delete_with_symlink( -#ifdef HAVE_PSI_INTERFACE - PSI_file_key key, const char *src_file, uint src_line, -#endif - const char *name, myf flags) -{ - int result; -#ifdef HAVE_PSI_INTERFACE - struct PSI_file_locker *locker= NULL; - PSI_file_locker_state state; - if (likely(PSI_server != NULL)) - { - locker= PSI_server->get_thread_file_name_locker(&state, key, PSI_FILE_DELETE, - name, &locker); - if (likely(locker != NULL)) - PSI_server->start_file_wait(locker, (size_t) 0, src_file, src_line); - } -#endif - result= my_delete_with_symlink(name, flags); -#ifdef HAVE_PSI_INTERFACE - if (likely(locker != NULL)) - PSI_server->end_file_wait(locker, (size_t) 0); -#endif - return result; -} - -static inline int inline_mysql_file_rename_with_symlink( #ifdef HAVE_PSI_INTERFACE PSI_file_key key, const char *src_file, uint src_line, |