Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 57bf63d6 authored by Dave Kleikamp's avatar Dave Kleikamp Committed by Linus Torvalds
Browse files

[PATCH] fs: nobh_truncate_page() fix



This fixes a regression caused by 22c8ca78.

nobh_prepare_write() no longer marks the page uptodate, so
nobh_truncate_page() needs to do it.

Signed-off-by: default avatarDave Kleikamp <shaggy@linux.vnet.ibm.com>
Cc: Nick Piggin <nickpiggin@yahoo.com.au>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 90675a27
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -2365,6 +2365,10 @@ int nobh_prepare_write(struct page *page, unsigned from, unsigned to,
}
EXPORT_SYMBOL(nobh_prepare_write);

/*
 * Make sure any changes to nobh_commit_write() are reflected in
 * nobh_truncate_page(), since it doesn't call commit_write().
 */
int nobh_commit_write(struct file *file, struct page *page,
		unsigned from, unsigned to)
{
@@ -2466,6 +2470,11 @@ int nobh_truncate_page(struct address_space *mapping, loff_t from)
		memset(kaddr + offset, 0, PAGE_CACHE_SIZE - offset);
		flush_dcache_page(page);
		kunmap_atomic(kaddr, KM_USER0);
		/*
		 * It would be more correct to call aops->commit_write()
		 * here, but this is more efficient.
		 */
		SetPageUptodate(page);
		set_page_dirty(page);
	}
	unlock_page(page);