Re: [RFC PATCH V4] iomap: add support to track dirty state of sub pages

From: yukuai (C)
Date: Thu Sep 24 2020 - 22:30:41 EST



On 2020/09/11 20:05, Matthew Wilcox wrote:
@@ -683,7 +736,7 @@ static size_t __iomap_write_end(struct inode *inode,
loff_t pos, size_t len,
if (unlikely(copied < len && !PageUptodate(page)))
return 0;
iomap_set_range_uptodate(page, offset_in_page(pos), len);
- iomap_set_page_dirty(page);
+ iomap_set_range_dirty(page, offset_in_page(pos), len);
I_think_ the call to set_range_uptodate here is now unnecessary. The
blocks should already have been set uptodate in write_begin. But please
check!

Hi, Matthew

Sorry it took me so long to get back to this.

I found that set_range_uptodate() might be skipped in write_begin()
in this case:

if (!(flags & IOMAP_WRITE_F_UNSHARE) &&
┊ (from <= poff || from >= poff + plen) &&
┊ (to <= poff || to >= poff + plen))
continue;

And iomap_adjust_read_range() can set 'poff' greater than 'from'
and 'poff + len' less than 'to'.

Thanks
Yu Kuai