mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-11 12:28:41 +08:00
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>
This commit is contained in:
parent
5d7e282541
commit
70ef38515b
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user