Message ID | 20231123125121.4064694-16-yi.zhang@huaweicloud.com (mailing list archive) |
---|---|
State | New |
Headers | show |
Series | ext4: use iomap for regular file's buffered IO path and enable large foilo | expand |
diff --git a/fs/ext4/extents.c b/fs/ext4/extents.c index 52bad225e3c8..b502edcf014b 100644 --- a/fs/ext4/extents.c +++ b/fs/ext4/extents.c @@ -4576,6 +4576,15 @@ static long ext4_zero_range(struct file *file, loff_t offset, if (ret) goto out_mutex; + ret = filemap_write_and_wait_range(mapping, + round_down(offset, 1 << blkbits), offset); + if (ret) + goto out_mutex; + + ret = filemap_write_and_wait_range(mapping, offset + len, + round_up((offset + len), 1 << blkbits)); + if (ret) + goto out_mutex; } /* Zero range excluding the unaligned edges */