Commit:     6a860c979b35469e4d77da781a96bdb2ca05ae64
Parent:     9d1ca6f13cfedfd127f3be7e447bd6d922806a65
Author:     Jens Axboe <[EMAIL PROTECTED]>
AuthorDate: Fri Jul 20 15:18:12 2007 +0200
Committer:  Linus Torvalds <[EMAIL PROTECTED]>
CommitDate: Fri Jul 20 09:07:01 2007 -0700

    splice: fix bad unlock_page() in error case
    If add_to_page_cache_lru() fails, the page will not be locked. But
    splice jumps to an error path that does a page release and unlock,
    causing a BUG() in unlock_page().
    Fix this by adding one more label that just releases the page. This bug
    was actually triggered on EL5 by gurudas pai <[EMAIL PROTECTED]>
    using fio.
    Signed-off-by: Jens Axboe <[EMAIL PROTECTED]>
    Signed-off-by: Linus Torvalds <[EMAIL PROTECTED]>
 fs/splice.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/fs/splice.c b/fs/splice.c
index 22496d2..0a09732 100644
--- a/fs/splice.c
+++ b/fs/splice.c
@@ -594,7 +594,7 @@ find_page:
                ret = add_to_page_cache_lru(page, mapping, index,
                if (unlikely(ret))
-                       goto out;
+                       goto out_release;
        ret = mapping->a_ops->prepare_write(file, page, offset, 
@@ -650,8 +650,9 @@ find_page:
-       page_cache_release(page);
+       page_cache_release(page);
        return ret;
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at

Reply via email to