Commit bc7e97cbdd4bef162e5772c74ee2cc4487a2d997

Authored by Jan Kara
Committed by Mark Fasheh
1 parent 4e9563fd55

[PATCH] Fix possibly too long write in o2hb_setup_one_bio()

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>

Showing 1 changed file with 1 additions and 1 deletions Side-by-side Diff

fs/ocfs2/cluster/heartbeat.c
... ... @@ -267,7 +267,7 @@
267 267 current_page = cs / spp;
268 268 page = reg->hr_slot_data[current_page];
269 269  
270   - vec_len = min(PAGE_CACHE_SIZE,
  270 + vec_len = min(PAGE_CACHE_SIZE - vec_start,
271 271 (max_slots-cs) * (PAGE_CACHE_SIZE/spp) );
272 272  
273 273 mlog(ML_HB_BIO, "page %d, vec_len = %u, vec_start = %u\n",