[PATCH] CTDB recovery lock improvements

Aurélien Aptel aaptel at suse.com
Mon Jun 13 17:14:37 UTC 2016


On Thu, 09 Jun 2016 15:12:13 +0200 Andreas Schneider <asn at samba.org>
wrote:
> I just hit the issue, here are the logs ...

Thanks!

So here we create several files with various flags ("file-" followed by
"+"-separated flags [rhsa] ".txt") and we then try to backup them with
filters for flags.

REASON: Exception: Exception:  CMD: tarmode nosystem
                                            ^^^^^^^^
 ARG: -Tc /tmp/5Yozgc4r74/tarmode.tar ./bin/ab
      bin/ab/file-r+h.txt
      bin/ab/file-h.txt
 +    bin/ab/file-r+s+a.txt
                  ^^^^^ unexpected
      bin/ab/file-n.txt
      bin/ab/file-r+h+a.txt
      bin/ab/file-r+a.txt
      bin/ab/file-a.txt
      bin/ab/file-h+a.txt
      bin/ab/file-r.txt
	9 files, +1, -0, !0

 CMD: tarmode nohidden nosystem
                       ^^^^^^^^
 ARG: -Tc /tmp/5Yozgc4r74/tarmode.tar ./bin/ab
 +    bin/ab/file-r+s+a.txt
                  ^^^^^ unexpected
      bin/ab/file-n.txt
      bin/ab/file-r+a.txt
      bin/ab/file-a.txt
      bin/ab/file-r.txt
	5 files, +1, -0, !0

 CMD: tarmode inc nohidden nosystem
                           ^^^^^^^^
 ARG: -Tc /tmp/5Yozgc4r74/tarmode.tar ./bin/ab
 +    bin/ab/file-r+s+a.txt
                  ^^^^^ unexpected
      bin/ab/file-r+a.txt
      bin/ab/file-a.txt
	3 files, +1, -0, !0


In this particular failure it seems the problem lies with system files.
They can be:
a) not properly set as such (its done using `smbclient setmode
  <filename> +s`)
b) not reliably detected. They end up in the archive despite the
  "nosystem" tar option.

Code for a) is in s3/client/client.c in cmd_setmode() and is pretty
straightforward.

Code for b) is in s3/client/clitar.c in tar_create_skip_path() and
looks correct. It's the same code pattern as for the other flags.

	/* 1. if we don't want X and we have X, skip */
	if (!t->mode.system && (mode & FILE_ATTRIBUTE_SYSTEM)) {
		*_skip = true;
		return NT_STATUS_OK;
	}


On the server side, it seems there are several places for
setting/getting the attributes:
- tdb via a VFS
- xattr or X bit mapping in s3/smbd/dosmode.c

I'm not sure what configuration and storage system the autobuild (or
Andreas) is using for this test suite but it would be good to
know.

Because many things in smbd are async I guess there could be a
race condition between setting the flag and checking it. The fact that
the test that resets the archive flag is also sometime failing makes me
think this is probably the right explanation.

We could start by adding a sleep() call between the setting
and the checking, in the test suite (see attached patch).

I'm still trying to hit the bug on another machine.

-- 
Aurélien Aptel / SUSE Labs Samba Team
GPG: 1839 CB5F 9F5B FB9B AA97  8C99 03C8 A49B 521B D5D3
SUSE Linux GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany
GF: Felix Imendörffer, Jane Smithard, Graham Norton, HRB 21284 (AG
Nürnberg)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: tar_sleep.diff
Type: text/x-patch
Size: 667 bytes
Desc: not available
URL: <http://lists.samba.org/pipermail/samba-technical/attachments/20160613/e820ffb2/tar_sleep.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 819 bytes
Desc: OpenPGP digital signature
URL: <http://lists.samba.org/pipermail/samba-technical/attachments/20160613/e820ffb2/attachment.sig>


More information about the samba-technical mailing list