[Bug 216127] sbin/restore doesn't honour extended attributes (extattr on ufs)
bugzilla-noreply at freebsd.org
bugzilla-noreply at freebsd.org
Mon Jan 16 01:17:07 UTC 2017
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=216127
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 at FreeBSD.org
Reporter: dewayne at heuristicsystems.com.au
CC: freebsd-amd64 at FreeBSD.org
CC: freebsd-amd64 at FreeBSD.org
During a ufs filesystem restore we found that extended attributes weren't
correctly installed on
# uname -aKU
FreeBSD hathor 11.0-STABLE FreeBSD 11.0-STABLE #0 r311660M: Sun Jan 8 21:30:51
AEDT 2017 root at 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
truncate -s 64m /tmp/testf
M=`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;
getextattr system hi file-ext; getextattr user sz file-ext
exit
umount /mnt/A && mdconfig -du 0
# Test for failure.
sh
truncate -s 64m /tmp/testf
M=`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
umount /mnt/A && mdconfig -du 0 && rm /tmp/testf
# Could replace the from here to next comment with "rm -v file-ext"
truncate -s 64m /tmp/testf
M=`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;
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 system
table.
Set attributes for ./file-ext:
system, (40 bytes), mb1946ac92492d2347c6235b4d2611184
user, (24 bytes), sz
If we change
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.
--
You are receiving this mail because:
You are on the CC list for the bug.
More information about the freebsd-amd64
mailing list