[PATCH] [WIP] Attempt to address flapping tests and file/directory mixups

Andrew Bartlett abartlet at samba.org
Fri Jul 22 11:23:36 UTC 2016


On Thu, 2016-07-21 at 11:03 -0700, Jeremy Allison wrote:
> Andrew, here's a more complete version that also
> clears out stale xattr values on directory create
> as well.
> 
> Can you test this and let me know if it fixes
> the issues with the flapping tests for you ?

I don't think this helps.  At least, I don't think the problem is what
I thought it was, now I have created a proper test rig.

I deliberately create a small, inode-restricted file system in /tmp/
and remove the code in Samba3.pm that creates 30,000 plus files.

I use this to create it, as you can see, it only has 1000 inodes, so re
-use must happen.

sudo umount st && mkfs.ext4 -N 1000 st-fs  -E root_owner=500:500 &&
sudo mount -o loop st-fs st

In that, I can't ever create a file with wrong dos attributes.  Even if
I turn on posix in smbclient, even with a patch try and force it to be
a posix_open in open.c, that I think skips the wipe of the dos
attributes.

Both hack patches are attached for your amusement. 

Here also for amusement are some of the commands I ran in a
SELFTEST_TESTENV=fileserver make test

for i in {1..1000}; do bin/smbclient //$SERVER/tmp 
-U$USERNAME%$PASSWORD -c "put /etc/passwd passwd$i; setmode passwd$i
+h"; done

rm -rf st/fileserver/share/passwd*
tdbdump st/fileserver/lockdir/xattr.tdb | grep key| wc -l
 for i in {1..1000}; do bin/smbclient //$SERVER/tmp 
-U$USERNAME%$PASSWORD -c "posix;put /etc/passwd passwd$i"; done
bin/smbclient //$SERVER/tmp -U$USERNAME%$PASSWORD -c ls

I however did look at the smbclient_tarmode.pl script again, and it
does crate files locally on the filesystem, not just via Samba.

If a file or directory is ever removed in the environment without going
via Samba, then the dev/inode may still be in the xattr.tdb, and so
apply to a newly created file.

The fix therefore is to create a new selftest environment that is only
used for this test, so that the whole tdb is private to just this test,
or just never create files behind smbd's back.

I still think the patch is correct, because relying on general-purpose
Samba (rather than this module) also re-setting everything in an EA at
open (when the OS already handles this in the real world) is silly. 
 However, it still won't help smbclient_tar in my view.

Andrew Bartlett

-- 
Andrew Bartlett                       http://samba.org/~abartlet/
Authentication Developer, Samba Team  http://samba.org
Samba Developer, Catalyst IT          http://catalyst.net.nz/services/samba


-------------- next part --------------
A non-text attachment was scrubbed...
Name: hacks.patch
Type: text/x-patch
Size: 1596 bytes
Desc: not available
URL: <http://lists.samba.org/pipermail/samba-technical/attachments/20160722/a189bb68/hacks.bin>


More information about the samba-technical mailing list