Skip to content

Commit

Permalink
ocfs2: Don't double set write parameters
Browse files Browse the repository at this point in the history
The target page offsets were being incorrectly set a second time in
ocfs2_prepare_page_for_write(), which was causing problems on a 16k page
size kernel. Additionally, ocfs2_write_failure() was incorrectly using those
parameters instead of the parameters for the individual page being cleaned
up.

Signed-off-by: Mark Fasheh <mark.fasheh@oracle.com>
  • Loading branch information
Mark Fasheh committed Sep 20, 2007
1 parent db56246 commit 5c26a7b
Showing 1 changed file with 3 additions and 13 deletions.
16 changes: 3 additions & 13 deletions fs/ocfs2/aops.c
Original file line number Diff line number Diff line change
Expand Up @@ -930,18 +930,11 @@ static void ocfs2_write_failure(struct inode *inode,
loff_t user_pos, unsigned user_len)
{
int i;
unsigned from, to;
unsigned from = user_pos & (PAGE_CACHE_SIZE - 1),
to = user_pos + user_len;
struct page *tmppage;

ocfs2_zero_new_buffers(wc->w_target_page, user_pos, user_len);

if (wc->w_large_pages) {
from = wc->w_target_from;
to = wc->w_target_to;
} else {
from = 0;
to = PAGE_CACHE_SIZE;
}
ocfs2_zero_new_buffers(wc->w_target_page, from, to);

for(i = 0; i < wc->w_num_pages; i++) {
tmppage = wc->w_pages[i];
Expand Down Expand Up @@ -991,9 +984,6 @@ static int ocfs2_prepare_page_for_write(struct inode *inode, u64 *p_blkno,
map_from = cluster_start;
map_to = cluster_end;
}

wc->w_target_from = map_from;
wc->w_target_to = map_to;
} else {
/*
* If we haven't allocated the new page yet, we
Expand Down

0 comments on commit 5c26a7b

Please sign in to comment.