Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 217061
b: refs/heads/master
c: bc4866b
h: refs/heads/master
i:
  217059: 33adcf0
v: v3
  • Loading branch information
Trond Myklebust authored and Trond Myklebust committed Oct 19, 2010
1 parent 50b3a74 commit 48e4289
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 10 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 955a857e062642cd3ebe1dc7bb38c0f85d8f8f17
refs/heads/master: bc4866b6e0b44f8ea0df22a16e5927714beb4983
17 changes: 8 additions & 9 deletions trunk/fs/nfs/file.c
Original file line number Diff line number Diff line change
Expand Up @@ -551,7 +551,7 @@ static int nfs_vm_page_mkwrite(struct vm_area_struct *vma, struct vm_fault *vmf)
struct file *filp = vma->vm_file;
struct dentry *dentry = filp->f_path.dentry;
unsigned pagelen;
int ret = -EINVAL;
int ret = VM_FAULT_NOPAGE;
struct address_space *mapping;

dfprintk(PAGECACHE, "NFS: vm_page_mkwrite(%s/%s(%ld), offset %lld)\n",
Expand All @@ -567,21 +567,20 @@ static int nfs_vm_page_mkwrite(struct vm_area_struct *vma, struct vm_fault *vmf)
if (mapping != dentry->d_inode->i_mapping)
goto out_unlock;

ret = 0;
pagelen = nfs_page_length(page);
if (pagelen == 0)
goto out_unlock;

ret = nfs_flush_incompatible(filp, page);
if (ret != 0)
goto out_unlock;
ret = VM_FAULT_LOCKED;
if (nfs_flush_incompatible(filp, page) == 0 &&
nfs_updatepage(filp, page, 0, pagelen) == 0)
goto out;

ret = nfs_updatepage(filp, page, 0, pagelen);
ret = VM_FAULT_SIGBUS;
out_unlock:
if (!ret)
return VM_FAULT_LOCKED;
unlock_page(page);
return VM_FAULT_SIGBUS;
out:
return ret;
}

static const struct vm_operations_struct nfs_file_vm_ops = {
Expand Down

0 comments on commit 48e4289

Please sign in to comment.