Skip to content

Commit 57bf63d

Browse files
Dave KleikampLinus Torvalds
authored andcommitted
[PATCH] fs: nobh_truncate_page() fix
This fixes a regression caused by 22c8ca7. nobh_prepare_write() no longer marks the page uptodate, so nobh_truncate_page() needs to do it. Signed-off-by: Dave Kleikamp <shaggy@linux.vnet.ibm.com> Cc: Nick Piggin <nickpiggin@yahoo.com.au> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1 parent 90675a2 commit 57bf63d

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

‎fs/buffer.c‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2365,6 +2365,10 @@ int nobh_prepare_write(struct page *page, unsigned from, unsigned to,
23652365
}
23662366
EXPORT_SYMBOL(nobh_prepare_write);
23672367

2368+
/*
2369+
* Make sure any changes to nobh_commit_write() are reflected in
2370+
* nobh_truncate_page(), since it doesn't call commit_write().
2371+
*/
23682372
int nobh_commit_write(struct file *file, struct page *page,
23692373
unsigned from, unsigned to)
23702374
{
@@ -2466,6 +2470,11 @@ int nobh_truncate_page(struct address_space *mapping, loff_t from)
24662470
memset(kaddr + offset, 0, PAGE_CACHE_SIZE - offset);
24672471
flush_dcache_page(page);
24682472
kunmap_atomic(kaddr, KM_USER0);
2473+
/*
2474+
* It would be more correct to call aops->commit_write()
2475+
* here, but this is more efficient.
2476+
*/
2477+
SetPageUptodate(page);
24692478
set_page_dirty(page);
24702479
}
24712480
unlock_page(page);

0 commit comments

Comments
 (0)