Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=9d577b6a31a53a19d3b0fe414d645a61ef201846
Commit:     9d577b6a31a53a19d3b0fe414d645a61ef201846
Parent:     9393e1dc8e394bd59217178b26b2476dc43e8667
Author:     David Howells <[EMAIL PROTECTED]>
AuthorDate: Thu May 10 22:22:19 2007 -0700
Committer:  Linus Torvalds <[EMAIL PROTECTED]>
CommitDate: Fri May 11 08:29:32 2007 -0700

    AFS: fix interminable loop in afs_write_back_from_locked_page()
    
    Following bug was uncovered by compiling with '-W' flag:
    
      CC [M]  fs/afs/write.o
    fs/afs/write.c: In function ‘afs_write_back_from_locked_page’:
    fs/afs/write.c:398: warning: comparison of unsigned expression >= 0 is 
always true
    
    Loop variable 'n' is unsigned, so wraps around happily as far as I can
    see. Trival fix attached (compile tested only).
    
    Signed-off-by: Mika Kukkonen <[EMAIL PROTECTED]>
    Signed-off-by: David Howells <[EMAIL PROTECTED]>
    Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
    Signed-off-by: Linus Torvalds <[EMAIL PROTECTED]>
---
 fs/afs/write.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/fs/afs/write.c b/fs/afs/write.c
index 67ae4db..28f3751 100644
--- a/fs/afs/write.c
+++ b/fs/afs/write.c
@@ -395,8 +395,9 @@ static int afs_write_back_from_locked_page(struct 
afs_writeback *wb,
                if (n == 0)
                        goto no_more;
                if (pages[0]->index != start) {
-                       for (n--; n >= 0; n--)
-                               put_page(pages[n]);
+                       do {
+                               put_page(pages[--n]);
+                       } while (n > 0);
                        goto no_more;
                }
 
-
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  http://vger.kernel.org/majordomo-info.html

Reply via email to