From: John L. Hammond Date: Tue, 15 Dec 2020 15:34:34 +0000 (-0600) Subject: LU-13578 test: use a single read() in sanity test_39r X-Git-Tag: 2.14.0-RC1~4 X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=commitdiff_plain;h=842f8158a533b21d8c6e401881db5ed7013b7890 LU-13578 test: use a single read() in sanity test_39r In sanity test_39r() ensure that the we only call read() once on the file ot update it's atime. Otherwise the file atime may be greater than the OST object atime due to a final read() done by dd which returns no bytes and does not generate a BRW RPC to the OST. Even though it returns 0 bytes, it requested a non-zero number of bytes and is therefore required to update the file access time. Fixes: 7c9ce8aac ("LU-13383 ofd: lazy atime update") Test-Parameters: trivial testlist=sanity env=ONLY=39r,ONLY_REPEAT=400 Signed-off-by: John L. Hammond Change-Id: I1dd4e93ac150b34f4fc943fe25b92bf9119b0461 Reviewed-on: https://review.whamcloud.com/40973 Tested-by: jenkins Reviewed-by: Andreas Dilger Tested-by: Maloo Reviewed-by: Alex Zhuravlev Reviewed-by: James Simmons --- diff --git a/lustre/tests/sanity.sh b/lustre/tests/sanity.sh index 21e447a..c5995a4 100755 --- a/lustre/tests/sanity.sh +++ b/lustre/tests/sanity.sh @@ -4632,7 +4632,8 @@ test_39r() { # exceed atime_diff and access file sleep 6 - dd if=$DIR/$tfile of=/dev/null || error "can't udpate atime" + dd if=$DIR/$tfile of=/dev/null bs=4k count=1 || + error "can't udpate atime" local atime_cli=$(stat -c %X $DIR/$tfile) echo "client atime: $atime_cli"