Whamcloud - gitweb
LU-13578 test: use a single read() in sanity test_39r 73/40973/3
authorJohn L. Hammond <jhammond@whamcloud.com>
Tue, 15 Dec 2020 15:34:34 +0000 (09:34 -0600)
committerOleg Drokin <green@whamcloud.com>
Wed, 27 Jan 2021 07:16:26 +0000 (07:16 +0000)
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 <jhammond@whamcloud.com>
Change-Id: I1dd4e93ac150b34f4fc943fe25b92bf9119b0461
Reviewed-on: https://review.whamcloud.com/40973
Tested-by: jenkins <devops@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Alex Zhuravlev <bzzz@whamcloud.com>
Reviewed-by: James Simmons <jsimmons@infradead.org>
lustre/tests/sanity.sh

index 21e447a..c5995a4 100755 (executable)
@@ -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"