Whamcloud - gitweb
LU-11623 tests: Fix sanity 27E to ensure getattr RPC 67/35067/2
authorOleg Drokin <green@whamcloud.com>
Wed, 5 Jun 2019 06:28:24 +0000 (02:28 -0400)
committerOleg Drokin <green@whamcloud.com>
Sun, 16 Jun 2019 03:22:58 +0000 (03:22 +0000)
While cat does perform fstat() on the file it opens,
I guess it's not guaranteed.
More importantly, we really need to ensure the locks
that the file has after creation are dropped before
we issue our stat() to ensure the RPC is actually made,
since it's this GETATTR RPC that is ensuring easize
update from MDT response.

Change-Id: Ic86229ac514e1385c665c6c0d9f6eef13d9748f5
Signed-off-by: Oleg Drokin <green@whamcloud.com>
Test-Parameters: trivial
Reviewed-on: https://review.whamcloud.com/35067
Tested-by: Jenkins
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Patrick Farrell <pfarrell@whamcloud.com>
Reviewed-by: James Nunez <jnunez@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
lustre/tests/sanity.sh

index 401803d..2d6bcdd 100644 (file)
@@ -2530,8 +2530,12 @@ test_27E() {
 
        $LFS setstripe -c $OSTCOUNT $DIR/$tfile ||
                error "setstripe failed"
-       cat $DIR/$tfile
-       rm $DIR/$tfile
+       # In order to ensure stat() call actually talks to MDS we need to
+       # do something drastic to this file to shake off all lock, e.g.
+       # rename it (kills lookup lock forcing cache cleaning)
+       mv $DIR/$tfile $DIR/${tfile}-1
+       ls -l $DIR/${tfile}-1
+       rm $DIR/${tfile}-1
 
        easize=$($LCTL get_param -n llite.*.default_easize)