Skip to contentSkip to conversation

ext4: remove trivial nowait check for buffered write

PATCH In review [email protected] 2 participants 2 messages Feb 1, 2020 ext4 file system

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ext4: remove trivial nowait check for buffered write

From: chenqiwu <[email protected]>

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().

---
 fs/ext4/file.c | 3 ---
 1 file changed, 3 deletions(-)
fs/ext4/file.c +0 -3
index 5f22588..18ae435 100644
@@ -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)
Signature · 1 line
1.9.1
maintainer
#1 lore raw
Quoted 8 lines · On Sat, Feb 01, 2020 at 12:00:39PM +0800, [email protected] wrote:

From: chenqiwu <[email protected]>

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().

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