Updated temp file does not match source -- Strange cause

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Updated temp file does not match source -- Strange cause

Robert Nichols-2
"UpdateError {pathname} Updated mirror temp file {pathname} does not
match source"

No, the file is not changing. No, nothing is running out of space.  I
see this happening consistently for files with more than one hard link,
and only under very specific conditions:

1. The archive's file system must be ext4.
2. The file system must be mounted with an SELinux context override.
3. The file needs to have more than 1 hard link. (The first link
    gets processed correctly.)

The problem does not occur with ext3. I started seeing it when I
formatted a new backup disk with ext4. (Naturally, there were a lot of
other changes at the time, including the librsync update.  It took me a
long time to discover this "least likely" cause.)

Is there anyone with enough familiarity with the rdiff-backup source to
guide me to a likely spot to start looking? The sensitivity to file
system type makes it look like a kernel bug, but there is no point in
reporting it if I can't pin it down to a particular operation.

Note: The SELinux context override is because this is an external disk
       that is shared among systems, some without SELinux or with a
       different SELinux policy. Bad things happen if one system tries
       to believe what some other system has recorded there or finds
       that some files have no SELinux context.
       (mount -o context=system_u:object_r:default_t:s0,...)

--
Bob Nichols     "NOSPAM" is really part of my email address.
                 Do NOT delete it.


_______________________________________________
rdiff-backup-users mailing list at [hidden email]
https://lists.nongnu.org/mailman/listinfo/rdiff-backup-users
Wiki URL: http://rdiff-backup.solutionsfirst.com.au/index.php/RdiffBackupWiki
Reply | Threaded
Open this post in threaded view
|

Re: Updated temp file does not match source -- Strange cause

Robert Nichols-2
On 03/30/2015 09:58 PM, Robert Nichols wrote:

> "UpdateError {pathname} Updated mirror temp file {pathname} does not
> match source"
>
> No, the file is not changing. No, nothing is running out of space.  I
> see this happening consistently for files with more than one hard link,
> and only under very specific conditions:
>
> 1. The archive's file system must be ext4.
> 2. The file system must be mounted with an SELinux context override.
> 3. The file needs to have more than 1 hard link. (The first link
>     gets processed correctly.)

I believe I have found the solution for this. rdiff-backup tries setting
a user.test extended attribute to see whether the archive filesystem
supports extended attributes. It does not consider the possibility that
a user xattr might be allowed and a security xattr not supported, which
can be the case for a filesystem mounted with an overriding SELinux
security context. It ignores the EOPNOTSUPP error from the attempt to
set an SELinux security context and then complains that the security
context of the backup file does not match the source.

Apparently, the 3.x kernels default to "-o user_xattr" when mounting an
ext4 filesystem (but not for ext3), whereas the 2.x kernels default to
"nouser_xattr" for both ext3 and ext4. The solution is to specify "-o
nouser_xattr" explicitly in addition to the context override when
mounting the backup filesystem.

Side note: Digging through the *strace* output from a large Python
            package is not for the faint of heart.

--
Bob Nichols     "NOSPAM" is really part of my email address.
                 Do NOT delete it.


_______________________________________________
rdiff-backup-users mailing list at [hidden email]
https://lists.nongnu.org/mailman/listinfo/rdiff-backup-users
Wiki URL: http://rdiff-backup.solutionsfirst.com.au/index.php/RdiffBackupWiki