Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 116201
b: refs/heads/master
c: ed382d5
h: refs/heads/master
i:
  116199: c2f1559
v: v3
  • Loading branch information
Adrian Hunter authored and Artem Bityutskiy committed Sep 30, 2008
1 parent 3fd6dd8 commit 462a263
Show file tree
Hide file tree
Showing 3 changed files with 9 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: 2094c334fdebbcceddf21f97cb16b144707af56e
refs/heads/master: ed382d5898ccfc3d7ba775be2f1596f6a1547935
10 changes: 8 additions & 2 deletions trunk/fs/ubifs/file.c
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,12 @@ static int do_readpage(struct page *page)
err = ret;
if (err != -ENOENT)
break;
} else if (block + 1 == beyond) {
int dlen = le32_to_cpu(dn->size);
int ilen = i_size & (UBIFS_BLOCK_SIZE - 1);

if (ilen && ilen < dlen)
memset(addr + ilen, 0, dlen - ilen);
}
}
if (++i >= UBIFS_BLOCKS_PER_PAGE)
Expand Down Expand Up @@ -601,7 +607,7 @@ static int populate_page(struct ubifs_info *c, struct page *page,

addr = zaddr = kmap(page);

end_index = (i_size + PAGE_CACHE_SIZE - 1) >> PAGE_CACHE_SHIFT;
end_index = (i_size - 1) >> PAGE_CACHE_SHIFT;
if (!i_size || page->index > end_index) {
memset(addr, 0, PAGE_CACHE_SIZE);
goto out_hole;
Expand Down Expand Up @@ -649,7 +655,7 @@ static int populate_page(struct ubifs_info *c, struct page *page,
if (end_index == page->index) {
int len = i_size & (PAGE_CACHE_SIZE - 1);

if (len < read)
if (len && len < read)
memset(zaddr + len, 0, read - len);
}

Expand Down
1 change: 0 additions & 1 deletion trunk/fs/ubifs/ubifs-media.h
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,6 @@
*/
#define UBIFS_BLOCK_SIZE 4096
#define UBIFS_BLOCK_SHIFT 12
#define UBIFS_BLOCK_MASK 0x00000FFF

/* UBIFS padding byte pattern (must not be first or last byte of node magic) */
#define UBIFS_PADDING_BYTE 0xCE
Expand Down

0 comments on commit 462a263

Please sign in to comment.