summary refs log tree commit diff
path: root/io_uring/openclose.c
diff options
context:
space:
mode:
Diffstat (limited to 'io_uring/openclose.c')
-rw-r--r--io_uring/openclose.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/io_uring/openclose.c b/io_uring/openclose.c
index 67178e4bb282..008990e58180 100644
--- a/io_uring/openclose.c
+++ b/io_uring/openclose.c
@@ -110,9 +110,11 @@ int io_openat2(struct io_kiocb *req, unsigned int issue_flags)
 	if (issue_flags & IO_URING_F_NONBLOCK) {
 		/*
 		 * Don't bother trying for O_TRUNC, O_CREAT, or O_TMPFILE open,
-		 * it'll always -EAGAIN
+		 * it'll always -EAGAIN. Note that we test for __O_TMPFILE
+		 * because O_TMPFILE includes O_DIRECTORY, which isn't a flag
+		 * we need to force async for.
 		 */
-		if (open->how.flags & (O_TRUNC | O_CREAT | O_TMPFILE))
+		if (open->how.flags & (O_TRUNC | O_CREAT | __O_TMPFILE))
 			return -EAGAIN;
 		op.lookup_flags |= LOOKUP_CACHED;
 		op.open_flag |= O_NONBLOCK;