diff options
author | Ravishankar N <ravishankar@redhat.com> | 2019-01-29 11:51:16 +0530 |
---|---|---|
committer | Shyamsundar Ranganathan <srangana@redhat.com> | 2019-02-04 14:52:59 +0000 |
commit | 3f05fb00a090686bbdb0b467cec1f3647903b851 (patch) | |
tree | 7ad709c09e438d514af29b3369254631a39174e6 /tests | |
parent | 05ba01297657deef881aa9cd2770bbe760abf090 (diff) |
readdir-ahead: do not zero-out iatt in fop cbk
...when ctime is zero. ia_type and ia_gfid always need to be non-zero
for things to work correctly.
Problem:
Commit c9bde3021202f1d5c5a2d19ac05a510fc1f788ac zeroed out the iatt
buffer in the cbks of modification fops before unwinding if the ctime in
the buffer was zero. This was causing the fops to fail: noticeable when
AFR's 'consistent-metadata' option was enabled. (AFR zeros out the ctime
when the option is set. See commit
4c4624c9bad2edf27128cb122c64f15d7d63bbc8).
Fixes:
-Do not zero out the ia_type and ia_gfid of the iatt buff under any
circumstance.
-Also, fixed _rda_inode_ctx_update_iatts() to always update these values from
the incoming buf when ctime is zero. Otherwise we end up with zero
ia_type and ia_gfid the first time the function is called *and* the
incoming buf has ctime set to zero.
fixes: bz#1665145
Reported-By:Michael Hanselmann <public@hansmi.ch>
Change-Id: Ib72228892d42c3513c19fc6dfb543f2aa3489eca
Signed-off-by: Ravishankar N <ravishankar@redhat.com>
(cherry picked from commit 09db11b0c020bc79d493c6d7e7ea4f3beb000c68)
Diffstat (limited to 'tests')
-rw-r--r-- | tests/bugs/readdir-ahead/bug-1670253-consistent-metadata.t | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/tests/bugs/readdir-ahead/bug-1670253-consistent-metadata.t b/tests/bugs/readdir-ahead/bug-1670253-consistent-metadata.t new file mode 100644 index 00000000000..6adfc17c92c --- /dev/null +++ b/tests/bugs/readdir-ahead/bug-1670253-consistent-metadata.t @@ -0,0 +1,23 @@ +#!/bin/bash + +. $(dirname $0)/../../include.rc +. $(dirname $0)/../../volume.rc + +cleanup; + +TEST glusterd + +TEST $CLI volume create $V0 replica 3 $H0:$B0/${V0}{0,1,2} +TEST $CLI volume set $V0 readdir-ahead on #on by default as of writing this .t. +TEST $CLI volume set $V0 consistent-metadata on +TEST $CLI volume start $V0 +TEST glusterfs --volfile-server=$H0 --volfile-id=$V0 $M0 +TEST touch $M0/FILE +echo "abc" >> $M0/FILE +EXPECT "^0$" echo $? +EXPECT "abc" cat $M0/FILE +echo "truncate" >$M0/FILE +EXPECT "^0$" echo $? +EXPECT "truncate" cat $M0/FILE +EXPECT_WITHIN $UMOUNT_TIMEOUT "Y" force_umount $M0 +cleanup; |