Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-26601

Incorrect use of O_TMPFILE

    XMLWordPrintable

    Details

      Description

      I noticed this line in mysql.err:

      2021-09-13 16:11:44 0 [Note] mysqld: O_TMPFILE is not supported on /tmp (disabling future attempts)
      

      However, /tmp is a tmpfs which does support O_TMPFILE. The issue is that mysqld calls open incorrectly:

      [pid 11696] openat(AT_FDCWD, "/tmp", O_RDWR|O_CREAT|O_TRUNC|O_CLOEXEC|O_TMPFILE, 0660) = -1 EINVAL
      [pid 11696] openat(AT_FDCWD, "/tmp/ibMbcqxC", O_RDWR|O_CREAT|O_EXCL|O_CLOEXEC, 0600) = 8
      [pid 11696] unlink("/tmp/ibMbcqxC")     = 0
      

      Either O_CREAT or O_TMPFILE can be specified, but not both at the same time. This effectively makes the O_TMPFILE support dead code.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              danblack Daniel Black
              Reporter:
              fvogt Fabian Vogt
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:

                  Git Integration