diff --git a/block/fops.c b/block/fops.c index 1ac3fa285090..41fa0c663f77 100644 --- a/block/fops.c +++ b/block/fops.c @@ -782,10 +782,11 @@ static ssize_t blkdev_write_iter(struct kiocb *iocb, struct iov_iter *from) if (iocb->ki_flags & IOCB_DIRECT) { ret = blkdev_direct_write(iocb, from); if (ret >= 0 && iov_iter_count(from)) { - if (iocb->ki_flags & IOCB_NOWAIT) { + if (iocb->ki_flags & (IOCB_NOWAIT | IOCB_ATOMIC)) { /* * The buffered fallback blocks on i_rwsem and - * on writeback of the data it copied: return + * on writeback of the data it copied, and + * can't provide torn-write protection: return * the short direct write instead and let the * caller retry. The bytes already written * still need a flush if REQ_FUA was not set.