This adds a PageDirty check to the writeback path that locks pages
for delalloc. If a page wasn't dirty at this point, it is in the
process of being truncated away.
Signed-off-by: Chris Mason <chris.mason@oracle.com>
*/
if (pages[i] != locked_page) {
lock_page(pages[i]);
- if (pages[i]->mapping != inode->i_mapping) {
+ if (!PageDirty(pages[i]) ||
+ pages[i]->mapping != inode->i_mapping) {
ret = -EAGAIN;
unlock_page(pages[i]);
page_cache_release(pages[i]);