Re: [Devel] [PATCH rh7] fs/cleancache: fix data invalidation in the cleancache during direct_io

2017-04-12 Thread Andrey Ryabinin
On 04/12/2017 05:45 PM, Andrey Ryabinin wrote: > On 04/11/2017 08:08 PM, Alexey Kuznetsov wrote: >> Hello! >> >> Good job! >> >> Before submitting this to mainstream look >> at truncate_inode_pages. >> >> It has condition: >> >> if (mapping->nrpages == 0 && mapping->nrexceptional == 0) >>

Re: [Devel] [PATCH rh7] fs/cleancache: fix data invalidation in the cleancache during direct_io

2017-04-12 Thread Andrey Ryabinin
On 04/11/2017 08:08 PM, Alexey Kuznetsov wrote: > Hello! > > Good job! > > Before submitting this to mainstream look > at truncate_inode_pages. > > It has condition: > > if (mapping->nrpages == 0 && mapping->nrexceptional == 0) > return; > > I have no idea what are those except

Re: [Devel] [PATCH rh7] fs/cleancache: fix data invalidation in the cleancache during direct_io

2017-04-11 Thread Alexey Kuznetsov
Hello! Good job! Before submitting this to mainstream look at truncate_inode_pages. It has condition: if (mapping->nrpages == 0 && mapping->nrexceptional == 0) return; I have no idea what are those exceptions are, but it definitely looks illegal to check only for nrpages in inv

[Devel] [PATCH rh7] fs/cleancache: fix data invalidation in the cleancache during direct_io

2017-04-11 Thread Andrey Ryabinin
Currently some direct_io fs hooks call invalidate_inode_pages2_range() conditionally iff mapping->nrpages is not zero. So if nrpages is zero, data in cleancache wouldn't be invalidated. So the next buffered read may get stale data from the cleancache. Fix this by calling invalidate_inode_pages2_ra