Skip to content

Commit

Permalink
[PATCH] Fix possibly too long write in o2hb_setup_one_bio()
Browse files Browse the repository at this point in the history
We should subtract start of our IO from PAGE_CACHE_SIZE to get the right
length of the write we want to perform.

Signed-off-by: Jan Kara <jack@suse.cz>
Signed-off-by: Mark Fasheh <mark.fasheh@oracle.com>
  • Loading branch information
Jan Kara authored and Mark Fasheh committed Nov 6, 2007
1 parent 4e9563f commit bc7e97c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion fs/ocfs2/cluster/heartbeat.c
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ static struct bio *o2hb_setup_one_bio(struct o2hb_region *reg,
current_page = cs / spp;
page = reg->hr_slot_data[current_page];

vec_len = min(PAGE_CACHE_SIZE,
vec_len = min(PAGE_CACHE_SIZE - vec_start,
(max_slots-cs) * (PAGE_CACHE_SIZE/spp) );

mlog(ML_HB_BIO, "page %d, vec_len = %u, vec_start = %u\n",
Expand Down

0 comments on commit bc7e97c

Please sign in to comment.