[PATCH] __page_symlink retry loop error code fix
authorDmitriy Monakhov <dmonakhov@openvz.org>
Fri, 16 Feb 2007 09:27:18 +0000 (01:27 -0800)
committerLinus Torvalds <torvalds@woody.linux-foundation.org>
Fri, 16 Feb 2007 16:13:56 +0000 (08:13 -0800)
If prepare_write or commit_write return AOP_TRUNCATED_PAGE we jump to
"retry" label and than if find_or_create_page() failed function return
incorrect error code.

Signed-off-by: Dmitriy Monakhov <dmonakhov@openvz.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
fs/namei.c

index 161e2225c75702f1f2ba88e97a2d21d1155da1a3..ee60cc4d3453209723d6f70982e7083d7cb39477 100644 (file)
@@ -2688,10 +2688,11 @@ int __page_symlink(struct inode *inode, const char *symname, int len,
 {
        struct address_space *mapping = inode->i_mapping;
        struct page *page;
-       int err = -ENOMEM;
+       int err;
        char *kaddr;
 
 retry:
+       err = -ENOMEM;
        page = find_or_create_page(mapping, 0, gfp_mask);
        if (!page)
                goto fail;