Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 16 Jan 2017 01:17:07 +0000
From:      bugzilla-noreply@freebsd.org
To:        freebsd-bugs@FreeBSD.org
Subject:   [Bug 216127] sbin/restore doesn't honour extended attributes (extattr on ufs)
Message-ID:  <bug-216127-8@https.bugs.freebsd.org/bugzilla/>

next in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D216127

            Bug ID: 216127
           Summary: sbin/restore doesn't honour extended attributes
                    (extattr on ufs)
           Product: Base System
           Version: 11.0-STABLE
          Hardware: amd64
                OS: Any
            Status: New
          Severity: Affects Some People
          Priority: ---
         Component: bin
          Assignee: freebsd-bugs@FreeBSD.org
          Reporter: dewayne@heuristicsystems.com.au
                CC: freebsd-amd64@FreeBSD.org
                CC: freebsd-amd64@FreeBSD.org

During a ufs filesystem restore we found that extended attributes weren't
correctly installed on=20
# uname -aKU
FreeBSD hathor 11.0-STABLE FreeBSD 11.0-STABLE #0 r311660M: Sun Jan  8 21:3=
0:51
AEDT 2017    root@hathor:/110002/D/K8/hqdev-amd64-smp-vga    amd64 1100509
1100509

/sbin/restore is our primary backup strategy as neither of cp, tar nor rsync
store extended attributes.

# Simplest test - for a successful test of extended attributes
sh=20
truncate -s 64m /tmp/testf
M=3D`mdconfig -a -t vnode -f /tmp/testf`
newfs /dev/$M
mount /dev/$M /mnt/A
cd /mnt/A
echo hello>file-ext
setextattr system hi hello file-ext
setextattr user sz 6 file-ext
lsextattr system file-ext && getextattr system hi file-ext
dump -0Lar -C 32 -r -f /tmp/d.dmp /mnt/A
rm -v file-ext
cd /mnt/A && restore -rvf /tmp/d.dmp
lsextattr system file-ext;=20
getextattr system hi file-ext; getextattr user sz file-ext
exit
umount /mnt/A && mdconfig -du 0


# Test for failure.
sh=20
truncate -s 64m /tmp/testf
M=3D`mdconfig -a -t vnode -f /tmp/testf`
newfs /dev/$M
mount /dev/$M /mnt/A
cd /mnt/A
echo hello>file-ext
setextattr system m "`md5 -q file-ext`" file-ext
setextattr user sz `stat -f %z file-ext` file-ext
lsextattr system file-ext && getextattr system m file-ext
dump -0Lar -C 32 -r -f /tmp/d.dmp /mnt/A
# Added the following
cd=20
umount /mnt/A && mdconfig -du 0 && rm /tmp/testf
# Could replace the from here to next comment with "rm -v file-ext"=20
truncate -s 64m /tmp/testf
M=3D`mdconfig -a -t vnode -f /tmp/testf`
newfs /dev/$M
mount /dev/$M /mnt/A
cd /mnt/A && restore -rvf /tmp/d.dmp
#
lsextattr system file-ext;=20
getextattr system m file-ext; getextattr user sz file-ext
cd
exit
umount /mnt/A; mdconfig -du 0

Results:
During restore - note that the name and value appear to be merged in the sy=
stem
table.
Set attributes for ./file-ext:
        system, (40 bytes), mb1946ac92492d2347c6235b4d2611184
        user, (24 bytes), sz

If we change=20
setextattr system m "`md5 -q file-ext`" file-ext
to
setextattr system m "`md5 -q file-ext|head -c 6`" file-ext
We get a different result during restore
Set attributes for ./file-ext:
        system, (16 bytes), mb1946a (unable to set)
        user, (24 bytes), sz

Something is very confused.
Happy to test as we tried quite a few combinations of restoring on
same/different vnode devices with more complex ext attributes.

--=20
You are receiving this mail because:
You are the assignee for the bug.=



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-216127-8>