diff options
author | David Howells <dhowells@redhat.com> | 2022-01-25 02:15:18 +0300 |
---|---|---|
committer | Steve French <stfrench@microsoft.com> | 2022-03-22 23:38:20 +0300 |
commit | 70ef38515b664a14a3c8a3007778a56ccd02d43f (patch) | |
tree | c7a5002f63f3c2863b920fcae078bc58c8c54638 /fs/cifs/file.c | |
parent | 5d7e282541fc91b831a5c4477c5d72881c623df9 (diff) | |
download | linux-70ef38515b664a14a3c8a3007778a56ccd02d43f.tar.xz |
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>
Diffstat (limited to 'fs/cifs/file.c')
-rw-r--r-- | fs/cifs/file.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/fs/cifs/file.c b/fs/cifs/file.c index a2723f7cb5e9..cf8642c16e59 100644 --- a/fs/cifs/file.c +++ b/fs/cifs/file.c @@ -4210,13 +4210,19 @@ cifs_page_mkwrite(struct vm_fault *vmf) { struct page *page = vmf->page; + /* Wait for the page to be written to the cache before we allow it to + * be modified. We then assume the entire page will need writing back. + */ #ifdef CONFIG_CIFS_FSCACHE if (PageFsCache(page) && wait_on_page_fscache_killable(page) < 0) return VM_FAULT_RETRY; #endif - lock_page(page); + wait_on_page_writeback(page); + + if (lock_page_killable(page) < 0) + return VM_FAULT_RETRY; return VM_FAULT_LOCKED; } |