diff options
author | Stefan Metzmacher <metze@samba.org> | 2008-04-08 19:04:44 +0200 |
---|---|---|
committer | Stefan Metzmacher <metze@samba.org> | 2008-04-08 19:42:06 +0200 |
commit | 4677ac6e70769bcc7f0c8bacdf000cdeb8c8089f (patch) | |
tree | 4b4e64191af14f459fa1e00e9accca3ae008340a /source4 | |
parent | edb3a83a069d39e123f18de098cfaab6deb16729 (diff) | |
download | samba-4677ac6e70769bcc7f0c8bacdf000cdeb8c8089f.tar.gz samba-4677ac6e70769bcc7f0c8bacdf000cdeb8c8089f.tar.bz2 samba-4677ac6e70769bcc7f0c8bacdf000cdeb8c8089f.zip |
BASE-DELAYWRITE: be more friendly to filesystems without high resolution timestamps
metze
(This used to be commit 9c18cf670889c9eb8c12b505c3b9ce5f9a516839)
Diffstat (limited to 'source4')
-rw-r--r-- | source4/torture/basic/delaywrite.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/source4/torture/basic/delaywrite.c b/source4/torture/basic/delaywrite.c index bc1cdbca96..84adfef61a 100644 --- a/source4/torture/basic/delaywrite.c +++ b/source4/torture/basic/delaywrite.c @@ -632,9 +632,20 @@ static bool test_finfo_after_write(struct torture_context *tctx, struct smbcli_s } #define COMPARE_WRITE_TIME_CMP(given, correct, cmp) do { \ + uint64_t r = 10*1000*1000; \ NTTIME g = (given).basic_info.out.write_time; \ + NTTIME gr = (g / r) * r; \ NTTIME c = (correct).basic_info.out.write_time; \ - if (g cmp c) { \ + NTTIME cr = (c / r) * r; \ + bool strict = torture_setting_bool(tctx, "strict mode", false); \ + bool err = false; \ + if (strict && (g cmp c)) { \ + err = true; \ + } else if (gr cmp cr) { \ + /* handle filesystem without high resolution timestamps */ \ + err = true; \ + } \ + if (err) { \ torture_result(tctx, TORTURE_FAIL, __location__": wrong write_time (%s)%s(%llu) %s (%s)%s(%llu)", \ #given, nt_time_string(tctx, g), (unsigned long long)g, \ #cmp, #correct, nt_time_string(tctx, c), (unsigned long long)c); \ |