summaryrefslogtreecommitdiff
path: root/android-mainline/ANDROID-Revert-io_uring-remove-the-mode-variable-in-io_file_get_flags.patch
blob: 331830998785b51272d1af6e9cbd8ec090a3f795 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Andr=C3=A9=20Draszik?= <draszik@google.com>
Date: Thu, 13 Jul 2023 10:37:21 +0100
Subject: ANDROID: Revert "io_uring: remove the mode variable in
 io_file_get_flags"
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

This reverts commit 53cfd5cea7f36bac7f3d45de4fea77e0c8d57aee.

We want to revert caec5ebe77f9 ("io_uring: rely solely on
FMODE_NOWAIT") and doing this revert here will help to do so more
cleanly.

Test: manual boot test, TH
Bug: 290862678
Change-Id: I9590f35e8bafead20d9f8acb19784d4e3fc6d148
Signed-off-by: André Draszik <draszik@google.com>
(cherry picked from commit 2b9e8acfb0766d22a310810b4334896b1bcc0c2c)
Signed-off-by: Lee Jones <joneslee@google.com>
---
 io_uring/io_uring.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/io_uring/io_uring.c b/io_uring/io_uring.c
--- a/io_uring/io_uring.c
+++ b/io_uring/io_uring.c
@@ -1755,9 +1755,10 @@ static void io_iopoll_req_issued(struct io_kiocb *req, unsigned int issue_flags)
 
 unsigned int io_file_get_flags(struct file *file)
 {
+	umode_t mode = file_inode(file)->i_mode;
 	unsigned int res = 0;
 
-	if (S_ISREG(file_inode(file)->i_mode))
+	if (S_ISREG(mode))
 		res |= REQ_F_ISREG;
 	if ((file->f_flags & O_NONBLOCK) || (file->f_mode & FMODE_NOWAIT))
 		res |= REQ_F_SUPPORT_NOWAIT;