summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/e2fsprogs/e2fsprogs/fix-icache.patch
diff options
context:
space:
mode:
authorRobert Yang <liezhi.yang@windriver.com>2014-01-01 01:25:17 +0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2014-01-06 11:13:57 +0000
commit63281708fab30adc4ca1a506deefbf8a54dcce6d (patch)
treebf6b9b48314909bd062f4fba473708065cbd6c81 /meta/recipes-devtools/e2fsprogs/e2fsprogs/fix-icache.patch
parent5ddb7d4ebb135e288ab56b44aceabb3578ae9ed1 (diff)
downloadpoky-63281708fab30adc4ca1a506deefbf8a54dcce6d.tar.gz
e2fsprogs: upgrade to 1.42.9
* Upgrade to 1.42.9 * Remove the following patches since they have been merged/fixed by upstream: - debugfs-extent-header.patch - debugfs-sparse-copy.patch - debugfs-too-short.patch - e2fsprogs-fix-tests-f_extent_oobounds.patch - fallocate.patch * The populate-extfs.sh had been merged by the upstream, but I'd like to go on using the previous one which is from our meta layer, they are a little different, and the script would be dropped when we use the mke2fs to populate the rootfs. * Sumitted the patch for populate-extfs.sh (from Søren Holm) to upstream. * Submitted fix-icache.patch to upstream, I wrongly thought it was not applicable to the upstream, but it does. * Join the do_install() and do_install_append() together. (From OE-Core rev: 82cc941128f9eaf57c3a9a648fc58227f6c1956c) Signed-off-by: Robert Yang <liezhi.yang@windriver.com> Signed-off-by: Saul Wold <sgw@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-devtools/e2fsprogs/e2fsprogs/fix-icache.patch')
-rw-r--r--meta/recipes-devtools/e2fsprogs/e2fsprogs/fix-icache.patch65
1 files changed, 65 insertions, 0 deletions
diff --git a/meta/recipes-devtools/e2fsprogs/e2fsprogs/fix-icache.patch b/meta/recipes-devtools/e2fsprogs/e2fsprogs/fix-icache.patch
new file mode 100644
index 0000000000..03c0abc026
--- /dev/null
+++ b/meta/recipes-devtools/e2fsprogs/e2fsprogs/fix-icache.patch
@@ -0,0 +1,65 @@
1inode.c: only update the icache for ext2_inode
2
3We only read the cache when:
4
5bufsize == sizeof(struct ext2_inode)
6
7then we should only update the cache in the same condition, otherwise
8there would be errors, for example:
9
10cache[0]: cached ino 14 when bufsize = 128 by ext2fs_write_inode_full()
11cache[1]: cached ino 14 when bufsize = 156 by ext2fs_read_inode_full()
12
13Then update the cache:
14cache[0]: cached ino 15 when bufsize = 156 by ext2fs_read_inode_full()
15
16Then the ino 14 would hit the cache[1] when bufsize = 128 (but it was
17cached by bufsize = 156), so there would be errors.
18
19Upstream-Status: [Submitted]
20
21Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
22---
23 lib/ext2fs/inode.c | 20 ++++++++++++--------
24 1 file changed, 12 insertions(+), 8 deletions(-)
25
26diff --git a/lib/ext2fs/inode.c b/lib/ext2fs/inode.c
27--- a/lib/ext2fs/inode.c
28+++ b/lib/ext2fs/inode.c
29@@ -612,10 +612,12 @@ errcode_t ext2fs_read_inode_full(ext2_filsys fs, ext2_ino_t ino,
30 #endif
31
32 /* Update the inode cache */
33- fs->icache->cache_last = (fs->icache->cache_last + 1) %
34- fs->icache->cache_size;
35- fs->icache->cache[fs->icache->cache_last].ino = ino;
36- fs->icache->cache[fs->icache->cache_last].inode = *inode;
37+ if (bufsize == sizeof(struct ext2_inode)) {
38+ fs->icache->cache_last = (fs->icache->cache_last + 1) %
39+ fs->icache->cache_size;
40+ fs->icache->cache[fs->icache->cache_last].ino = ino;
41+ fs->icache->cache[fs->icache->cache_last].inode = *inode;
42+ }
43
44 return 0;
45 }
46@@ -648,10 +650,12 @@ errcode_t ext2fs_write_inode_full(ext2_filsys fs, ext2_ino_t ino,
47
48 /* Check to see if the inode cache needs to be updated */
49 if (fs->icache) {
50- for (i=0; i < fs->icache->cache_size; i++) {
51- if (fs->icache->cache[i].ino == ino) {
52- fs->icache->cache[i].inode = *inode;
53- break;
54+ if (bufsize == sizeof(struct ext2_inode)) {
55+ for (i=0; i < fs->icache->cache_size; i++) {
56+ if (fs->icache->cache[i].ino == ino) {
57+ fs->icache->cache[i].inode = *inode;
58+ break;
59+ }
60 }
61 }
62 } else {
63--
641.8.1.2
65