nfs:Fix error handling in the function nfs_vm_page_mkwrite
Subsystems (2)
A message that is not in the archive (sent off-list or not yet received): [email protected]
Quoted 29 lines · Nicholas Krause
This fixes error handling in the function
nfs_vm_page_mkwriteto properly check if the functionwait_on_bit_actionreturned something other then zero as if so return to the caller ofnfs_vm_page_mkwriteto signal that a internal failure has occurred when calling this function and should be handled by the caller.Signed-off-by Nicholas Krause <[email protected]>--- fs/nfs/file.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)fs/nfs/file.c +4
-3@@ -612,8 +612,10 @@ static int nfs_vm_page_mkwrite(struct vm_area_struct *vma, struct vm_fault *vmf)/* make sure the cache has finished storing the page */ nfs_fscache_wait_on_page_write (NFS_I (inode), page); -wait_on_bit_action (&NFS_I (inode)->flags,NFS_INO_INVALIDATING , - nfs_wait_bit_killable,TASK_KILLABLE ); + ret =wait_on_bit_action (&NFS_I (inode)->flags,NFS_INO_INVALIDATING , + nfs_wait_bit_killable,TASK_KILLABLE ); +if (ret) + goto out;lock_page (page); mapping =page_file_mapping (page); --
Quoted 2 lines
2.1.4
nfs_vm_page_mkwrite() is only allowed to return the value '0' or one or more of the VM_FAULT_* flags. It may not return kernel error values.
Trond