Skip to content

Commit 70ef385

Browse files
dhowellssmfrench
authored andcommitted
cifs: writeback fix
Wait for the page to be written to the cache before we allow it to be modified Signed-off-by: David Howells <dhowells@redhat.com> Reviewed-by: Paulo Alcantara (SUSE) <pc@cjr.nz> Signed-off-by: Steve French <stfrench@microsoft.com>
1 parent 5d7e282 commit 70ef385

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

fs/cifs/file.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4210,13 +4210,19 @@ cifs_page_mkwrite(struct vm_fault *vmf)
42104210
{
42114211
struct page *page = vmf->page;
42124212

4213+
/* Wait for the page to be written to the cache before we allow it to
4214+
* be modified. We then assume the entire page will need writing back.
4215+
*/
42134216
#ifdef CONFIG_CIFS_FSCACHE
42144217
if (PageFsCache(page) &&
42154218
wait_on_page_fscache_killable(page) < 0)
42164219
return VM_FAULT_RETRY;
42174220
#endif
42184221

4219-
lock_page(page);
4222+
wait_on_page_writeback(page);
4223+
4224+
if (lock_page_killable(page) < 0)
4225+
return VM_FAULT_RETRY;
42204226
return VM_FAULT_LOCKED;
42214227
}
42224228

0 commit comments

Comments
 (0)