* [PATCH] ext4: remove trivial nowait check for buffered write
@ 2020-02-01 4:00 qiwuchen55
2020-02-01 22:49 ` Theodore Y. Ts'o
0 siblings, 1 reply; 2+ messages in thread
From: qiwuchen55 @ 2020-02-01 4:00 UTC (permalink / raw)
To: tytso, adilger.kernel, trivial; +Cc: linux-ext4, chenqiwu
From: chenqiwu <chenqiwu@xiaomi.com>
Remove trivial nowait check for ext4_buffered_write_iter(),
since buffered writes will return -EINVAL if IOCB_NOWAIT
passed in the follow-up function ext4_write_checks()->
ext4_generic_write_checks()->generic_write_checks().
Signed-off-by: chenqiwu <chenqiwu@xiaomi.com>
---
fs/ext4/file.c | 3 ---
1 file changed, 3 deletions(-)
diff --git a/fs/ext4/file.c b/fs/ext4/file.c
index 5f22588..18ae435 100644
--- a/fs/ext4/file.c
+++ b/fs/ext4/file.c
@@ -258,9 +258,6 @@ static ssize_t ext4_buffered_write_iter(struct kiocb *iocb,
ssize_t ret;
struct inode *inode = file_inode(iocb->ki_filp);
- if (iocb->ki_flags & IOCB_NOWAIT)
- return -EOPNOTSUPP;
-
inode_lock(inode);
ret = ext4_write_checks(iocb, from);
if (ret <= 0)
--
1.9.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] ext4: remove trivial nowait check for buffered write
2020-02-01 4:00 [PATCH] ext4: remove trivial nowait check for buffered write qiwuchen55
@ 2020-02-01 22:49 ` Theodore Y. Ts'o
0 siblings, 0 replies; 2+ messages in thread
From: Theodore Y. Ts'o @ 2020-02-01 22:49 UTC (permalink / raw)
To: qiwuchen55; +Cc: adilger.kernel, trivial, linux-ext4, chenqiwu
On Sat, Feb 01, 2020 at 12:00:39PM +0800, qiwuchen55@gmail.com wrote:
> From: chenqiwu <chenqiwu@xiaomi.com>
>
> Remove trivial nowait check for ext4_buffered_write_iter(),
> since buffered writes will return -EINVAL if IOCB_NOWAIT
> passed in the follow-up function ext4_write_checks()->
> ext4_generic_write_checks()->generic_write_checks().
>
> Signed-off-by: chenqiwu <chenqiwu@xiaomi.com>
The reason why we do this check here is so that we return immediately
and not potentially block when we call inode_lock(). Otherwise, an
AIO request with IOCB_NOWAIT could block, and that's not allowed.
- Ted
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2020-02-01 22:50 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-02-01 4:00 [PATCH] ext4: remove trivial nowait check for buffered write qiwuchen55
2020-02-01 22:49 ` Theodore Y. Ts'o
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).