Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 23584
b: refs/heads/master
c: 7e53cac
h: refs/heads/master
v: v3
  • Loading branch information
NeilBrown authored and Linus Torvalds committed Mar 25, 2006
1 parent 6d67170 commit 99e8c3e
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 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: 341546f5ad6fce584531f744853a5807a140f2a9
refs/heads/master: 7e53cac41da9ebb9be774220c1b2615182667c9d
16 changes: 14 additions & 2 deletions trunk/fs/namei.c
Original file line number Diff line number Diff line change
Expand Up @@ -2627,16 +2627,27 @@ int __page_symlink(struct inode *inode, const char *symname, int len,
int err = -ENOMEM;
char *kaddr;

retry:
page = find_or_create_page(mapping, 0, gfp_mask);
if (!page)
goto fail;
err = mapping->a_ops->prepare_write(NULL, page, 0, len-1);
if (err == AOP_TRUNCATED_PAGE) {
page_cache_release(page);
goto retry;
}
if (err)
goto fail_map;
kaddr = kmap_atomic(page, KM_USER0);
memcpy(kaddr, symname, len-1);
kunmap_atomic(kaddr, KM_USER0);
mapping->a_ops->commit_write(NULL, page, 0, len-1);
err = mapping->a_ops->commit_write(NULL, page, 0, len-1);
if (err == AOP_TRUNCATED_PAGE) {
page_cache_release(page);
goto retry;
}
if (err)
goto fail_map;
/*
* Notice that we are _not_ going to block here - end of page is
* unmapped, so this will only try to map the rest of page, see
Expand All @@ -2646,7 +2657,8 @@ int __page_symlink(struct inode *inode, const char *symname, int len,
*/
if (!PageUptodate(page)) {
err = mapping->a_ops->readpage(NULL, page);
wait_on_page_locked(page);
if (err != AOP_TRUNCATED_PAGE)
wait_on_page_locked(page);
} else {
unlock_page(page);
}
Expand Down

0 comments on commit 99e8c3e

Please sign in to comment.