diff options
author | Artem Bityutskiy <Artem.Bityutskiy@nokia.com> | 2011-05-23 14:30:01 +0300 |
---|---|---|
committer | Artem Bityutskiy <Artem.Bityutskiy@nokia.com> | 2011-05-27 15:55:06 +0300 |
commit | f6f1cd4e2dfa45705dd8179dd332869d0e7e99b8 (patch) | |
tree | 7864c34886e6efc2ada8d6bdcf662cfa8d9e43cc /tests/fs-tests/integrity | |
parent | fdfd2889ad3e59444275e063ada5247727cb079d (diff) |
fs-tests: integck: EIO can also be return in power-cut testing
Currently when we are doing UBIFS power cut emulation testing we assume that
EROFS is returned in case of an emulated power cut event. However, this is
not true and sometimes Linux returns EIO to user-space instead. Namely, this
happens when we are waiting for write-back to finish. Here is a call trace
form kernel 2.6.39-rc7:
Call Trace:
[<ffffffff810aaa77>] filemap_write_and_wait_range+0x78/0xb1
[<ffffffff8110f34d>] vfs_fsync_range+0x38/0xd3
[<ffffffff8110f42b>] generic_write_sync+0x43/0x65
[<ffffffff810ab0c9>] generic_file_aio_write+0xaa/0xf2
[<ffffffffa02224c9>] ubifs_aio_write+0x13a/0x1a1 [ubifs]
[<ffffffff810ed71f>] do_sync_write+0xcb/0x141
[<ffffffff810ee016>] vfs_write+0xb0/0x150
[<ffffffff810ee175>] sys_write+0x48/0x72
[<ffffffff813e0692>] system_call_fastpath+0x16/0x1b
'filemap_fdatawait_range()' returns hard-coded -EIO if a page write-back
happens with whatever error code.
Thus, this patch teaches integck to handle EIO when doing power cut emulation
testing.
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
Diffstat (limited to 'tests/fs-tests/integrity')
-rw-r--r-- | tests/fs-tests/integrity/integck.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/tests/fs-tests/integrity/integck.c b/tests/fs-tests/integrity/integck.c index 7fd662b..b9f4666 100644 --- a/tests/fs-tests/integrity/integck.c +++ b/tests/fs-tests/integrity/integck.c @@ -72,7 +72,13 @@ #define CHECK_ERRNO() do { \ if (args.power_cut_mode) \ - CHECK(errno == EROFS); \ + /* \ + * In case of emulated power cut failures the FS has to \ + * return EROFS. But unfortunately, the Linux kernel \ + * sometimes returns EIO to user-space anyway (when write- \ + * back fails the return code is awayse EIO). \ + */ \ + CHECK(errno == EROFS || errno == EIO); \ else \ CHECK(0); \ } while(0) @@ -3248,7 +3254,7 @@ int main(int argc, char *argv[]) } CHECK(ret); - CHECK(errno == EROFS); + CHECK(errno == EROFS || errno == EIO); free_test_data(); |