diff options
| -rw-r--r-- | fs/iomap.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/fs/iomap.c b/fs/iomap.c index 64ce240217a1..72f3864a2e6b 100644 --- a/fs/iomap.c +++ b/fs/iomap.c | |||
| @@ -1596,12 +1596,13 @@ iomap_dio_bio_actor(struct inode *inode, loff_t pos, loff_t length, | |||
| 1596 | 1596 | ||
| 1597 | if (iomap->flags & IOMAP_F_NEW) { | 1597 | if (iomap->flags & IOMAP_F_NEW) { |
| 1598 | need_zeroout = true; | 1598 | need_zeroout = true; |
| 1599 | } else { | 1599 | } else if (iomap->type == IOMAP_MAPPED) { |
| 1600 | /* | 1600 | /* |
| 1601 | * Use a FUA write if we need datasync semantics, this | 1601 | * Use a FUA write if we need datasync semantics, this is a pure |
| 1602 | * is a pure data IO that doesn't require any metadata | 1602 | * data IO that doesn't require any metadata updates (including |
| 1603 | * updates and the underlying device supports FUA. This | 1603 | * after IO completion such as unwritten extent conversion) and |
| 1604 | * allows us to avoid cache flushes on IO completion. | 1604 | * the underlying device supports FUA. This allows us to avoid |
| 1605 | * cache flushes on IO completion. | ||
| 1605 | */ | 1606 | */ |
| 1606 | if (!(iomap->flags & (IOMAP_F_SHARED|IOMAP_F_DIRTY)) && | 1607 | if (!(iomap->flags & (IOMAP_F_SHARED|IOMAP_F_DIRTY)) && |
| 1607 | (dio->flags & IOMAP_DIO_WRITE_FUA) && | 1608 | (dio->flags & IOMAP_DIO_WRITE_FUA) && |
