diff options
author | Steven Whitehouse <swhiteho@redhat.com> | 2008-01-16 09:24:05 -0500 |
---|---|---|
committer | Steven Whitehouse <swhiteho@redhat.com> | 2008-01-25 03:19:28 -0500 |
commit | 1af535727bbf68e1da7ac232de47315da4c66ade (patch) | |
tree | ab24a9bc1271179fdae558d4f66e7ee0e401ce4c /fs/gfs2/bmap.c | |
parent | 05220535196d413db434527a3edcba79b7187df8 (diff) |
[GFS2] Fix write alloc required shortcut calculation
The comparison was being made against the wrong quantity.
Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
Diffstat (limited to 'fs/gfs2/bmap.c')
-rw-r--r-- | 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 4356cc2fb3f5..e4effc47abfc 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, | |||
1222 | do_div(lblock_stop, bsize); | 1222 | do_div(lblock_stop, bsize); |
1223 | } else { | 1223 | } else { |
1224 | unsigned int shift = sdp->sd_sb.sb_bsize_shift; | 1224 | unsigned int shift = sdp->sd_sb.sb_bsize_shift; |
1225 | u64 end_of_file = (ip->i_di.di_size + sdp->sd_sb.sb_bsize - 1) >> shift; | ||
1225 | lblock = offset >> shift; | 1226 | lblock = offset >> shift; |
1226 | lblock_stop = (offset + len + sdp->sd_sb.sb_bsize - 1) >> shift; | 1227 | lblock_stop = (offset + len + sdp->sd_sb.sb_bsize - 1) >> shift; |
1227 | if (lblock_stop > ip->i_di.di_blocks) { /* writing past the | 1228 | if (lblock_stop > end_of_file) { |
1228 | last block */ | ||
1229 | *alloc_required = 1; | 1229 | *alloc_required = 1; |
1230 | return 0; | 1230 | return 0; |
1231 | } | 1231 | } |