From: Ralph Boehme Date: Thu, 21 Dec 2023 18:40:21 +0000 (+0100) Subject: selftest: remove error_inject from shadow_write share X-Git-Tag: samba-4.18.10~23 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=29f629a155faae5945414b912a5f248c1d7fd43a;p=thirdparty%2Fsamba.git selftest: remove error_inject from shadow_write share Frankly, I can't remember why I added this as part of bug 13688. The goal of the corresponding test is to verify a write on a read-only file handle fails. As the file is opened O_RDONLY, the write will fail anyway and there's no need to inject the error. To make things worse, having the error injected meant we didn't notice when the underlying logic of forcing the open to be done with O_RDONLY was done as O_RDWR, resulting in the write on the handle to succeed. This happened when we introduced reopen_from_fsp(): the initial pathref open of a path with a twrp value was correctly detected and handled by shadow_copy2_openat(). However, when converting the pathref open to a real one via reopen_from_fsp(), shadow_copy2_openat() only sees the magic /proc/fd path and has no way of inferring that this was originating from a prevous version open with a twrp value. Tl;dr: we can just remove this error injection, it is not needed, the correct fix is to implement this in the SMB layer which is done in the subsequent commits. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13688 Signed-off-by: Ralph Boehme Reviewed-by: Stefan Metzmacher (cherry picked from commit 78119edba013583555069271bb61134c12c2c135) --- diff --git a/selftest/knownfail.d/samba3.blackbox.shadow_copy_torture b/selftest/knownfail.d/samba3.blackbox.shadow_copy_torture new file mode 100644 index 00000000000..16537e58aeb --- /dev/null +++ b/selftest/knownfail.d/samba3.blackbox.shadow_copy_torture @@ -0,0 +1 @@ +^samba3.blackbox.shadow_copy_torture.writing to shadow copy of a file\(fileserver\) diff --git a/selftest/target/Samba3.pm b/selftest/target/Samba3.pm index 60775433de2..acee7dc68f0 100755 --- a/selftest/target/Samba3.pm +++ b/selftest/target/Samba3.pm @@ -3408,9 +3408,7 @@ sub provision($$) [shadow_write] path = $shadow_tstdir comment = previous versions snapshots under mount point - vfs objects = shadow_copy2 streams_xattr error_inject - aio write size = 0 - error_inject:pwrite = EBADF + vfs objects = shadow_copy2 streams_xattr shadow:mountpoint = $shadow_tstdir shadow:fixinodes = yes smbd async dosmode = yes