Re: [PATCH] (and bad attr2 bug) - pack xfs_sb_t for 64-bit arches

Eric Sandeen
2006-11-20T03:51:52Z

Eric Sandeen wrote:
> Eric Sandeen wrote:
>> see also https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=212201
>>
>> Bugzilla Bug 212201: Cannot build sysem with XFS file system.
>>
>> I turned on attr2 in FC6 at nathan's suggestion, for selinux goodness
>> with more efficient xattr space usage.
>>
>> But, many reports that this was totally broken in fc6, on x86_64.
>
> ugh. it's broken on x86 too, so it's not just the alignment/padding,
> although that should be fixed for cross-arch mounts.
>
> -Eric
>
>
here's a testcase to corrupt it FWIW.

Russell has a slightly different one derived from this.

#!/bin/sh

remount() {
umount mnt
xfs_db -r fsfile2 -c "inode 131" -c "p core.forkoff" -c "p u" -c "p a"
mount -o loop fsfile2 mnt/
}

umount mnt/
rm -f fsfile2
mkfs.xfs -dfile,name=fsfile2,size=100m -iattr=2
mount -o loop fsfile2 mnt/
mkdir mnt/dir
setfattr -n user.rity.selinux -v user_foo:blah_foo:mnt_what:0 mnt/dir/
for I in `seq 10 20`; do touch mnt/file$I; done
for I in `seq 100 700`; do touch mnt/dir/file$I; done
remount
for I in `seq 1000 1400`; do touch mnt/dir/file$I; done
#remount # works if we do remount here
setfattr -n user.rity.selinux -v user_foo:blah_foo:mnt_what:0 mnt/dir/
echo "unmounting"
umount mnt/
xfs_db -r fsfile2 -c "inode 131" -c "p core.forkoff" -c "p u" -c "p a"
-c "type text" -c "p"

Run it and you'll get the bmap root block from the wrong offset; it'll
be "0"

-Eric