On Thu, Jun 18, 2020 at 08:15:23AM -0700, Matthew Wilcox wrote: > Thinking about it, wouldn't the second test be better replaced with: > > if (WARN_ON(iomap.offset + iomap.length <= pos)) > > in case the filesystem returns an extent which finishes before pos? > This would be a superset of the test for length being 0. The idea was to tell what is wrong. Both with the initial iomap work and later the COW support I had all kinds of weird scenarious during bringup where an obvious error has been very helpful.