aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndi Kleen <ak@linux.intel.com>2009-09-16 15:09:34 +0200
committerAndi Kleen <ak@linux.intel.com>2009-09-16 15:09:34 +0200
commit494b8253a7ffcbee6cec65043e8f629a524ee0fd (patch)
treec5825644a3f76a4e8ce70154d894bcda0658bf49
parent2013e3e9c5f348fbb6076acf2450ec2dd3a9ebc8 (diff)
downloadmce-test-494b8253a7ffcbee6cec65043e8f629a524ee0fd.tar.gz
tinjpage: mark currently broken in kernel errors optional
- all second errors are optional because the VFS reports only once - hole errors are optional because we can't propagate errors for holes Signed-off-by: Andi Kleen <ak@linux.intel.com>
-rw-r--r--tsrc/tinjpage.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/tsrc/tinjpage.c b/tsrc/tinjpage.c
index baa54ef..90796a9 100644
--- a/tsrc/tinjpage.c
+++ b/tsrc/tinjpage.c
@@ -196,13 +196,17 @@ void expecterr(char *msg, int err)
}
}
+/*
+ * Any optional error is really a deficiency in the kernel VFS error reporting
+ * and should be eventually fixed and turned into a expecterr
+ */
void optionalerr(char *msg, int err)
{
if (err) {
printf("\texpected optional error %d on %s\n", errno, msg);
} else {
unexpected++;
- printf("XXX: expected likely incorrect no error on %s\n", msg);
+ printf("LATER: expected likely incorrect no error on %s\n", msg);
}
}
@@ -328,8 +332,9 @@ static void do_file_dirty(int flags, char *name)
fd = open(fn, O_RDWR);
char buf[128];
- expecterr("explicit read after poison", read(fd, buf, sizeof buf) < 0);
- expecterr("explicit write after poison", write(fd, "foobar", 6) < 0);
+ /* the earlier close has eaten the error */
+ optionalerr("explicit read after poison", read(fd, buf, sizeof buf) < 0);
+ optionalerr("explicit write after poison", write(fd, "foobar", 6) < 0);
optionalerr("fsync expect error", fsync(fd) < 0);
close(fd);
@@ -358,7 +363,8 @@ static void file_hole(void)
page = checked_mmap(NULL, PS, PROT_READ|PROT_WRITE, MAP_SHARED, fd, 0);
*page = 1;
testmem("hole file dirty", page, MREAD);
- expecterr("hole fsync expect error", fsync(fd) < 0);
+ /* hole error reporting doesn't work in kernel currently, so optional */
+ optionalerr("hole fsync expect error", fsync(fd) < 0);
optionalerr("hole msync expect error", msync(page, PS, MS_SYNC) < 0);
close(fd);
}