Bug 434893 - resizing leads to missing xattrs
resizing leads to missing xattrs
Product: Fedora
Classification: Fedora
Component: e2fsprogs (Show other bugs)
All Linux
low Severity low
: ---
: ---
Assigned To: Eric Sandeen
Fedora Extras Quality Assurance
: Reopened
Depends On:
Blocks: F9Beta
  Show dependency treegraph
Reported: 2008-02-25 21:41 EST by Jeremy Katz
Modified: 2008-03-03 22:25 EST (History)
2 users (show)

See Also:
Fixed In Version: 1.40.7-2
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2008-03-03 22:25:29 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
patch sent upstream (2.47 KB, patch)
2008-02-28 14:33 EST, Eric Sandeen
no flags Details | Diff

  None (edit)
Description Jeremy Katz 2008-02-25 21:41:35 EST
Doing the resize as part of the livecd build process with e2fsprogs-1.40.6 leads
to corrupted xattrs on the filesystem and the live image not booting with
selinux enabled.  If I fall back to 1.40.2 from F8 (or disable the resize), then
it works fine
Comment 1 Eric Sandeen 2008-02-26 02:10:44 EST
Jeremy, could you create an e2image of the filesystem, before & after the resize?

If you bzip2 it it shouldn't be too big...

If it's a hassle I can try to reproduce on my own.
Comment 2 Jeremy Katz 2008-02-26 09:28:50 EST
I can try to get one in a little bit... it might be a tad tricky given the way
the images are built.  
  livecd-creator --config=/usr/share/livecd-tools/livecd-fedora-minimal.ks
gets you a livecd with the resize done.
Comment 3 Eric Sandeen 2008-02-26 14:26:38 EST
So, it appears that the end result is actually *missing* selinux xattrs, rather
than corrupted, per se.  Some files have the proper xattrs on disk; others have
Comment 4 Jeremy Katz 2008-02-26 18:03:46 EST
And per discussion on IRC, I tried creating the filesystem with -I128 and things
were fine then.
Comment 5 Eric Sandeen 2008-02-26 19:41:54 EST
(oops sorry for fat-fingering the summary)  :)

quick non-livecd-creator test:


dd if=/dev/zero of=fsfile bs=1M count=100
mkfs.ext3 -I 256 -F fsfile
mount -o loop,user_xattr fsfile mnt
for I in `seq 1 1000`; do dd if=/dev/zero bs=128k count=1 of=mnt/file$I;
setfattr -n user.name -v value$I mnt/file$I 2>/dev/null; done
for I in `seq 1 800`; do rm -f mnt/file$I; done
getfattr -n user.name mnt/file82?
umount mnt
e2fsck -f fsfile
resize2fs fsfile 6M
resize2fs fsfile 5M
resize2fs fsfile 4M
mount -o loop,user_xattr fsfile mnt
getfattr -n user.name mnt/file82?
umount mnt

it appears that when resize2fs needs to move inodes, it leaves in-inode xattrs
behind.  Oops.
Comment 6 Eric Sandeen 2008-02-26 20:14:08 EST
Ok, I see what's up here... will get it patched up shortly.

larger inodes with in-inode xattrs will lose and/or corrupt the xattrs whenever
the inodes are moved in the process of shrinking.
Comment 7 Eric Sandeen 2008-02-28 14:33:50 EST
Created attachment 296249 [details]
patch sent upstream

I sent a regression test for this, too...
Comment 8 Eric Sandeen 2008-02-29 11:40:14 EST
On its way to rawhide via e2fsprogs-1.40.7-1
Comment 9 Jeremy Katz 2008-02-29 21:23:33 EST
Regular files look to be okay with 1.40.7-1, but symlinks still seem to come out
with missing xattrs
Comment 10 Eric Sandeen 2008-02-29 21:58:22 EST
were the link targets long or short... and did they have missing or wrong
attributes?  Trying to reproduce here...
Comment 11 Eric Sandeen 2008-02-29 22:17:20 EST
oh and were the attrs on the symlinks or their targets...?
Comment 12 Eric Sandeen 2008-03-03 22:25:29 EST
Once more, with feeling.  e2fsprogs-1.40.7-2 should fix it, building now.

I tested livecd creation as far as getting an image, fsck'ing it, and checking
that the symlinks all had their attrs... hope it's good this time :)


Note You need to log in before you can comment on or make changes to this bug.