From 4ae2ca820d721cbd21686521e9f9e8c39fc22ea9 Mon Sep 17 00:00:00 2001 From: Ksawlii Date: Fri, 13 Dec 2024 19:44:18 +0100 Subject: [PATCH] Revert "io_uring/rw: fix missing NOWAIT check for O_DIRECT start write" This reverts commit bb5321e6e0a9a1af8ffb211725d6959bac156abd. --- io_uring/io_uring.c | 23 ++--------------------- 1 file changed, 2 insertions(+), 21 deletions(-) diff --git a/io_uring/io_uring.c b/io_uring/io_uring.c index 3a80c0d52..3b2c6b77b 100755 --- a/io_uring/io_uring.c +++ b/io_uring/io_uring.c @@ -3738,25 +3738,6 @@ static int io_write_prep(struct io_kiocb *req, const struct io_uring_sqe *sqe) return io_prep_rw(req, sqe, WRITE); } -static bool io_kiocb_start_write(struct io_kiocb *req, struct kiocb *kiocb) -{ - struct inode *inode; - bool ret; - - if (!(req->flags & REQ_F_ISREG)) - return true; - if (!(kiocb->ki_flags & IOCB_NOWAIT)) { - kiocb_start_write(kiocb); - return true; - } - - inode = file_inode(kiocb->ki_filp); - ret = sb_start_write_trylock(inode->i_sb); - if (ret) - __sb_writers_release(inode->i_sb, SB_FREEZE_WRITE); - return ret; -} - static int io_write(struct io_kiocb *req, unsigned int issue_flags) { struct iovec inline_vecs[UIO_FASTIOV], *iovec = inline_vecs; @@ -3803,8 +3784,8 @@ static int io_write(struct io_kiocb *req, unsigned int issue_flags) if (unlikely(ret)) goto out_free; - if (unlikely(!io_kiocb_start_write(req, kiocb))) - goto copy_iov; + if (req->flags & REQ_F_ISREG) + kiocb_start_write(kiocb); kiocb->ki_flags |= IOCB_WRITE; if (req->file->f_op->write_iter)