Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=1af535727bbf68e1da7ac232de47315da4c66ade
Commit:     1af535727bbf68e1da7ac232de47315da4c66ade
Parent:     05220535196d413db434527a3edcba79b7187df8
Author:     Steven Whitehouse <[EMAIL PROTECTED]>
AuthorDate: Wed Jan 16 14:24:05 2008 +0000
Committer:  Steven Whitehouse <[EMAIL PROTECTED]>
CommitDate: Fri Jan 25 08:19:28 2008 +0000

    [GFS2] Fix write alloc required shortcut calculation
    
    The comparison was being made against the wrong quantity.
    
    Signed-off-by: Steven Whitehouse <[EMAIL PROTECTED]>
---
 fs/gfs2/bmap.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/fs/gfs2/bmap.c b/fs/gfs2/bmap.c
index 4356cc2..e4effc4 100644
--- a/fs/gfs2/bmap.c
+++ b/fs/gfs2/bmap.c
@@ -1222,10 +1222,10 @@ int gfs2_write_alloc_required(struct gfs2_inode *ip, 
u64 offset,
                do_div(lblock_stop, bsize);
        } else {
                unsigned int shift = sdp->sd_sb.sb_bsize_shift;
+               u64 end_of_file = (ip->i_di.di_size + sdp->sd_sb.sb_bsize - 1) 
>> shift;
                lblock = offset >> shift;
                lblock_stop = (offset + len + sdp->sd_sb.sb_bsize - 1) >> shift;
-               if (lblock_stop > ip->i_di.di_blocks) { /* writing past the
-                                                          last block */
+               if (lblock_stop > end_of_file) {
                        *alloc_required = 1;
                        return 0;
                }
-
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