diff options
author | Christoph Hellwig <hch@lst.de> | 2020-02-21 15:37:23 +0100 |
---|---|---|
committer | Damien Le Moal <damien.lemoal@wdc.com> | 2020-02-26 08:57:35 +0100 |
commit | 7c69eb84d98a28c428f902318c20c53cf29c9084 (patch) | |
tree | 674f4411f5b60f68a8604e9fbf7192ff286382e7 /fs/zonefs | |
parent | zonefs: fix documentation typos etc. (diff) | |
download | linux-7c69eb84d98a28c428f902318c20c53cf29c9084.tar.xz linux-7c69eb84d98a28c428f902318c20c53cf29c9084.zip |
zonefs: fix IOCB_NOWAIT handling
IOCB_NOWAIT can't just be ignored as it breaks applications expecting
it not to block. Just refuse the operation as applications must handle
that (e.g. by falling back to a thread pool).
Fixes: 8dcc1a9d90c1 ("fs: New zonefs file system")
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Damien Le Moal <damien.lemoal@wdc.com>
Diffstat (limited to 'fs/zonefs')
-rw-r--r-- | fs/zonefs/super.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/fs/zonefs/super.c b/fs/zonefs/super.c index 8bc6ef82d693..69aee3dfb660 100644 --- a/fs/zonefs/super.c +++ b/fs/zonefs/super.c @@ -601,13 +601,13 @@ static ssize_t zonefs_file_dio_write(struct kiocb *iocb, struct iov_iter *from) ssize_t ret; /* - * For async direct IOs to sequential zone files, ignore IOCB_NOWAIT + * For async direct IOs to sequential zone files, refuse IOCB_NOWAIT * as this can cause write reordering (e.g. the first aio gets EAGAIN * on the inode lock but the second goes through but is now unaligned). */ - if (zi->i_ztype == ZONEFS_ZTYPE_SEQ && !is_sync_kiocb(iocb) - && (iocb->ki_flags & IOCB_NOWAIT)) - iocb->ki_flags &= ~IOCB_NOWAIT; + if (zi->i_ztype == ZONEFS_ZTYPE_SEQ && !is_sync_kiocb(iocb) && + (iocb->ki_flags & IOCB_NOWAIT)) + return -EOPNOTSUPP; if (iocb->ki_flags & IOCB_NOWAIT) { if (!inode_trylock(inode)) |