Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 54477
b: refs/heads/master
c: bf126ae
h: refs/heads/master
i:
  54475: 3440d03
v: v3
  • Loading branch information
Steven Whitehouse committed May 1, 2007
1 parent cab52a5 commit 9c72874
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 4 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 476c006be009d4121e401a9e9f49a3362a7a272f
refs/heads/master: bf126aee6d54fe1e509846abf3b27aba84c6d7ce
17 changes: 14 additions & 3 deletions trunk/fs/gfs2/ops_address.c
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,19 @@ static int stuffed_readpage(struct gfs2_inode *ip, struct page *page)
void *kaddr;
int error;

BUG_ON(page->index);
/*
* Due to the order of unstuffing files and ->nopage(), we can be
* asked for a zero page in the case of a stuffed file being extended,
* so we need to supply one here. It doesn't happen often.
*/
if (unlikely(page->index)) {
kaddr = kmap_atomic(page, KM_USER0);
memset(kaddr, 0, PAGE_CACHE_SIZE);
kunmap_atomic(kaddr, KM_USER0);
flush_dcache_page(page);
SetPageUptodate(page);
return 0;
}

error = gfs2_meta_inode_buffer(ip, &dibh);
if (error)
Expand All @@ -208,9 +220,8 @@ static int stuffed_readpage(struct gfs2_inode *ip, struct page *page)
ip->i_di.di_size);
memset(kaddr + ip->i_di.di_size, 0, PAGE_CACHE_SIZE - ip->i_di.di_size);
kunmap_atomic(kaddr, KM_USER0);

flush_dcache_page(page);
brelse(dibh);

SetPageUptodate(page);

return 0;
Expand Down

0 comments on commit 9c72874

Please sign in to comment.