Re: [PATCH] iomap: Ensure iop->uptodate matches PageUptodate

2020-07-28 Thread Matthew Wilcox
On Tue, Jul 28, 2020 at 10:23:01AM +0100, Christoph Hellwig wrote: > On Mon, Jul 27, 2020 at 09:53:35AM +1000, Dave Chinner wrote: > > Yes, I understand the code accepts it can happen; what I dislike is > > code that asserts subtle behaviour can happen, then doesn't describe > > that exactly

Re: [PATCH] iomap: Ensure iop->uptodate matches PageUptodate

2020-07-28 Thread Christoph Hellwig
On Mon, Jul 27, 2020 at 09:53:35AM +1000, Dave Chinner wrote: > Yes, I understand the code accepts it can happen; what I dislike is > code that asserts subtle behaviour can happen, then doesn't describe > that exactly why/how that condition can occur. And then, because we > don't know exactly how

Re: [PATCH] iomap: Ensure iop->uptodate matches PageUptodate

2020-07-26 Thread Dave Chinner
On Mon, Jul 27, 2020 at 12:20:22AM +0100, Matthew Wilcox wrote: > On Mon, Jul 27, 2020 at 09:06:57AM +1000, Dave Chinner wrote: > > On Sun, Jul 26, 2020 at 10:10:52AM +0100, Matthew Wilcox (Oracle) wrote: > > > If the filesystem has block size < page size and we end up calling > > >

Re: [PATCH] iomap: Ensure iop->uptodate matches PageUptodate

2020-07-26 Thread Matthew Wilcox
On Mon, Jul 27, 2020 at 09:06:57AM +1000, Dave Chinner wrote: > On Sun, Jul 26, 2020 at 10:10:52AM +0100, Matthew Wilcox (Oracle) wrote: > > If the filesystem has block size < page size and we end up calling > > iomap_page_create() in iomap_page_mkwrite_actor(), the uptodate bits > > would be

Re: [PATCH] iomap: Ensure iop->uptodate matches PageUptodate

2020-07-26 Thread Dave Chinner
On Sun, Jul 26, 2020 at 10:10:52AM +0100, Matthew Wilcox (Oracle) wrote: > If the filesystem has block size < page size and we end up calling > iomap_page_create() in iomap_page_mkwrite_actor(), the uptodate bits > would be zero, which causes us to skip writeback of blocks which are > !uptodate in

Re: [PATCH] iomap: Ensure iop->uptodate matches PageUptodate

2020-07-26 Thread Christoph Hellwig
On Sun, Jul 26, 2020 at 10:10:52AM +0100, Matthew Wilcox (Oracle) wrote: > If the filesystem has block size < page size and we end up calling > iomap_page_create() in iomap_page_mkwrite_actor(), the uptodate bits > would be zero, which causes us to skip writeback of blocks which are > !uptodate in

[PATCH] iomap: Ensure iop->uptodate matches PageUptodate

2020-07-26 Thread Matthew Wilcox (Oracle)
If the filesystem has block size < page size and we end up calling iomap_page_create() in iomap_page_mkwrite_actor(), the uptodate bits would be zero, which causes us to skip writeback of blocks which are !uptodate in iomap_writepage_map(). This can lead to user data loss. Found using