Skip to contentSkip to conversation

nfs:Fix error handling in the function nfs_vm_page_mkwrite

PATCH Trond Myklebust 1 participant 1 message Aug 24, 2015 1 message not in the archive

Subsystems (2)
lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw
Quoted 29 lines · Nicholas Krause

This fixes error handling in the function nfs_vm_page_mkwrite to properly check if the function wait_on_bit_action returned something other then zero as if so return to the caller of nfs_vm_page_mkwrite to signal that a internal failure has occurred when calling this function and should be handled by the caller.

---
 fs/nfs/file.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
fs/nfs/file.c +4 -3
index cc4fa1e..698851a 100644
@@ -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